aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-08-10 18:24:08 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-10-23 05:12:57 -0400
commit72e8264eda02b6ba85a222b9620802ebf23c6a10 (patch)
tree4c82b49f538b1ae4e469bbf9a98d76766ab3f768 /drivers/md/dm-table.c
parent3516586a424ea5727be089da6541cbd5644f0497 (diff)
[PATCH] dm: kill lookup_device wrapper
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>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r--drivers/md/dm-table.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index a740a6950f59..1407eb96f1a4 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -313,19 +313,6 @@ static inline int check_space(struct dm_table *t)
313} 313}
314 314
315/* 315/*
316 * Convert a device path to a dev_t.
317 */
318static int lookup_device(const char *path, dev_t *dev)
319{
320 struct block_device *bdev = lookup_bdev(path);
321 if (IS_ERR(bdev))
322 return PTR_ERR(bdev);
323 *dev = bdev->bd_dev;
324 bdput(bdev);
325 return 0;
326}
327
328/*
329 * See if we've already got a device in the list. 316 * See if we've already got a device in the list.
330 */ 317 */
331static struct dm_dev_internal *find_device(struct list_head *l, dev_t dev) 318static struct dm_dev_internal *find_device(struct list_head *l, dev_t dev)
@@ -437,8 +424,12 @@ static int __table_get_device(struct dm_table *t, struct dm_target *ti,
437 return -EOVERFLOW; 424 return -EOVERFLOW;
438 } else { 425 } else {
439 /* convert the path to a device */ 426 /* convert the path to a device */
440 if ((r = lookup_device(path, &dev))) 427 struct block_device *bdev = lookup_bdev(path);
441 return r; 428
429 if (IS_ERR(bdev))
430 return PTR_ERR(bdev);
431 dev = bdev->bd_dev;
432 bdput(bdev);
442 } 433 }
443 434
444 dd = find_device(&t->devices, dev); 435 dd = find_device(&t->devices, dev);