return dst;
}
+size_t ceph_bookkeeper_get_footprint(void)
+{
+ size_t footprint;
+ spin_lock(&_bk_lock);
+ footprint = _total_alloc - _total_free;
+ spin_unlock(&_bk_lock);
+ return footprint;
+}
+
void ceph_bookkeeper_init(void)
{
printk(KERN_ERR "bookkeeper: start\n");
{
ceph_bookkeeper_dump();
}
+
static struct dentry *ceph_debugfs_dir;
#ifdef CONFIG_CEPH_BOOKKEEPER
static struct dentry *ceph_debugfs_bookkeeper;
+static struct dentry *ceph_debugfs_footprint;
#endif
static int monmap_show(struct seq_file *s, void *p)
return 0;
}
+static int debugfs_footprint_get(void *data, u64 *val)
+{
+ *val = (u64)ceph_bookkeeper_get_footprint();
+ return 0;
+}
+
DEFINE_SIMPLE_ATTRIBUTE(bookkeeper_fops, debugfs_bookkeeper_get,
debugfs_bookkeeper_set, "%llu\n");
+DEFINE_SIMPLE_ATTRIBUTE(footprint_fops, debugfs_footprint_get,
+ NULL, "%llu\n");
#endif
int __init ceph_debugfs_init(void)
&bookkeeper_fops);
if (!ceph_debugfs_bookkeeper)
goto out;
+
+ ceph_debugfs_footprint = debugfs_create_file("ceph_footprint",
+ 0600,
+ ceph_debugfs_dir,
+ NULL,
+ &footprint_fops);
+ if (!ceph_debugfs_footprint)
+ goto out;
#endif
return 0;