]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] dm: kill lookup_device wrapper
authorChristoph Hellwig <hch@lst.de>
Sun, 10 Aug 2008 22:24:08 +0000 (00:24 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 23 Oct 2008 09:12:57 +0000 (05:12 -0400)
Now that lookup_bdev is exported and used by dm just use it directly
instead of through a trivial wrapper.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/md/dm-table.c

index a740a6950f598ce44eb7ee285b48f057ef19cd83..1407eb96f1a4388b1432c3ef386f370331b5c760 100644 (file)
@@ -312,19 +312,6 @@ static inline int check_space(struct dm_table *t)
        return 0;
 }
 
-/*
- * Convert a device path to a dev_t.
- */
-static int lookup_device(const char *path, dev_t *dev)
-{
-       struct block_device *bdev = lookup_bdev(path);
-       if (IS_ERR(bdev))
-               return PTR_ERR(bdev);
-       *dev = bdev->bd_dev;
-       bdput(bdev);
-       return 0;
-}
-
 /*
  * See if we've already got a device in the list.
  */
@@ -437,8 +424,12 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
                        return -EOVERFLOW;
        } else {
                /* convert the path to a device */
-               if ((r = lookup_device(path, &dev)))
-                       return r;
+               struct block_device *bdev = lookup_bdev(path);
+
+               if (IS_ERR(bdev))
+                       return PTR_ERR(bdev);
+               dev = bdev->bd_dev;
+               bdput(bdev);
        }
 
        dd = find_device(&t->devices, dev);