From patchwork Fri Oct 1 05:00:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venky Shankar X-Patchwork-Id: 12529695 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 122CAC433F5 for ; Fri, 1 Oct 2021 05:00:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E1661613A7 for ; Fri, 1 Oct 2021 05:00:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351922AbhJAFCi (ORCPT ); Fri, 1 Oct 2021 01:02:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41644 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241541AbhJAFCh (ORCPT ); Fri, 1 Oct 2021 01:02:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633064454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4DJY4JzvE3GxKzy5PPFP7IFKW/lhu4y2zW523L/Na2o=; b=e07Fx1MqyfEfGUPjq6r5BAd4lM4xDNL1G1VPS8oxWYhS8xkhkNvNziUNrT4u3SkxhrxBm8 K8qb38HPZapQaBm4+11OiEp73WwaQS6HZ8xRNtBQLfarm/mIXNOTAAa52JUh6a/yMCyZ4d dxVmBFwYZ082dT4lGEwGpbjRfyyYXuw= Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-585-tYSFVjUmMGC8z0kl1SkV5Q-1; Fri, 01 Oct 2021 01:00:53 -0400 X-MC-Unique: tYSFVjUmMGC8z0kl1SkV5Q-1 Received: by mail-pj1-f72.google.com with SMTP id bx14-20020a17090af48e00b0019f1c6c254bso4661640pjb.4 for ; Thu, 30 Sep 2021 22:00:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4DJY4JzvE3GxKzy5PPFP7IFKW/lhu4y2zW523L/Na2o=; b=IAIVXF7JvJs5pjGBLn4p61Pdh8zj4+5a+0gZgOOcqXBRaZatEm5gVj6ikakSLvZjzX y49lnJ0rL6GaYFeBIHmfiwL7Z78NcSsjojfFXyJEK79/g2T2kJlfQqjXBfrbPRhR+BT7 SIdf38ha9EizfAyEpnVSd5J+WFxdPUSB9QQbQkDyzWDvppDzrzdxgfk9Wx+EIPXCLEP4 nZP1xh6ksSshb4aDOYAAX+7IqYYEgrfzYsOf/9O0FWxfEh0c2im1lDw2Ry5RJtTjvyT/ hWucxhKq7Dpg90zhAb6NuZROUkxagAy2lp99nt1MLZnbpvRF6laXI4Ix/FQzxlQrjY7E ZQmA== X-Gm-Message-State: AOAM532vyOIriuxjNl9wI8tF+lgYnBdAqY+hQ5ONYFP3JVWaGt2mR1iW 996skgqTnBDo9hknx3vYAkeBZoZnhHeIIzTevm7nSByxQrd94KcMw2mFoOwfVpP1MYaKufBw8Tg Y3Wavx03b/EXTrzax6A0Iyw== X-Received: by 2002:a17:902:f703:b029:12c:982:c9ae with SMTP id h3-20020a170902f703b029012c0982c9aemr7783186plo.20.1633064450614; Thu, 30 Sep 2021 22:00:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZpa8PzISBsH8aYCqNsi2HoPnI74/iruc1W1LcwoLX3H3s9Sf48tvsNwjFmNQSy8DNuUBIKQ== X-Received: by 2002:a17:902:f703:b029:12c:982:c9ae with SMTP id h3-20020a170902f703b029012c0982c9aemr7783066plo.20.1633064448918; Thu, 30 Sep 2021 22:00:48 -0700 (PDT) Received: from localhost.localdomain ([49.207.221.217]) by smtp.gmail.com with ESMTPSA id s3sm6377485pjr.1.2021.09.30.22.00.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:00:48 -0700 (PDT) From: Venky Shankar To: jlayton@redhat.com, pdonnell@redhat.com Cc: ceph-devel@vger.kernel.org, Venky Shankar Subject: [PATCH v4 1/2] libceph: export ceph_debugfs_dir for use in ceph.ko Date: Fri, 1 Oct 2021 10:30:36 +0530 Message-Id: <20211001050037.497199-2-vshankar@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211001050037.497199-1-vshankar@redhat.com> References: <20211001050037.497199-1-vshankar@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Signed-off-by: Venky Shankar --- include/linux/ceph/debugfs.h | 2 ++ net/ceph/debugfs.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/ceph/debugfs.h b/include/linux/ceph/debugfs.h index 8b3a1a7a953a..464c7dfced87 100644 --- a/include/linux/ceph/debugfs.h +++ b/include/linux/ceph/debugfs.h @@ -4,6 +4,8 @@ #include +extern struct dentry *ceph_debugfs_dir; + /* debugfs.c */ extern void ceph_debugfs_init(void); extern void ceph_debugfs_cleanup(void); diff --git a/net/ceph/debugfs.c b/net/ceph/debugfs.c index 2110439f8a24..774e0c0fd18a 100644 --- a/net/ceph/debugfs.c +++ b/net/ceph/debugfs.c @@ -29,7 +29,8 @@ * .../bdi - symlink to ../../bdi/something */ -static struct dentry *ceph_debugfs_dir; +struct dentry *ceph_debugfs_dir; +EXPORT_SYMBOL(ceph_debugfs_dir); static int monmap_show(struct seq_file *s, void *p) { From patchwork Fri Oct 1 05:00:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Venky Shankar X-Patchwork-Id: 12529697 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BFC2AC433EF for ; Fri, 1 Oct 2021 05:00:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2F4261A55 for ; Fri, 1 Oct 2021 05:00:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351949AbhJAFCj (ORCPT ); Fri, 1 Oct 2021 01:02:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41102 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230397AbhJAFCi (ORCPT ); Fri, 1 Oct 2021 01:02:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633064454; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yIv0dHQYBDLB+/l/xSVTr/5PzjLi1sZMuJjAXldYU2c=; b=A6/7oivDmIVmCpVPqwg01EtuAN+a4hKwleaTLtJGtyyi0/rE7GRFNtMA9RrYTpPFW73Eon WQPGM5XGc07P4e+wijG1H8cnSU0989IzeGInfO7MSGZUQdFnbmsQUHLTRWVZy6YSdnwZEs ENx9JyXI4Zk4QczDBEdyv80K1keOsgQ= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-139-qoCsplZSPPCNtinohx35Fg-1; Fri, 01 Oct 2021 01:00:53 -0400 X-MC-Unique: qoCsplZSPPCNtinohx35Fg-1 Received: by mail-pj1-f70.google.com with SMTP id v10-20020a17090abb8a00b0019f1a066f81so5505022pjr.9 for ; Thu, 30 Sep 2021 22:00:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yIv0dHQYBDLB+/l/xSVTr/5PzjLi1sZMuJjAXldYU2c=; b=DuvVbLZ2rILLSreQWA8/OkYw/AF7IJcfloksS4FWfLY9zwZB/m8aUQRiYmmrwReyK+ hnCKwagoKuF/9Tb0XHTMPduCPFyXNPYu9KCAPe7I5ID6Am6F2yzf55W4u/pKzEyYlUAs wslZOxMJKkUiOVyr1yVa0ha7cC2s2uHlzLuHs55Po0SGZTodgrMBUCdApIaq/ErjA2Zl YtuV4yPRt0FDppn8y2OP43dTErcnTPNC6BfW04yshsurubqCNwN9kHhQvbVEf5cPZbYo YiOak4fDuGbViDegaKchbfrQNljBA3lMmCljzd8RKnEyI+ZZbM9lBRNaiosvqKWsAdJp 67IQ== X-Gm-Message-State: AOAM5303qBQVXyJlmq/RJDCiK5M/U+ot/AeSXx+YDkPmjhsg2MjpGmW1 K1x07EXGs+59idssLmFF6TWhxJNoRjAZPS1munYPTkn7zY0RLhr/kS9d/XAZVrKrYFXuaBuUUW3 VHx6YDFCyV761y0d3h6nh1g== X-Received: by 2002:a17:90a:bd04:: with SMTP id y4mr10929188pjr.9.1633064452182; Thu, 30 Sep 2021 22:00:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYYrkLdXRXhRkDFD6dHxyCEJo4umhl98AOrzMByGEHXiQxkYoQ6SgTiGib2NUN7CzaOANYzw== X-Received: by 2002:a17:90a:bd04:: with SMTP id y4mr10929165pjr.9.1633064451954; Thu, 30 Sep 2021 22:00:51 -0700 (PDT) Received: from localhost.localdomain ([49.207.221.217]) by smtp.gmail.com with ESMTPSA id s3sm6377485pjr.1.2021.09.30.22.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 22:00:51 -0700 (PDT) From: Venky Shankar To: jlayton@redhat.com, pdonnell@redhat.com Cc: ceph-devel@vger.kernel.org, Venky Shankar Subject: [PATCH v4 2/2] ceph: add debugfs entries for mount syntax support Date: Fri, 1 Oct 2021 10:30:37 +0530 Message-Id: <20211001050037.497199-3-vshankar@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211001050037.497199-1-vshankar@redhat.com> References: <20211001050037.497199-1-vshankar@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Signed-off-by: Venky Shankar --- fs/ceph/debugfs.c | 41 +++++++++++++++++++++++++++++++++++++++++ fs/ceph/super.c | 3 +++ fs/ceph/super.h | 2 ++ 3 files changed, 46 insertions(+) diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c index 66989c880adb..d1610393c213 100644 --- a/fs/ceph/debugfs.c +++ b/fs/ceph/debugfs.c @@ -22,6 +22,16 @@ #include "mds_client.h" #include "metric.h" +#define META_INFO_DIR_NAME "meta" +#define CLIENT_FEATURES_DIR_NAME "client_features" +#define MOUNT_DEVICE_V1_SUPPORT_FILE_NAME "mount_syntax_v1" +#define MOUNT_DEVICE_V2_SUPPORT_FILE_NAME "mount_syntax_v2" + +static struct dentry *ceph_client_meta_dir; +static struct dentry *ceph_client_features_dir; +static struct dentry *ceph_mount_device_v1_support; +static struct dentry *ceph_mount_device_v2_support; + static int mdsmap_show(struct seq_file *s, void *p) { int i; @@ -416,6 +426,29 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc) &status_fops); } +void ceph_fs_debugfs_client_features_init(void) +{ + ceph_client_meta_dir = debugfs_create_dir(META_INFO_DIR_NAME, + ceph_debugfs_dir); + ceph_client_features_dir = debugfs_create_dir(CLIENT_FEATURES_DIR_NAME, + ceph_client_meta_dir); + ceph_mount_device_v1_support = debugfs_create_file(MOUNT_DEVICE_V1_SUPPORT_FILE_NAME, + 0400, + ceph_client_features_dir, + NULL, NULL); + ceph_mount_device_v2_support = debugfs_create_file(MOUNT_DEVICE_V2_SUPPORT_FILE_NAME, + 0400, + ceph_client_features_dir, + NULL, NULL); +} + +void ceph_fs_debugfs_client_features_cleanup(void) +{ + debugfs_remove(ceph_mount_device_v1_support); + debugfs_remove(ceph_mount_device_v2_support); + debugfs_remove(ceph_client_features_dir); + debugfs_remove(ceph_client_meta_dir); +} #else /* CONFIG_DEBUG_FS */ @@ -427,4 +460,12 @@ void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc) { } +void ceph_fs_debugfs_client_features_init(void) +{ +} + +void ceph_fs_debugfs_client_features_cleanup(void) +{ +} + #endif /* CONFIG_DEBUG_FS */ diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 609ffc8c2d78..21d59deb042d 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -1404,6 +1404,8 @@ static int __init init_ceph(void) if (ret) goto out_caches; + ceph_fs_debugfs_client_features_init(); + pr_info("loaded (mds proto %d)\n", CEPH_MDSC_PROTOCOL); return 0; @@ -1417,6 +1419,7 @@ static int __init init_ceph(void) static void __exit exit_ceph(void) { dout("exit_ceph\n"); + ceph_fs_debugfs_client_features_cleanup(); unregister_filesystem(&ceph_fs_type); destroy_caches(); } diff --git a/fs/ceph/super.h b/fs/ceph/super.h index 8f71184b7c85..7e7b140cab5d 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h @@ -1231,6 +1231,8 @@ extern int ceph_locks_to_pagelist(struct ceph_filelock *flocks, /* debugfs.c */ extern void ceph_fs_debugfs_init(struct ceph_fs_client *client); extern void ceph_fs_debugfs_cleanup(struct ceph_fs_client *client); +extern void ceph_fs_debugfs_client_features_init(void); +extern void ceph_fs_debugfs_client_features_cleanup(void); /* quota.c */ static inline bool __ceph_has_any_quota(struct ceph_inode_info *ci)