aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorEd Cashin <ecashin@coraid.com>2013-09-11 17:25:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:59:22 -0400
commit190519cd30884215a63ed875ac074dc97a602522 (patch)
treeb97b3a8171ed01e0a0cb60c3ee4d7745dea87fe4 /drivers/block
parent0bd42136f7ae4ea1375da34c32838fb35eee8c59 (diff)
aoe: create and destroy debugfs directory for aoe
This series adds the debugging information that the coraid.com-distributed aoe driver exports via sysfs, but instead of sysfs, it uses debugfs. With these patches applied, even without AoE targets on the network, KEDR reports new possible memory leaks, but these are from callers outside the aoe driver that have used aoe_devnode to get the name of the character devices through the aoe_class->devnode callback, and I believe they're responsible for freeing that memory. This patch: Create and destroy the debugfs directory. Signed-off-by: Ed Cashin <ecashin@coraid.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/aoe/aoeblk.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 916d9ed5c8aa..cb508b754377 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -17,11 +17,13 @@
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/export.h> 18#include <linux/export.h>
19#include <linux/moduleparam.h> 19#include <linux/moduleparam.h>
20#include <linux/debugfs.h>
20#include <scsi/sg.h> 21#include <scsi/sg.h>
21#include "aoe.h" 22#include "aoe.h"
22 23
23static DEFINE_MUTEX(aoeblk_mutex); 24static DEFINE_MUTEX(aoeblk_mutex);
24static struct kmem_cache *buf_pool_cache; 25static struct kmem_cache *buf_pool_cache;
26static struct dentry *aoe_debugfs_dir;
25 27
26/* GPFS needs a larger value than the default. */ 28/* GPFS needs a larger value than the default. */
27static int aoe_maxsectors; 29static int aoe_maxsectors;
@@ -351,6 +353,8 @@ err:
351void 353void
352aoeblk_exit(void) 354aoeblk_exit(void)
353{ 355{
356 debugfs_remove_recursive(aoe_debugfs_dir);
357 aoe_debugfs_dir = NULL;
354 kmem_cache_destroy(buf_pool_cache); 358 kmem_cache_destroy(buf_pool_cache);
355} 359}
356 360
@@ -362,7 +366,11 @@ aoeblk_init(void)
362 0, 0, NULL); 366 0, 0, NULL);
363 if (buf_pool_cache == NULL) 367 if (buf_pool_cache == NULL)
364 return -ENOMEM; 368 return -ENOMEM;
365 369 aoe_debugfs_dir = debugfs_create_dir("aoe", NULL);
370 if (IS_ERR_OR_NULL(aoe_debugfs_dir)) {
371 pr_info("aoe: cannot create debugfs directory\n");
372 aoe_debugfs_dir = NULL;
373 }
366 return 0; 374 return 0;
367} 375}
368 376