aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/debug.c
diff options
context:
space:
mode:
authorChengguang Xu <cgxu519@gmx.com>2018-03-18 20:36:23 -0400
committerJens Axboe <axboe@kernel.dk>2018-03-18 22:15:20 -0400
commitdf2b94313ae5b4f60d49e01d4dff5acb4c2757cf (patch)
tree124c33fcd0df9753d7c9805c435320bcb89d373a /drivers/md/bcache/debug.c
parentca71df31661a0518ed58a1a59cf1993962153ebb (diff)
bcache: move closure debug file into debug directory
In current code closure debug file is outside of debug directory and when unloading module there is lack of removing operation for closure debug file, so it will cause creating error when trying to reload module. This patch move closure debug file into "bcache" debug direcory so that the file can get deleted properly. Signed-off-by: Chengguang Xu <cgxu519@gmx.com> Reviewed-by: Michael Lyle <mlyle@lyle.org> Reviewed-by: Tang Junhui <tang.junhui@zte.com.cn> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/bcache/debug.c')
-rw-r--r--drivers/md/bcache/debug.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index af89408befe8..028f7b386e01 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -17,7 +17,7 @@
17#include <linux/random.h> 17#include <linux/random.h>
18#include <linux/seq_file.h> 18#include <linux/seq_file.h>
19 19
20static struct dentry *debug; 20struct dentry *bcache_debug;
21 21
22#ifdef CONFIG_BCACHE_DEBUG 22#ifdef CONFIG_BCACHE_DEBUG
23 23
@@ -232,11 +232,11 @@ static const struct file_operations cache_set_debug_ops = {
232 232
233void bch_debug_init_cache_set(struct cache_set *c) 233void bch_debug_init_cache_set(struct cache_set *c)
234{ 234{
235 if (!IS_ERR_OR_NULL(debug)) { 235 if (!IS_ERR_OR_NULL(bcache_debug)) {
236 char name[50]; 236 char name[50];
237 snprintf(name, 50, "bcache-%pU", c->sb.set_uuid); 237 snprintf(name, 50, "bcache-%pU", c->sb.set_uuid);
238 238
239 c->debug = debugfs_create_file(name, 0400, debug, c, 239 c->debug = debugfs_create_file(name, 0400, bcache_debug, c,
240 &cache_set_debug_ops); 240 &cache_set_debug_ops);
241 } 241 }
242} 242}
@@ -245,13 +245,13 @@ void bch_debug_init_cache_set(struct cache_set *c)
245 245
246void bch_debug_exit(void) 246void bch_debug_exit(void)
247{ 247{
248 if (!IS_ERR_OR_NULL(debug)) 248 if (!IS_ERR_OR_NULL(bcache_debug))
249 debugfs_remove_recursive(debug); 249 debugfs_remove_recursive(bcache_debug);
250} 250}
251 251
252int __init bch_debug_init(struct kobject *kobj) 252int __init bch_debug_init(struct kobject *kobj)
253{ 253{
254 debug = debugfs_create_dir("bcache", NULL); 254 bcache_debug = debugfs_create_dir("bcache", NULL);
255 255
256 return IS_ERR_OR_NULL(debug); 256 return IS_ERR_OR_NULL(bcache_debug);
257} 257}