diff options
author | Chris Mason <chris.mason@fusionio.com> | 2013-02-06 12:42:24 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-02-06 12:42:24 -0500 |
commit | 7b1c567c84a6292c138db3bd1638e19e73e0e593 (patch) | |
tree | 9ab6983c6fa2cbb837e9b782d1020899e0d2d846 /volumes.c | |
parent | 5ffe6597e708d74c02d72d79ebb4a8fd2181e227 (diff) | |
parent | 2161e1b6f35d1c084fda49b479951219117c86e9 (diff) |
Merge branch 'for-chris' of git://repo.or.cz/btrfs-progs-unstable/devel into raid56
Conflicts:
ctree.h
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'volumes.c')
-rw-r--r-- | volumes.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -1385,6 +1385,22 @@ struct btrfs_device *btrfs_find_device(struct btrfs_root *root, u64 devid, return NULL; } +struct btrfs_device *btrfs_find_device_by_devid(struct btrfs_root *root, + u64 devid, int instance) +{ + struct list_head *head = &root->fs_info->fs_devices->devices; + struct btrfs_device *dev; + struct list_head *cur; + int num_found = 0; + + list_for_each(cur, head) { + dev = list_entry(cur, struct btrfs_device, dev_list); + if (dev->devid == devid && num_found++ == instance) + return dev; + } + return NULL; +} + int btrfs_bootstrap_super_map(struct btrfs_mapping_tree *map_tree, struct btrfs_fs_devices *fs_devices) { |