]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/sysfs.c
Update bcachefs sources to 2724e115d2 bcachefs: Lots of option handling improvements
[bcachefs-tools-debian] / libbcachefs / sysfs.c
index 883165196833ec698ae630aa6362c7bfba5b0308..316f827fa4907a4ff7fd771062b14638e807e6be 100644 (file)
@@ -72,9 +72,10 @@ do {                                                                 \
 #define sysfs_hprint(file, val)                                                \
 do {                                                                   \
        if (attr == &sysfs_ ## file) {                                  \
-               ssize_t ret = bch2_hprint(buf, val);                    \
-               strcat(buf, "\n");                                      \
-               return ret + 1;                                         \
+               struct printbuf out = _PBUF(buf, PAGE_SIZE);            \
+               bch2_hprint(&out, val);                                 \
+               pr_buf(&out, "\n");                                     \
+               return out.pos - buf;                                   \
        }                                                               \
 } while (0)
 
@@ -657,7 +658,7 @@ int bch2_opts_create_sysfs_files(struct kobject *kobj)
        for (i = bch2_opt_table;
             i < bch2_opt_table + bch2_opts_nr;
             i++) {
-               if (i->mode == OPT_INTERNAL)
+               if (!(i->mode & (OPT_FORMAT|OPT_MOUNT|OPT_RUNTIME)))
                        continue;
 
                ret = sysfs_create_file(kobj, &i->attr);