debugfs.c (58f7553fa424fd0fd74e8b796d50c66014cebebe) debugfs.c (247b1f19dbeb4855cb891ca01428d7a81c1657a7)
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/ceph/ceph_debug.h>
3
4#include <linux/device.h>
5#include <linux/slab.h>
6#include <linux/module.h>
7#include <linux/ctype.h>
8#include <linux/debugfs.h>

--- 290 unchanged lines hidden (view full) ---

299 ceph_put_mds_session(session);
300 mutex_lock(&mdsc->mutex);
301 }
302 mutex_unlock(&mdsc->mutex);
303
304 return 0;
305}
306
1// SPDX-License-Identifier: GPL-2.0
2#include <linux/ceph/ceph_debug.h>
3
4#include <linux/device.h>
5#include <linux/slab.h>
6#include <linux/module.h>
7#include <linux/ctype.h>
8#include <linux/debugfs.h>

--- 290 unchanged lines hidden (view full) ---

299 ceph_put_mds_session(session);
300 mutex_lock(&mdsc->mutex);
301 }
302 mutex_unlock(&mdsc->mutex);
303
304 return 0;
305}
306
307static int status_show(struct seq_file *s, void *p)
308{
309 struct ceph_fs_client *fsc = s->private;
310 struct ceph_entity_inst *inst = &fsc->client->msgr.inst;
311 struct ceph_entity_addr *client_addr = ceph_client_addr(fsc->client);
312
313 seq_printf(s, "instance: %s.%lld %s/%u\n", ENTITY_NAME(inst->name),
314 ceph_pr_addr(client_addr), le32_to_cpu(client_addr->nonce));
315 seq_printf(s, "blocklisted: %s\n", fsc->blocklisted ? "true" : "false");
316
317 return 0;
318}
319
307DEFINE_SHOW_ATTRIBUTE(mdsmap);
308DEFINE_SHOW_ATTRIBUTE(mdsc);
309DEFINE_SHOW_ATTRIBUTE(caps);
310DEFINE_SHOW_ATTRIBUTE(mds_sessions);
311DEFINE_SHOW_ATTRIBUTE(metric);
320DEFINE_SHOW_ATTRIBUTE(mdsmap);
321DEFINE_SHOW_ATTRIBUTE(mdsc);
322DEFINE_SHOW_ATTRIBUTE(caps);
323DEFINE_SHOW_ATTRIBUTE(mds_sessions);
324DEFINE_SHOW_ATTRIBUTE(metric);
325DEFINE_SHOW_ATTRIBUTE(status);
312
313
314/*
315 * debugfs
316 */
317static int congestion_kb_set(void *data, u64 val)
318{
319 struct ceph_fs_client *fsc = (struct ceph_fs_client *)data;

--- 69 unchanged lines hidden (view full) ---

389 fsc,
390 &metric_fops);
391
392 fsc->debugfs_caps = debugfs_create_file("caps",
393 0400,
394 fsc->client->debugfs_dir,
395 fsc,
396 &caps_fops);
326
327
328/*
329 * debugfs
330 */
331static int congestion_kb_set(void *data, u64 val)
332{
333 struct ceph_fs_client *fsc = (struct ceph_fs_client *)data;

--- 69 unchanged lines hidden (view full) ---

403 fsc,
404 &metric_fops);
405
406 fsc->debugfs_caps = debugfs_create_file("caps",
407 0400,
408 fsc->client->debugfs_dir,
409 fsc,
410 &caps_fops);
411
412 fsc->debugfs_status = debugfs_create_file("status",
413 0400,
414 fsc->client->debugfs_dir,
415 fsc,
416 &status_fops);
397}
398
399
400#else /* CONFIG_DEBUG_FS */
401
402void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
403{
404}
405
406void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
407{
408}
409
410#endif /* CONFIG_DEBUG_FS */
417}
418
419
420#else /* CONFIG_DEBUG_FS */
421
422void ceph_fs_debugfs_init(struct ceph_fs_client *fsc)
423{
424}
425
426void ceph_fs_debugfs_cleanup(struct ceph_fs_client *fsc)
427{
428}
429
430#endif /* CONFIG_DEBUG_FS */