]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: put fsid in debugfs dir name
authorSage Weil <sage@newdream.net>
Thu, 17 Sep 2009 18:28:53 +0000 (11:28 -0700)
committerSage Weil <sage@newdream.net>
Thu, 17 Sep 2009 19:04:35 +0000 (12:04 -0700)
src/kernel/debugfs.c
src/kernel/super.h

index 09df5f10488dad3474cf5d59d02186a9dd27517a..06bc8a632bd923ef07cbcf1ac822e7dbaeee06e2 100644 (file)
@@ -11,7 +11,6 @@
  *
  * /sys/kernel/debug/ceph/caps_reservation  - expose caps reservation stats
  * /sys/kernel/debug/ceph/client*  - an instance of the ceph client
- *      .../fsid        - mounted fsid
  *      .../osdmap      - current osdmap
  *      .../mdsmap      - current mdsmap
  *      .../monmap      - current monmap
 static struct dentry *ceph_debugfs_dir;
 static struct dentry *ceph_debugfs_caps_reservation;
 
-static int fsid_show(struct seq_file *s, void *p)
-{
-       struct ceph_client *client = s->private;
-       struct ceph_fsid *f = &client->monc.monmap->fsid;
-
-       seq_printf(s, FSID_FORMAT "\n", PR_FSID(f));
-       return 0;
-}
-
 static int monmap_show(struct seq_file *s, void *p)
 {
        int i;
@@ -315,7 +305,6 @@ static const struct file_operations name##_fops = {                 \
        .release        = single_release,                               \
 };
 
-DEFINE_SHOW_FUNC(fsid_show)
 DEFINE_SHOW_FUNC(monmap_show)
 DEFINE_SHOW_FUNC(mdsmap_show)
 DEFINE_SHOW_FUNC(osdmap_show)
@@ -358,10 +347,10 @@ void ceph_debugfs_cleanup(void)
 int ceph_debugfs_client_init(struct ceph_client *client)
 {
        int ret = 0;
-#define TMP_NAME_SIZE 16
-       char name[TMP_NAME_SIZE];
+       char name[80];
 
-       snprintf(name, TMP_NAME_SIZE, "client%lld", client->whoami);
+       snprintf(name, sizeof(name), "client%lld." FSID_FORMAT,
+                client->whoami, PR_FSID(&client->monc.monmap->fsid));
 
        client->debugfs_dir = debugfs_create_dir(name, ceph_debugfs_dir);
        if (!client->debugfs_dir)
@@ -391,14 +380,6 @@ int ceph_debugfs_client_init(struct ceph_client *client)
        if (ret)
                goto out;
 
-       client->debugfs_fsid = debugfs_create_file("fsid",
-                                       0600,
-                                       client->debugfs_dir,
-                                       client,
-                                       &fsid_show_fops);
-       if (!client->debugfs_fsid)
-               goto out;
-
        client->debugfs_monmap = debugfs_create_file("monmap",
                                        0600,
                                        client->debugfs_dir,
@@ -447,7 +428,6 @@ void ceph_debugfs_client_cleanup(struct ceph_client *client)
        debugfs_remove(client->debugfs_monmap);
        debugfs_remove(client->debugfs_mdsmap);
        debugfs_remove(client->debugfs_osdmap);
-       debugfs_remove(client->debugfs_fsid);
        debugfs_remove(client->debugfs_dir);
 }
 
index d50e93dfabab066a1225f49c853ce54fe1bca9c0..c5ffe2c4b6e80af7c146d44d67432a9f4bab82b8 100644 (file)
@@ -110,7 +110,7 @@ static inline unsigned long time_sub(unsigned long a, unsigned long b)
  */
 struct ceph_client {
        __s64 whoami;                   /* my client number */
-       struct dentry *debugfs_fsid, *debugfs_monmap;
+       struct dentry *debugfs_monmap;
        struct dentry *debugfs_mdsmap, *debugfs_osdmap;
        struct dentry *debugfs_dir, *debugfs_dentry_lru;