Skip to contentSkip to conversation

ovl: Use str_on_off() helper in ovl_show_options()

PATCH RESEND Superseded Thorsten Blum 2 participants 2 messages Jan 17, 2025 Overlay filesystem

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 ovl: Use str_on_off() helper in ovl_show_options()

Remove hard-coded strings by using the str_on_off() helper function.

---
 fs/overlayfs/params.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
fs/overlayfs/params.c +4 -5
index 1115c22deca0..8a8bb336b40f 100644
@@ -1053,17 +1053,16 @@ int ovl_show_options(struct seq_file *m, struct dentry *dentry)
 		seq_printf(m, ",redirect_dir=%s",
 			   ovl_redirect_mode(&ofs->config));
 	if (ofs->config.index != ovl_index_def)
-		seq_printf(m, ",index=%s", ofs->config.index ? "on" : "off");
+		seq_printf(m, ",index=%s", str_on_off(ofs->config.index));
 	if (ofs->config.uuid != ovl_uuid_def())
 		seq_printf(m, ",uuid=%s", ovl_uuid_mode(&ofs->config));
 	if (ofs->config.nfs_export != ovl_nfs_export_def)
-		seq_printf(m, ",nfs_export=%s", ofs->config.nfs_export ?
-						"on" : "off");
+		seq_printf(m, ",nfs_export=%s",
+			   str_on_off(ofs->config.nfs_export));
 	if (ofs->config.xino != ovl_xino_def() && !ovl_same_fs(ofs))
 		seq_printf(m, ",xino=%s", ovl_xino_mode(&ofs->config));
 	if (ofs->config.metacopy != ovl_metacopy_def)
-		seq_printf(m, ",metacopy=%s",
-			   ofs->config.metacopy ? "on" : "off");
+		seq_printf(m, ",metacopy=%s", str_on_off(ofs->config.metacopy));
 	if (ofs->config.ovl_volatile)
 		seq_puts(m, ",volatile");
 	if (ofs->config.userxattr)
Signature · 1 line
2.48.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Thorsten Blum

Remove hard-coded strings by using the str_on_off() helper function.

---

Fine by me.
I do not have any patch queued for the next merge window,
but if Christian wants to pick this up via his vfs tree, I wouldn't mind.

Thanks,
Amir.

Quoted 32 lines
 fs/overlayfs/params.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
fs/overlayfs/params.c +4 -6
index 1115c22deca0..8a8bb336b40f 100644
@@ -1053,17 +1053,16 @@ int ovl_show_options(struct seq_file *m, struct dentry *dentry)
                seq_printf(m, ",redirect_dir=%s",
                           ovl_redirect_mode(&ofs->config));
        if (ofs->config.index != ovl_index_def)
-               seq_printf(m, ",index=%s", ofs->config.index ? "on" : "off");
+               seq_printf(m, ",index=%s", str_on_off(ofs->config.index));
        if (ofs->config.uuid != ovl_uuid_def())
                seq_printf(m, ",uuid=%s", ovl_uuid_mode(&ofs->config));
        if (ofs->config.nfs_export != ovl_nfs_export_def)
-               seq_printf(m, ",nfs_export=%s", ofs->config.nfs_export ?
-                                               "on" : "off");
+               seq_printf(m, ",nfs_export=%s",
+                          str_on_off(ofs->config.nfs_export));
        if (ofs->config.xino != ovl_xino_def() && !ovl_same_fs(ofs))
                seq_printf(m, ",xino=%s", ovl_xino_mode(&ofs->config));
        if (ofs->config.metacopy != ovl_metacopy_def)
-               seq_printf(m, ",metacopy=%s",
-                          ofs->config.metacopy ? "on" : "off");
+               seq_printf(m, ",metacopy=%s", str_on_off(ofs->config.metacopy));
        if (ofs->config.ovl_volatile)
                seq_puts(m, ",volatile");
        if (ofs->config.userxattr)
--

2.48.0