]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/util.c
New upstream release
[bcachefs-tools-debian] / libbcachefs / util.c
index 2709163e02b538b0b0a6df075a56ba48b4ed8e6c..463260c0458575c2492c165087e4e6eb05c3d58f 100644 (file)
@@ -154,7 +154,7 @@ void bch2_flags_to_text(struct printbuf *out,
 u64 bch2_read_flag_list(char *opt, const char * const list[])
 {
        u64 ret = 0;
-       char *p, *s, *d = kstrndup(opt, PAGE_SIZE - 1, GFP_KERNEL);
+       char *p, *s, *d = kstrdup(opt, GFP_KERNEL);
 
        if (!d)
                return -ENOMEM;
@@ -887,13 +887,9 @@ void eytzinger0_find_test(void)
  */
 u64 *bch2_acc_percpu_u64s(u64 __percpu *p, unsigned nr)
 {
-       u64 *ret;
+       u64 *ret = this_cpu_ptr(p);
        int cpu;
 
-       preempt_disable();
-       ret = this_cpu_ptr(p);
-       preempt_enable();
-
        for_each_possible_cpu(cpu) {
                u64 *i = per_cpu_ptr(p, cpu);