Commit a343832f authored by Xiao Guangrong's avatar Xiao Guangrong Committed by Chris Mason
Browse files

btrfs: using btrfs_stack_device_id() get devid



We can use btrfs_stack_device_id() to get dev_item->devid
Signed-off-by: default avatarXiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 91748467
...@@ -599,7 +599,7 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices, ...@@ -599,7 +599,7 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
goto error_close; goto error_close;
disk_super = (struct btrfs_super_block *)bh->b_data; 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) if (devid != device->devid)
goto error_brelse; goto error_brelse;
...@@ -701,7 +701,7 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder, ...@@ -701,7 +701,7 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
goto error_close; goto error_close;
} }
disk_super = (struct btrfs_super_block *)bh->b_data; 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); transid = btrfs_super_generation(disk_super);
if (disk_super->label[0]) if (disk_super->label[0])
printk(KERN_INFO "device label %s ", disk_super->label); printk(KERN_INFO "device label %s ", disk_super->label);
...@@ -1194,7 +1194,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) ...@@ -1194,7 +1194,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
goto error_close; goto error_close;
} }
disk_super = (struct btrfs_super_block *)bh->b_data; 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; dev_uuid = disk_super->dev_item.uuid;
device = btrfs_find_device(root, devid, dev_uuid, device = btrfs_find_device(root, devid, dev_uuid,
disk_super->fsid); disk_super->fsid);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment