aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2015-11-19 05:42:28 -0500
committerDavid Sterba <dsterba@suse.com>2016-01-07 09:01:14 -0500
commit20e5506baf3fd651e245bc970d8c11a734ee1b8a (patch)
tree429cae426bb8b1cb38b261d485e0ebecc093e439
parent28f0779a3fd6ef015303780f0b9a92b24728bc4b (diff)
btrfs: constify remaining structs with function pointers
* struct extent_io_ops * struct btrfs_free_space_op Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--fs/btrfs/free-space-cache.c2
-rw-r--r--fs/btrfs/free-space-cache.h2
-rw-r--r--fs/btrfs/inode-map.c4
-rw-r--r--fs/btrfs/inode.c4
-rw-r--r--fs/btrfs/tests/free-space-tests.c4
5 files changed, 8 insertions, 8 deletions
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index cfe99bec49de..ed8a3b7d3565 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -2016,7 +2016,7 @@ static bool use_bitmap(struct btrfs_free_space_ctl *ctl,
2016 return true; 2016 return true;
2017} 2017}
2018 2018
2019static struct btrfs_free_space_op free_space_op = { 2019static const struct btrfs_free_space_op free_space_op = {
2020 .recalc_thresholds = recalculate_thresholds, 2020 .recalc_thresholds = recalculate_thresholds,
2021 .use_bitmap = use_bitmap, 2021 .use_bitmap = use_bitmap,
2022}; 2022};
diff --git a/fs/btrfs/free-space-cache.h b/fs/btrfs/free-space-cache.h
index f251865eb6f3..33178c490ace 100644
--- a/fs/btrfs/free-space-cache.h
+++ b/fs/btrfs/free-space-cache.h
@@ -37,7 +37,7 @@ struct btrfs_free_space_ctl {
37 int total_bitmaps; 37 int total_bitmaps;
38 int unit; 38 int unit;
39 u64 start; 39 u64 start;
40 struct btrfs_free_space_op *op; 40 const struct btrfs_free_space_op *op;
41 void *private; 41 void *private;
42 struct mutex cache_writeout_mutex; 42 struct mutex cache_writeout_mutex;
43 struct list_head trimming_ranges; 43 struct list_head trimming_ranges;
diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c
index 767a6056ac45..53014e963617 100644
--- a/fs/btrfs/inode-map.c
+++ b/fs/btrfs/inode-map.c
@@ -334,7 +334,7 @@ static bool use_bitmap(struct btrfs_free_space_ctl *ctl,
334 return true; 334 return true;
335} 335}
336 336
337static struct btrfs_free_space_op free_ino_op = { 337static const struct btrfs_free_space_op free_ino_op = {
338 .recalc_thresholds = recalculate_thresholds, 338 .recalc_thresholds = recalculate_thresholds,
339 .use_bitmap = use_bitmap, 339 .use_bitmap = use_bitmap,
340}; 340};
@@ -356,7 +356,7 @@ static bool pinned_use_bitmap(struct btrfs_free_space_ctl *ctl,
356 return false; 356 return false;
357} 357}
358 358
359static struct btrfs_free_space_op pinned_free_ino_op = { 359static const struct btrfs_free_space_op pinned_free_ino_op = {
360 .recalc_thresholds = pinned_recalc_thresholds, 360 .recalc_thresholds = pinned_recalc_thresholds,
361 .use_bitmap = pinned_use_bitmap, 361 .use_bitmap = pinned_use_bitmap,
362}; 362};
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0214a812fc0e..c4cfba79ab47 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -74,7 +74,7 @@ static const struct inode_operations btrfs_file_inode_operations;
74static const struct address_space_operations btrfs_aops; 74static const struct address_space_operations btrfs_aops;
75static const struct address_space_operations btrfs_symlink_aops; 75static const struct address_space_operations btrfs_symlink_aops;
76static const struct file_operations btrfs_dir_file_operations; 76static const struct file_operations btrfs_dir_file_operations;
77static struct extent_io_ops btrfs_extent_io_ops; 77static const struct extent_io_ops btrfs_extent_io_ops;
78 78
79static struct kmem_cache *btrfs_inode_cachep; 79static struct kmem_cache *btrfs_inode_cachep;
80struct kmem_cache *btrfs_trans_handle_cachep; 80struct kmem_cache *btrfs_trans_handle_cachep;
@@ -10020,7 +10020,7 @@ static const struct file_operations btrfs_dir_file_operations = {
10020 .fsync = btrfs_sync_file, 10020 .fsync = btrfs_sync_file,
10021}; 10021};
10022 10022
10023static struct extent_io_ops btrfs_extent_io_ops = { 10023static const struct extent_io_ops btrfs_extent_io_ops = {
10024 .fill_delalloc = run_delalloc_range, 10024 .fill_delalloc = run_delalloc_range,
10025 .submit_bio_hook = btrfs_submit_bio_hook, 10025 .submit_bio_hook = btrfs_submit_bio_hook,
10026 .merge_bio_hook = btrfs_merge_bio_hook, 10026 .merge_bio_hook = btrfs_merge_bio_hook,
diff --git a/fs/btrfs/tests/free-space-tests.c b/fs/btrfs/tests/free-space-tests.c
index 46c2f292ea94..69a11e63d668 100644
--- a/fs/btrfs/tests/free-space-tests.c
+++ b/fs/btrfs/tests/free-space-tests.c
@@ -445,11 +445,11 @@ test_steal_space_from_bitmap_to_extent(struct btrfs_block_group_cache *cache)
445 int ret; 445 int ret;
446 u64 offset; 446 u64 offset;
447 u64 max_extent_size; 447 u64 max_extent_size;
448 struct btrfs_free_space_op test_free_space_ops = { 448 const struct btrfs_free_space_op test_free_space_ops = {
449 .recalc_thresholds = cache->free_space_ctl->op->recalc_thresholds, 449 .recalc_thresholds = cache->free_space_ctl->op->recalc_thresholds,
450 .use_bitmap = test_use_bitmap, 450 .use_bitmap = test_use_bitmap,
451 }; 451 };
452 struct btrfs_free_space_op *orig_free_space_ops; 452 const struct btrfs_free_space_op *orig_free_space_ops;
453 453
454 test_msg("Running space stealing from bitmap to extent\n"); 454 test_msg("Running space stealing from bitmap to extent\n");
455 455