aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:22:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:22:40 -0400
commit5ed487bc2c44ca4e9668ef9cb54c830e2a9fac47 (patch)
treeaf19ed28db83e8f52690872ac99336da1cf2fd3b /drivers/md
parent5b34653963de7a6d0d8c783527457d68fddc60fb (diff)
parentfd217f4d70172c526478f2bc76859e909fdfa674 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (46 commits) [PATCH] fs: add a sanity check in d_free [PATCH] i_version: remount support [patch] vfs: make security_inode_setattr() calling consistent [patch 1/3] FS_MBCACHE: don't needlessly make it built-in [PATCH] move executable checking into ->permission() [PATCH] fs/dcache.c: update comment of d_validate() [RFC PATCH] touch_mnt_namespace when the mount flags change [PATCH] reiserfs: add missing llseek method [PATCH] fix ->llseek for more directories [PATCH vfs-2.6 6/6] vfs: add LOOKUP_RENAME_TARGET intent [PATCH vfs-2.6 5/6] vfs: remove LOOKUP_PARENT from non LOOKUP_PARENT lookup [PATCH vfs-2.6 4/6] vfs: remove unnecessary fsnotify_d_instantiate() [PATCH vfs-2.6 3/6] vfs: add __d_instantiate() helper [PATCH vfs-2.6 2/6] vfs: add d_ancestor() [PATCH vfs-2.6 1/6] vfs: replace parent == dentry->d_parent by IS_ROOT() [PATCH] get rid of on-stack dentry in udf [PATCH 2/2] anondev: switch to IDA [PATCH 1/2] anondev: init IDR statically [JFFS2] Use d_splice_alias() not d_add() in jffs2_lookup() [PATCH] Optimise NFS readdir hack slightly. ...
Diffstat (limited to 'drivers/md')
-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);