summaryrefslogtreecommitdiff
path: root/libbcachefs/sysfs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-12-19 15:20:44 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2018-12-19 15:21:54 -0500
commit99ccaf73a8b92d6cb5d6892142a12468081a2b0d (patch)
tree33485dc8938ec4ff92fd653fae58355a85e861cc /libbcachefs/sysfs.c
parentf9ba96e16535a653b97f7f1f953fabf477737a96 (diff)
Update bcachefs sources to 2724e115d2 bcachefs: Lots of option handling improvements
Diffstat (limited to 'libbcachefs/sysfs.c')
-rw-r--r--libbcachefs/sysfs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libbcachefs/sysfs.c b/libbcachefs/sysfs.c
index 88316519..316f827f 100644
--- a/libbcachefs/sysfs.c
+++ b/libbcachefs/sysfs.c
@@ -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);