From patchwork Mon Mar 26 05:38:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongsheng Yang X-Patchwork-Id: 10307159 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E3EAA600F6 for ; Mon, 26 Mar 2018 05:38:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E53142946B for ; Mon, 26 Mar 2018 05:38:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D98E529475; Mon, 26 Mar 2018 05:38:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F34A2946B for ; Mon, 26 Mar 2018 05:38:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750981AbeCZFih (ORCPT ); Mon, 26 Mar 2018 01:38:37 -0400 Received: from m97134.mail.qiye.163.com ([220.181.97.134]:41927 "EHLO m97134.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750955AbeCZFig (ORCPT ); Mon, 26 Mar 2018 01:38:36 -0400 Received: from atest-guest.localdomain (unknown [218.94.118.90]) by smtp5 (Coremail) with SMTP id huCowAA3K2dFh7haYXBfAQ--.1573S2; Mon, 26 Mar 2018 13:38:13 +0800 (CST) From: Dongsheng Yang To: idryomov@gmail.com, elder@kernel.org, sage@redhat.com, jdillama@redhat.com Cc: ceph-devel@vger.kernel.org, Dongsheng Yang Subject: [PATCH v3] ceph: show all options in client_options even if option is equal with default value Date: Mon, 26 Mar 2018 01:38:05 -0400 Message-Id: <1522042685-26878-1-git-send-email-dongsheng.yang@easystack.cn> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: X-CM-TRANSID: huCowAA3K2dFh7haYXBfAQ--.1573S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxWw15Cr4fuw48WF4UJFy7ZFb_yoWrGw47p3 WDCw1UAw48ZF1Sgws7Ja1kuryrAF48JF47ZFyDCw43CFnaqw1kt3Wvk3sIgr17ZFWxAF4q 9r1q9FWjg34UZ37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0J18rb8UUUUU= X-Originating-IP: [218.94.118.90] X-CM-SenderInfo: 5grqw2pkhqwhp1dqwq5hdv52pwdfyhdfq/1tbicwUVeln5eLxmoAAAs7 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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(-) diff --git a/fs/ceph/super.c b/fs/ceph/super.c index fb2bc9c..d752d58 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -496,7 +496,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 c2ec44c..a778c07 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h @@ -274,7 +274,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 4d4c822..7f3f6d4 100644 --- a/net/ceph/ceph_common.c +++ b/net/ceph/ceph_common.c @@ -544,7 +544,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; @@ -570,16 +570,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 1eef680..def53cb 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;