diff options
author | David Sterba <dsterba@suse.com> | 2017-02-14 11:55:53 -0500 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-02-28 08:26:07 -0500 |
commit | da353f6b30bc02da29b54f5f024039698fbd23f4 (patch) | |
tree | 6326c332e40f309e9584256cf3a4687ee4bc9382 | |
parent | 0b581701d9771c55a908c612ca49850e6088fe08 (diff) |
btrfs: constify device path passed to relevant helpers
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/dev-replace.c | 5 | ||||
-rw-r--r-- | fs/btrfs/dev-replace.h | 5 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 18 | ||||
-rw-r--r-- | fs/btrfs/volumes.h | 12 |
4 files changed, 22 insertions, 18 deletions
diff --git a/fs/btrfs/dev-replace.c b/fs/btrfs/dev-replace.c index 5de280b9ad73..e653921f05d9 100644 --- a/fs/btrfs/dev-replace.c +++ b/fs/btrfs/dev-replace.c | |||
@@ -304,8 +304,9 @@ void btrfs_after_dev_replace_commit(struct btrfs_fs_info *fs_info) | |||
304 | dev_replace->cursor_left_last_write_of_item; | 304 | dev_replace->cursor_left_last_write_of_item; |
305 | } | 305 | } |
306 | 306 | ||
307 | int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info, char *tgtdev_name, | 307 | int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info, |
308 | u64 srcdevid, char *srcdev_name, int read_src) | 308 | const char *tgtdev_name, u64 srcdevid, const char *srcdev_name, |
309 | int read_src) | ||
309 | { | 310 | { |
310 | struct btrfs_root *root = fs_info->dev_root; | 311 | struct btrfs_root *root = fs_info->dev_root; |
311 | struct btrfs_trans_handle *trans; | 312 | struct btrfs_trans_handle *trans; |
diff --git a/fs/btrfs/dev-replace.h b/fs/btrfs/dev-replace.h index 54ea12bda15b..f94a76844ae7 100644 --- a/fs/btrfs/dev-replace.h +++ b/fs/btrfs/dev-replace.h | |||
@@ -27,8 +27,9 @@ int btrfs_run_dev_replace(struct btrfs_trans_handle *trans, | |||
27 | void btrfs_after_dev_replace_commit(struct btrfs_fs_info *fs_info); | 27 | void btrfs_after_dev_replace_commit(struct btrfs_fs_info *fs_info); |
28 | int btrfs_dev_replace_by_ioctl(struct btrfs_fs_info *fs_info, | 28 | int btrfs_dev_replace_by_ioctl(struct btrfs_fs_info *fs_info, |
29 | struct btrfs_ioctl_dev_replace_args *args); | 29 | struct btrfs_ioctl_dev_replace_args *args); |
30 | int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info, char *tgtdev_name, | 30 | int btrfs_dev_replace_start(struct btrfs_fs_info *fs_info, |
31 | u64 srcdevid, char *srcdev_name, int read_src); | 31 | const char *tgtdev_name, u64 srcdevid, const char *srcdev_name, |
32 | int read_src); | ||
32 | void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info, | 33 | void btrfs_dev_replace_status(struct btrfs_fs_info *fs_info, |
33 | struct btrfs_ioctl_dev_replace_args *args); | 34 | struct btrfs_ioctl_dev_replace_args *args); |
34 | int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info, | 35 | int btrfs_dev_replace_cancel(struct btrfs_fs_info *fs_info, |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 1fac98728814..b443cc71830f 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 | { |
@@ -7102,7 +7104,7 @@ int btrfs_get_dev_stats(struct btrfs_fs_info *fs_info, | |||
7102 | return 0; | 7104 | return 0; |
7103 | } | 7105 | } |
7104 | 7106 | ||
7105 | void btrfs_scratch_superblocks(struct block_device *bdev, char *device_path) | 7107 | void btrfs_scratch_superblocks(struct block_device *bdev, const char *device_path) |
7106 | { | 7108 | { |
7107 | struct buffer_head *bh; | 7109 | struct buffer_head *bh; |
7108 | struct btrfs_super_block *disk_super; | 7110 | struct btrfs_super_block *disk_super; |
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 24ba6bc3ec34..59be81206dd7 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -422,16 +422,16 @@ void btrfs_close_extra_devices(struct btrfs_fs_devices *fs_devices, int step); | |||
422 | void btrfs_assign_next_active_device(struct btrfs_fs_info *fs_info, | 422 | void btrfs_assign_next_active_device(struct btrfs_fs_info *fs_info, |
423 | struct btrfs_device *device, struct btrfs_device *this_dev); | 423 | struct btrfs_device *device, struct btrfs_device *this_dev); |
424 | int btrfs_find_device_missing_or_by_path(struct btrfs_fs_info *fs_info, | 424 | int btrfs_find_device_missing_or_by_path(struct btrfs_fs_info *fs_info, |
425 | char *device_path, | 425 | const char *device_path, |
426 | struct btrfs_device **device); | 426 | struct btrfs_device **device); |
427 | int btrfs_find_device_by_devspec(struct btrfs_fs_info *fs_info, u64 devid, | 427 | int btrfs_find_device_by_devspec(struct btrfs_fs_info *fs_info, u64 devid, |
428 | char *devpath, | 428 | const char *devpath, |
429 | struct btrfs_device **device); | 429 | struct btrfs_device **device); |
430 | struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info, | 430 | struct btrfs_device *btrfs_alloc_device(struct btrfs_fs_info *fs_info, |
431 | const u64 *devid, | 431 | const u64 *devid, |
432 | const u8 *uuid); | 432 | const u8 *uuid); |
433 | int btrfs_rm_device(struct btrfs_fs_info *fs_info, | 433 | int btrfs_rm_device(struct btrfs_fs_info *fs_info, |
434 | char *device_path, u64 devid); | 434 | const char *device_path, u64 devid); |
435 | void btrfs_cleanup_fs_uuids(void); | 435 | void btrfs_cleanup_fs_uuids(void); |
436 | int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len); | 436 | int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len); |
437 | int btrfs_grow_device(struct btrfs_trans_handle *trans, | 437 | int btrfs_grow_device(struct btrfs_trans_handle *trans, |
@@ -439,9 +439,9 @@ int btrfs_grow_device(struct btrfs_trans_handle *trans, | |||
439 | struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid, | 439 | struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid, |
440 | u8 *uuid, u8 *fsid); | 440 | u8 *uuid, u8 *fsid); |
441 | int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); | 441 | int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); |
442 | int btrfs_init_new_device(struct btrfs_fs_info *fs_info, char *path); | 442 | int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *path); |
443 | int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info, | 443 | int btrfs_init_dev_replace_tgtdev(struct btrfs_fs_info *fs_info, |
444 | char *device_path, | 444 | const char *device_path, |
445 | struct btrfs_device *srcdev, | 445 | struct btrfs_device *srcdev, |
446 | struct btrfs_device **device_out); | 446 | struct btrfs_device **device_out); |
447 | int btrfs_balance(struct btrfs_balance_control *bctl, | 447 | int btrfs_balance(struct btrfs_balance_control *bctl, |
@@ -474,7 +474,7 @@ void btrfs_destroy_dev_replace_tgtdev(struct btrfs_fs_info *fs_info, | |||
474 | struct btrfs_device *tgtdev); | 474 | struct btrfs_device *tgtdev); |
475 | void btrfs_init_dev_replace_tgtdev_for_resume(struct btrfs_fs_info *fs_info, | 475 | void btrfs_init_dev_replace_tgtdev_for_resume(struct btrfs_fs_info *fs_info, |
476 | struct btrfs_device *tgtdev); | 476 | struct btrfs_device *tgtdev); |
477 | void btrfs_scratch_superblocks(struct block_device *bdev, char *device_path); | 477 | void btrfs_scratch_superblocks(struct block_device *bdev, const char *device_path); |
478 | int btrfs_is_parity_mirror(struct btrfs_mapping_tree *map_tree, | 478 | int btrfs_is_parity_mirror(struct btrfs_mapping_tree *map_tree, |
479 | u64 logical, u64 len, int mirror_num); | 479 | u64 logical, u64 len, int mirror_num); |
480 | unsigned long btrfs_full_stripe_len(struct btrfs_fs_info *fs_info, | 480 | unsigned long btrfs_full_stripe_len(struct btrfs_fs_info *fs_info, |