Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Christoph Hellwig and committed by
Al Viro
72e8264e 3516586a

+6 -15
+6 -15
drivers/md/dm-table.c
··· 313 313 } 314 314 315 315 /* 316 - * Convert a device path to a dev_t. 317 - */ 318 - static 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 316 * See if we've already got a device in the list. 330 317 */ 331 318 static struct dm_dev_internal *find_device(struct list_head *l, dev_t dev) ··· 424 437 return -EOVERFLOW; 425 438 } else { 426 439 /* convert the path to a device */ 427 - if ((r = lookup_device(path, &dev))) 428 - return r; 440 + struct block_device *bdev = lookup_bdev(path); 441 + 442 + if (IS_ERR(bdev)) 443 + return PTR_ERR(bdev); 444 + dev = bdev->bd_dev; 445 + bdput(bdev); 429 446 } 430 447 431 448 dd = find_device(&t->devices, dev);