Skip to contentSkip to conversation

ceph: use seq_show_option for string type options

PATCH Superseded Chengguang Xu 2 participants 5 messages Feb 13, 2018 – Feb 14, 2018 Ceph client

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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
index a62d2a9..d8a33ad 100644
@@ -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
maintainer
#1 lore raw
Quoted 12 lines · Chengguang Xu

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 +0 -0
index a62d2a9..d8a33ad 100644

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

#2 lore raw
Quoted 26 lines · 在 2018年2月13日,下午5:45,Ilya Dryomov <[email protected]> 写道:
Quoted 12 lines · Chengguang Xu

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 +0 -0
index a62d2a9..d8a33ad 100644

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,

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.

maintainer
#3 lore raw
Quoted 26 lines · Chengguang Xu
Quoted 26 lines · 在 2018年2月13日,下午5:45,Ilya Dryomov <[email protected]> 写道:
Quoted 12 lines · Chengguang Xu

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 +0 -0
index a62d2a9..d8a33ad 100644

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,

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

#4 lore raw
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_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 +0 -0
index a62d2a9..d8a33ad 100644

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?

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.