ceph-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Venky Shankar <vshankar@redhat.com>
To: jlayton@redhat.com, pdonnell@redhat.com
Cc: ceph-devel@vger.kernel.org, Venky Shankar <vshankar@redhat.com>
Subject: [PATCH 2/2] ceph: add debugfs entries for v2 (new) mount syntax support
Date: Thu, 19 Aug 2021 11:37:01 +0530	[thread overview]
Message-ID: <20210819060701.25486-3-vshankar@redhat.com> (raw)
In-Reply-To: <20210819060701.25486-1-vshankar@redhat.com>

Signed-off-by: Venky Shankar <vshankar@redhat.com>
---
 fs/ceph/debugfs.c | 28 ++++++++++++++++++++++++++++
 fs/ceph/super.c   |  3 +++
 fs/ceph/super.h   |  2 ++
 3 files changed, 33 insertions(+)

diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index 66989c880adb..d19f15ace781 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -22,6 +22,12 @@
 #include "mds_client.h"
 #include "metric.h"
 
+#define MNT_DEV_SUPPORT_DIR   "dev_support"
+#define MNT_DEV_V2_FILE  "v2"
+
+static struct dentry *ceph_mnt_dev_support_dir;
+static struct dentry *ceph_mnt_dev_v2_file;
+
 static int mdsmap_show(struct seq_file *s, void *p)
 {
 	int i;
@@ -416,6 +422,20 @@ void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
 						  &status_fops);
 }
 
+void ceph_fs_debugfs_mnt_dev_init(void)
+{
+	ceph_mnt_dev_support_dir = ceph_debugfs_create_subdir(MNT_DEV_SUPPORT_DIR);
+	ceph_mnt_dev_v2_file = debugfs_create_file(MNT_DEV_V2_FILE,
+						   0400,
+						   ceph_mnt_dev_support_dir,
+						   NULL, NULL);
+}
+
+void ceph_fs_debugfs_mnt_dev_cleanup(void)
+{
+	debugfs_remove(ceph_mnt_dev_v2_file);
+	ceph_debugfs_cleanup_subdir(ceph_mnt_dev_support_dir);
+}
 
 #else  /* CONFIG_DEBUG_FS */
 
@@ -427,4 +447,12 @@ void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
 {
 }
 
+void ceph_fs_debugfs_mnt_dev_init(void)
+{
+}
+
+void ceph_fs_debugfs_mnt_dev_cleanup(void)
+{
+}
+
 #endif  /* CONFIG_DEBUG_FS */
diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index 609ffc8c2d78..21e4a8249afd 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_mnt_dev_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_mnt_dev_cleanup();
 	unregister_filesystem(&ceph_fs_type);
 	destroy_caches();
 }
diff --git a/fs/ceph/super.h b/fs/ceph/super.h
index 8f71184b7c85..3c63c1adcfaa 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_mnt_dev_init(void);
+extern void ceph_fs_debugfs_mnt_dev_cleanup(void);
 
 /* quota.c */
 static inline bool __ceph_has_any_quota(struct ceph_inode_info *ci)
-- 
2.27.0


  parent reply	other threads:[~2021-08-19  6:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  6:06 [PATCH 0/2] ceph: add debugfs entries signifying new mount syntax support Venky Shankar
2021-08-19  6:07 ` [PATCH 1/2] ceph: add helpers to create/cleanup debugfs sub-directories under "ceph" directory Venky Shankar
2021-08-19 17:16   ` Jeff Layton
2021-08-23  4:55     ` Venky Shankar
2021-08-23 10:30       ` Jeff Layton
2021-08-19  6:07 ` Venky Shankar [this message]
2021-08-19 17:28 ` [PATCH 0/2] ceph: add debugfs entries signifying new mount syntax support Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210819060701.25486-3-vshankar@redhat.com \
    --to=vshankar@redhat.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=jlayton@redhat.com \
    --cc=pdonnell@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).