Skip to content

Commit

Permalink
btrfs: using btrfs_stack_device_id() get devid
Browse files Browse the repository at this point in the history
We can use btrfs_stack_device_id() to get dev_item->devid

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Xiao Guangrong authored and Chris Mason committed Mar 15, 2010
1 parent 9174846 commit a343832
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
goto error_close;

disk_super = (struct btrfs_super_block *)bh->b_data;
devid = le64_to_cpu(disk_super->dev_item.devid);
devid = btrfs_stack_device_id(&disk_super->dev_item);
if (devid != device->devid)
goto error_brelse;

Expand Down Expand Up @@ -701,7 +701,7 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
goto error_close;
}
disk_super = (struct btrfs_super_block *)bh->b_data;
devid = le64_to_cpu(disk_super->dev_item.devid);
devid = btrfs_stack_device_id(&disk_super->dev_item);
transid = btrfs_super_generation(disk_super);
if (disk_super->label[0])
printk(KERN_INFO "device label %s ", disk_super->label);
Expand Down Expand Up @@ -1194,7 +1194,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
goto error_close;
}
disk_super = (struct btrfs_super_block *)bh->b_data;
devid = le64_to_cpu(disk_super->dev_item.devid);
devid = btrfs_stack_device_id(&disk_super->dev_item);
dev_uuid = disk_super->dev_item.uuid;
device = btrfs_find_device(root, devid, dev_uuid,
disk_super->fsid);
Expand Down

0 comments on commit a343832

Please sign in to comment.