diff options
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 13e55d13045d..73d56eef5e60 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -1725,7 +1725,7 @@ out: | |||
1725 | * Function to update ctime/mtime for a given device path. | 1725 | * Function to update ctime/mtime for a given device path. |
1726 | * Mainly used for ctime/mtime based probe like libblkid. | 1726 | * Mainly used for ctime/mtime based probe like libblkid. |
1727 | */ | 1727 | */ |
1728 | static void update_dev_time(char *path_name) | 1728 | static void update_dev_time(const char *path_name) |
1729 | { | 1729 | { |
1730 | struct file *filp; | 1730 | struct file *filp; |
1731 | 1731 | ||
@@ -1851,7 +1851,8 @@ void btrfs_assign_next_active_device(struct btrfs_fs_info *fs_info, | |||
1851 | fs_info->fs_devices->latest_bdev = next_device->bdev; | 1851 | fs_info->fs_devices->latest_bdev = next_device->bdev; |
1852 | } | 1852 | } |
1853 | 1853 | ||
1854 | int btrfs_rm_device(struct btrfs_fs_info *fs_info, char *device_path, u64 devid) | 1854 | int btrfs_rm_device(struct btrfs_fs_info *fs_info, const char *device_path, |
1855 | u64 devid) | ||
1855 | { | 1856 | { |
1856 | struct btrfs_device *device; | 1857 | struct btrfs_device *device; |
1857 | struct btrfs_fs_devices *cur_devices; | 1858 | struct btrfs_fs_devices *cur_devices; |
@@ -2091,7 +2092,7 @@ void btrfs_destroy_dev_replace_tgtdev(struct btrfs_fs_info *fs_info, | |||
2091 | } | 2092 | } |
2092 | 2093 | ||
2093 | static int btrfs_find_device_by_path(struct btrfs_fs_info *fs_info, | 2094 | static int btrfs_find_device_by_path(struct btrfs_fs_info *fs_info, |
2094 | char *device_path, | 2095 | const char *device_path, |
2095 | struct btrfs_device **device) | 2096 | struct btrfs_device **device) |
2096 | { | 2097 | { |
2097 | int ret = 0; | 2098 | int ret = 0; |
@@ -2118,7 +2119,7 @@ static int btrfs_find_device_by_path(struct btrfs_fs_info *fs_info, | |||
2118 | } | 2119 | } |
2119 | 2120 | ||
2120 | int btrfs_find_device_missing_or_by_path(struct btrfs_fs_info *fs_info, | 2121 | int btrfs_find_device_missing_or_by_path(struct btrfs_fs_info *fs_info, |
2121 | char *device_path, | 2122 | const char *device_path, |
2122 | struct btrfs_device **device) | 2123 | struct btrfs_device **device) |
2123 | { | 2124 | { |
2124 | *device = NULL; | 2125 | *device = NULL; |
@@ -2151,7 +2152,8 @@ int btrfs_find_device_missing_or_by_path(struct btrfs_fs_info *fs_info, | |||
2151 | * Lookup a device given by device id, or the path if the id is 0. | 2152 | * Lookup a device given by device id, or the path if the id is 0. |
2152 | */ | 2153 | */ |
2153 | int btrfs_find_device_by_devspec(struct btrfs_fs_info *fs_info, u64 devid, | 2154 | int btrfs_find_device_by_devspec(struct btrfs_fs_info *fs_info, u64 devid, |
2154 | char *devpath, struct btrfs_device **device) | 2155 | const char *devpath, |
2156 | struct btrfs_device **device) | ||
2155 | { | 2157 | { |
2156 | int ret; | 2158 | int ret; |
2157 | 2159 | ||
@@ -2307,7 +2309,7 @@ error: | |||
2307 | return ret; | 2309 | return ret; |
2308 | } | 2310 | } |
2309 | 2311 | ||
2310 | int btrfs_init_new_device(struct btrfs_fs_info *fs_info, char *device_path) | 2312 | int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path) |
2311 | { | 2313 | { |
2312 | struct btrfs_root *root = fs_info->dev_root; | 2314 | struct btrfs_root *root = fs_info->dev_root; |
2313 | struct request_queue *q; | 2315 | struct request_queue *q; |
@@ -2515,7 +2517,7 @@ error: | |||
2515 | } | 2517 | } |
2516 | 2518 | ||
2517 | int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info, | 2519 | int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info, |
2518 | char *device_path, | 2520 | const char *device_path, |
2519 | struct btrfs_device *srcdev, | 2521 | struct btrfs_device *srcdev, |
2520 | struct btrfs_device **device_out) | 2522 | struct btrfs_device **device_out) |
2521 | { | 2523 | { |
@@ -6954,7 +6956,8 @@ static int update_dev_stat_item(struct btrfs_trans_handle *trans, | |||
6954 | key.offset = device->devid; | 6956 | key.offset = device->devid; |
6955 | 6957 | ||
6956 | path = btrfs_alloc_path(); | 6958 | path = btrfs_alloc_path(); |
6957 | BUG_ON(!path); | 6959 | if (!path) |
6960 | return -ENOMEM; | ||
6958 | ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); | 6961 | ret = btrfs_search_slot(trans, dev_root, &key, path, -1, 1); |
6959 | if (ret < 0) { | 6962 | if (ret < 0) { |
6960 | btrfs_warn_in_rcu(fs_info, | 6963 | btrfs_warn_in_rcu(fs_info, |
@@ -7102,7 +7105,7 @@ int btrfs_get_dev_stats(struct btrfs_fs_info *fs_info, | |||
7102 | return 0; | 7105 | return 0; |
7103 | } | 7106 | } |
7104 | 7107 | ||
7105 | void btrfs_scratch_superblocks(struct block_device *bdev, char *device_path) | 7108 | void btrfs_scratch_superblocks(struct block_device *bdev, const char *device_path) |
7106 | { | 7109 | { |
7107 | struct buffer_head *bh; | 7110 | struct buffer_head *bh; |
7108 | struct btrfs_super_block *disk_super; | 7111 | struct btrfs_super_block *disk_super; |