[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 63/78] bcache: remove a superflous lookup_bdev all



Don't bother to call lookup_bdev for just a slightly different error
message without any functional change.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 drivers/md/bcache/super.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
index 46a00134a36ae1..d36ccdda16ed2e 100644
--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -2538,15 +2538,7 @@ static ssize_t register_bcache(struct kobject *k, struct 
kobj_attribute *attr,
                                  sb);
        if (IS_ERR(bdev)) {
                if (bdev == ERR_PTR(-EBUSY)) {
-                       bdev = lookup_bdev(strim(path));
-                       mutex_lock(&bch_register_lock);
-                       if (!IS_ERR(bdev) && bch_is_open(bdev))
-                               err = "device already registered";
-                       else
-                               err = "device busy";
-                       mutex_unlock(&bch_register_lock);
-                       if (!IS_ERR(bdev))
-                               bdput(bdev);
+                       err = "device busy";
                        if (attr == &ksysfs_register_quiet)
                                goto done;
                }
-- 
2.29.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.