diff mbox

[4/9] ceph: show all options in client_options even if option is equal with default value

Message ID 1525682645-30510-5-git-send-email-dongsheng.yang@easystack.cn (mailing list archive)
State New, archived
Headers show

Commit Message

Dongsheng Yang May 7, 2018, 8:44 a.m. UTC
As the /sys/kernel/debug/ceph/XXX/client_options only print options
which is different with default values, user are not able to know
the default values of them.

This patch make the /sys/kernel/debug/ceph/XXX/client_options to show
all options even if the option is equal with default value.

Signed-off-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
---
 fs/ceph/super.c              |  2 +-
 include/linux/ceph/libceph.h |  2 +-
 net/ceph/ceph_common.c       | 10 +++++-----
 net/ceph/debugfs.c           |  2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

Comments

Ilya Dryomov May 7, 2018, 2:06 p.m. UTC | #1
On Mon, May 7, 2018 at 10:44 AM, Dongsheng Yang
<dongsheng.yang@easystack.cn> wrote:
> As the /sys/kernel/debug/ceph/XXX/client_options only print options
> which is different with default values, user are not able to know
> the default values of them.
>
> This patch make the /sys/kernel/debug/ceph/XXX/client_options to show
> all options even if the option is equal with default value.

See the point about defaults in my reply to 1/9.

Thanks,

                Ilya
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 286e8db..422adf4 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -517,7 +517,7 @@  static int ceph_show_options(struct seq_file *m, struct dentry *root)
 	seq_putc(m, ',');
 	pos = m->count;
 
-	ret = ceph_print_client_options(m, fsc->client);
+	ret = ceph_print_client_options(m, fsc->client, false);
 	if (ret)
 		return ret;
 
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 49c93b9..9ce689a 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -275,7 +275,7 @@  extern struct ceph_options *ceph_parse_options(char *options,
 			      const char *dev_name, const char *dev_name_end,
 			      int (*parse_extra_token)(char *c, void *private),
 			      void *private);
-int ceph_print_client_options(struct seq_file *m, struct ceph_client *client);
+int ceph_print_client_options(struct seq_file *m, struct ceph_client *client, bool skip_default);
 extern void ceph_destroy_options(struct ceph_options *opt);
 extern int ceph_compare_options(struct ceph_options *new_opt,
 				struct ceph_client *client);
diff --git a/net/ceph/ceph_common.c b/net/ceph/ceph_common.c
index 584fdbe..2a9f2e0 100644
--- a/net/ceph/ceph_common.c
+++ b/net/ceph/ceph_common.c
@@ -550,7 +550,7 @@  struct ceph_options *
 }
 EXPORT_SYMBOL(ceph_parse_options);
 
-int ceph_print_client_options(struct seq_file *m, struct ceph_client *client)
+int ceph_print_client_options(struct seq_file *m, struct ceph_client *client, bool skip_default)
 {
 	struct ceph_options *opt = client->options;
 	size_t pos = m->count;
@@ -576,16 +576,16 @@  int ceph_print_client_options(struct seq_file *m, struct ceph_client *client)
 	if ((opt->flags & CEPH_OPT_TCP_NODELAY) == 0)
 		seq_puts(m, "notcp_nodelay,");
 
-	if (opt->mount_timeout != CEPH_MOUNT_TIMEOUT_DEFAULT)
+	if (opt->mount_timeout != CEPH_MOUNT_TIMEOUT_DEFAULT || !skip_default)
 		seq_printf(m, "mount_timeout=%d,",
 			   jiffies_to_msecs(opt->mount_timeout) / 1000);
-	if (opt->osd_idle_ttl != CEPH_OSD_IDLE_TTL_DEFAULT)
+	if (opt->osd_idle_ttl != CEPH_OSD_IDLE_TTL_DEFAULT || !skip_default)
 		seq_printf(m, "osd_idle_ttl=%d,",
 			   jiffies_to_msecs(opt->osd_idle_ttl) / 1000);
-	if (opt->osd_keepalive_timeout != CEPH_OSD_KEEPALIVE_DEFAULT)
+	if (opt->osd_keepalive_timeout != CEPH_OSD_KEEPALIVE_DEFAULT || !skip_default)
 		seq_printf(m, "osdkeepalivetimeout=%d,",
 		    jiffies_to_msecs(opt->osd_keepalive_timeout) / 1000);
-	if (opt->osd_request_timeout != CEPH_OSD_REQUEST_TIMEOUT_DEFAULT)
+	if (opt->osd_request_timeout != CEPH_OSD_REQUEST_TIMEOUT_DEFAULT || !skip_default)
 		seq_printf(m, "osd_request_timeout=%d,",
 			   jiffies_to_msecs(opt->osd_request_timeout) / 1000);
 
diff --git a/net/ceph/debugfs.c b/net/ceph/debugfs.c
index 0295260..46f6570 100644
--- a/net/ceph/debugfs.c
+++ b/net/ceph/debugfs.c
@@ -375,7 +375,7 @@  static int client_options_show(struct seq_file *s, void *p)
 	struct ceph_client *client = s->private;
 	int ret;
 
-	ret = ceph_print_client_options(s, client);
+	ret = ceph_print_client_options(s, client, true);
 	if (ret)
 		return ret;