All of lore.kernel.org
 help / color / mirror / Atom feed
From: Coly Li <colyli@suse.de>
To: linux-bcache@vger.kernel.org, axboe@kernel.dk
Cc: linux-block@vger.kernel.org, Shenghui Wang <shhuiw@foxmail.com>,
	Coly Li <colyli@suse.de>
Subject: [PATCH 02/12] bcache: do not check if debug dentry is ERR or NULL explicitly on remove
Date: Thu, 13 Dec 2018 22:53:47 +0800	[thread overview]
Message-ID: <20181213145357.38528-3-colyli@suse.de> (raw)
In-Reply-To: <20181213145357.38528-1-colyli@suse.de>

From: Shenghui Wang <shhuiw@foxmail.com>

debugfs_remove and debugfs_remove_recursive will check if the dentry
pointer is NULL or ERR, and will do nothing in that case.

Remove the check in cache_set_free and bch_debug_init.

Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
---
 drivers/md/bcache/debug.c | 3 +--
 drivers/md/bcache/super.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index 8f448b9c96a1..8b123be05254 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -249,8 +249,7 @@ void bch_debug_init_cache_set(struct cache_set *c)
 
 void bch_debug_exit(void)
 {
-	if (!IS_ERR_OR_NULL(bcache_debug))
-		debugfs_remove_recursive(bcache_debug);
+	debugfs_remove_recursive(bcache_debug);
 }
 
 void __init bch_debug_init(void)
diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 7bbd670a5a84..5b59d44656c0 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1510,8 +1510,7 @@ static void cache_set_free(struct closure *cl)
 	struct cache *ca;
 	unsigned int i;
 
-	if (!IS_ERR_OR_NULL(c->debug))
-		debugfs_remove(c->debug);
+	debugfs_remove(c->debug);
 
 	bch_open_buckets_free(c);
 	bch_btree_cache_free(c);
-- 
2.16.4


  parent reply	other threads:[~2018-12-13 14:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-13 14:53 [PATCH 00/12] bcache patches for Linux v4.21 Coly Li
2018-12-13 14:53 ` [PATCH 01/12] bcache: add comment for cache_set->fill_iter Coly Li
2018-12-13 14:53 ` Coly Li [this message]
2018-12-13 14:53 ` [PATCH 03/12] bcache: update comment for bch_data_insert Coly Li
2018-12-13 14:53 ` [PATCH 04/12] bcache: update comment in sysfs.c Coly Li
2018-12-13 14:53 ` [PATCH 05/12] bcache: do not mark writeback_running until backing dev attached to cache_set Coly Li
2018-12-13 14:53 ` [PATCH 06/12] bcache: cannot set writeback_running via sysfs if no writeback kthread created Coly Li
2018-12-13 14:53 ` [PATCH 07/12] bcache: introduce force_wake_up_gc() Coly Li
2018-12-13 14:53 ` [PATCH 08/12] bcache: option to automatically run gc thread after writeback accomplished Coly Li
2018-12-13 14:53 ` [PATCH 09/12] bcache: add MODULE_DESCRIPTION information Coly Li
2018-12-13 14:53 ` [PATCH 10/12] bcache: make cutoff_writeback and cutoff_writeback_sync tunnable Coly Li
2018-12-13 14:53 ` [PATCH 11/12] bcache: set writeback_percent in a flexible range Coly Li
2018-12-13 14:53 ` [PATCH 12/12] bcache: print number of keys in trace_bcache_journal_write Coly Li
2018-12-13 15:16 ` [PATCH 00/12] bcache patches for Linux v4.21 Jens Axboe
2018-12-14  8:25   ` Coly Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181213145357.38528-3-colyli@suse.de \
    --to=colyli@suse.de \
    --cc=axboe@kernel.dk \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=shhuiw@foxmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.