ceph: use seq_show_option for string type options
PATCH 1/1 ceph: use seq_show_option for string type options
Using seq_show_option to replace seq_printf for string type options.
--- fs/ceph/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ceph/super.c +2 -2
@@ -512,7 +512,7 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)seq_puts (m,",nodcache" );if (fsopt->flags &CEPH_MOUNT_OPT_FSCACHE ) {if (fsopt->fscache_uniq) -seq_printf (m,",fsc=%s" , fsopt->fscache_uniq); +seq_show_option (m,"fsc" , fsopt->fscache_uniq);else seq_puts (m,",fsc" ); }
@@ -527,7 +527,7 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)#endif if (fsopt->mds_namespace) -seq_printf (m,",mds_namespace=%s" , fsopt->mds_namespace); +seq_show_option (m,"mds_namespace" , fsopt->mds_namespace);if (fsopt->wsize)seq_printf (m,",wsize=%d" , fsopt->wsize);if (fsopt->rsize !=CEPH_MAX_READ_SIZE )
Signature · 1 line
1.8.3.1
Ilya Dryomov
maintainerQuoted 12 lines · Chengguang Xu
Using
seq_show_optionto replaceseq_printffor string type options.Signed-off-by Chengguang Xu <[email protected]>--- fs/ceph/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/ceph/super.c +0
-0
fs/ceph/super.c static int ceph_show_options(struct seq_file *m, struct dentry *root) · line 517
Quoted 7 lines
fs/ceph/super.c +1
-1@@ -512,7 +512,7 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)seq_puts (m,",nodcache" );if (fsopt->flags &CEPH_MOUNT_OPT_FSCACHE ) {if (fsopt->fscache_uniq) -seq_printf (m,",fsc=%s" , fsopt->fscache_uniq); +seq_show_option (m,"fsc" , fsopt->fscache_uniq);else seq_puts (m,",fsc" );
Hi Chengguang,
seq_show_option() should be able to handle !fsopt->fscache_uniq?
Thanks,
Ilya
Quoted 26 lines · 在 2018年2月13日,下午5:45,Ilya Dryomov <[email protected]> 写道:
Quoted 12 lines · Chengguang Xu
Using
seq_show_optionto replaceseq_printffor string type options.Signed-off-by Chengguang Xu <[email protected]>---
fs/ceph/super.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)fs/ceph/super.c +0
-0fs/ceph/super.c static int ceph_show_options(struct seq_file *m, struct dentry *root) · line 517
Quoted 7 lines
fs/ceph/super.c +1
-1@@ -512,7 +512,7 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)seq_puts (m,",nodcache" );if (fsopt->flags &CEPH_MOUNT_OPT_FSCACHE ) {if (fsopt->fscache_uniq) -seq_printf (m,",fsc=%s" , fsopt->fscache_uniq); +seq_show_option (m,"fsc" , fsopt->fscache_uniq);else seq_puts (m,",fsc" );Hi Chengguang,
Quoted 1 line
seq_show_option()should be able to handle !fsopt->fscache_uniq?
Hi Ilya
Sorry, I don’t get your point here.
Thanks,
Chengguang.
Ilya Dryomov
maintainerQuoted 26 lines · Chengguang Xu
Quoted 26 lines · 在 2018年2月13日,下午5:45,Ilya Dryomov <[email protected]> 写道:
Quoted 12 lines · Chengguang Xu
Using
seq_show_optionto replaceseq_printffor string type options.Signed-off-by Chengguang Xu <[email protected]>---
fs/ceph/super.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)fs/ceph/super.c +0
-0fs/ceph/super.c static int ceph_show_options(struct seq_file *m, struct dentry *root) · line 517
Quoted 7 lines
fs/ceph/super.c +1
-1@@ -512,7 +512,7 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)seq_puts (m,",nodcache" );if (fsopt->flags &CEPH_MOUNT_OPT_FSCACHE ) {if (fsopt->fscache_uniq) -seq_printf (m,",fsc=%s" , fsopt->fscache_uniq); +seq_show_option (m,"fsc" , fsopt->fscache_uniq);else seq_puts (m,",fsc" );Hi Chengguang,
Quoted 5 lines
Quoted 1 line
seq_show_option()should be able to handle !fsopt->fscache_uniq?Hi Ilya
Sorry, I don’t get your point here.
I think it can be just
if (fsopt->flags & CEPH_MOUNT_OPT_FSCACHE)
seq_show_option(m, "fsc", fsopt->fscache_uniq);Thanks,
Ilya
Quoted 32 lines · 在 2018年2月13日,下午7:52,Ilya Dryomov <[email protected]> 写道:
Quoted 28 lines · Chengguang Xu
Quoted 27 lines · 在 2018年2月13日,下午5:45,Ilya Dryomov <[email protected]> 写道:
Quoted 12 lines · Chengguang Xu
Using
seq_show_optionto replaceseq_printffor string type options.Signed-off-by Chengguang Xu <[email protected]>---
fs/ceph/super.c| 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)fs/ceph/super.c +0
-0fs/ceph/super.c static int ceph_show_options(struct seq_file *m, struct dentry *root) · line 517
Quoted 7 lines
fs/ceph/super.c +1
-1@@ -512,7 +512,7 @@ static int ceph_show_options(struct seq_file *m, struct dentry *root)seq_puts (m,",nodcache" );if (fsopt->flags &CEPH_MOUNT_OPT_FSCACHE ) {if (fsopt->fscache_uniq) -seq_printf (m,",fsc=%s" , fsopt->fscache_uniq); +seq_show_option (m,"fsc" , fsopt->fscache_uniq);else seq_puts (m,",fsc" );Hi Chengguang,
seq_show_option()should be able to handle !fsopt->fscache_uniq?
Quoted 8 lines
Quoted 3 lines
Hi Ilya
Sorry, I don’t get your point here.
I think it can be just
if (fsopt->flags & CEPH_MOUNT_OPT_FSCACHE) seq_show_option(m, "fsc", fsopt->fscache_uniq);
Yes, it can work well in this case, I’ll resend revised version.
Thanks,
Chengguang.