diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2015-03-25 14:07:41 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2015-04-20 11:55:39 -0400 |
commit | 5cf7bd30120ead3db43ef9074be38018d9acf22f (patch) | |
tree | 30206e8a84384c413eee7a825a5238391193f0bd /net | |
parent | ff40f9ae95917b72b6acb6057471c99054b6ee24 (diff) |
libceph: expose client options through debugfs
Add a client_options attribute for showing libceph options.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ceph/debugfs.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/net/ceph/debugfs.c b/net/ceph/debugfs.c index 14d9995097cc..593dc2eabcc8 100644 --- a/net/ceph/debugfs.c +++ b/net/ceph/debugfs.c | |||
@@ -22,6 +22,7 @@ | |||
22 | * .../monmap - current monmap | 22 | * .../monmap - current monmap |
23 | * .../osdc - active osd requests | 23 | * .../osdc - active osd requests |
24 | * .../monc - mon client state | 24 | * .../monc - mon client state |
25 | * .../client_options - libceph-only (i.e. not rbd or cephfs) options | ||
25 | * .../dentry_lru - dump contents of dentry lru | 26 | * .../dentry_lru - dump contents of dentry lru |
26 | * .../caps - expose cap (reservation) stats | 27 | * .../caps - expose cap (reservation) stats |
27 | * .../bdi - symlink to ../../bdi/something | 28 | * .../bdi - symlink to ../../bdi/something |
@@ -177,10 +178,24 @@ static int osdc_show(struct seq_file *s, void *pp) | |||
177 | return 0; | 178 | return 0; |
178 | } | 179 | } |
179 | 180 | ||
181 | static int client_options_show(struct seq_file *s, void *p) | ||
182 | { | ||
183 | struct ceph_client *client = s->private; | ||
184 | int ret; | ||
185 | |||
186 | ret = ceph_print_client_options(s, client); | ||
187 | if (ret) | ||
188 | return ret; | ||
189 | |||
190 | seq_putc(s, '\n'); | ||
191 | return 0; | ||
192 | } | ||
193 | |||
180 | CEPH_DEFINE_SHOW_FUNC(monmap_show) | 194 | CEPH_DEFINE_SHOW_FUNC(monmap_show) |
181 | CEPH_DEFINE_SHOW_FUNC(osdmap_show) | 195 | CEPH_DEFINE_SHOW_FUNC(osdmap_show) |
182 | CEPH_DEFINE_SHOW_FUNC(monc_show) | 196 | CEPH_DEFINE_SHOW_FUNC(monc_show) |
183 | CEPH_DEFINE_SHOW_FUNC(osdc_show) | 197 | CEPH_DEFINE_SHOW_FUNC(osdc_show) |
198 | CEPH_DEFINE_SHOW_FUNC(client_options_show) | ||
184 | 199 | ||
185 | int ceph_debugfs_init(void) | 200 | int ceph_debugfs_init(void) |
186 | { | 201 | { |
@@ -242,6 +257,14 @@ int ceph_debugfs_client_init(struct ceph_client *client) | |||
242 | if (!client->debugfs_osdmap) | 257 | if (!client->debugfs_osdmap) |
243 | goto out; | 258 | goto out; |
244 | 259 | ||
260 | client->debugfs_options = debugfs_create_file("client_options", | ||
261 | 0600, | ||
262 | client->debugfs_dir, | ||
263 | client, | ||
264 | &client_options_show_fops); | ||
265 | if (!client->debugfs_options) | ||
266 | goto out; | ||
267 | |||
245 | return 0; | 268 | return 0; |
246 | 269 | ||
247 | out: | 270 | out: |
@@ -252,6 +275,7 @@ out: | |||
252 | void ceph_debugfs_client_cleanup(struct ceph_client *client) | 275 | void ceph_debugfs_client_cleanup(struct ceph_client *client) |
253 | { | 276 | { |
254 | dout("ceph_debugfs_client_cleanup %p\n", client); | 277 | dout("ceph_debugfs_client_cleanup %p\n", client); |
278 | debugfs_remove(client->debugfs_options); | ||
255 | debugfs_remove(client->debugfs_osdmap); | 279 | debugfs_remove(client->debugfs_osdmap); |
256 | debugfs_remove(client->debugfs_monmap); | 280 | debugfs_remove(client->debugfs_monmap); |
257 | debugfs_remove(client->osdc.debugfs_file); | 281 | debugfs_remove(client->osdc.debugfs_file); |