btrfs: constify remaining structs with function pointers
authorDavid Sterba <dsterba@suse.com>
Thu, 19 Nov 2015 10:42:28 +0000 (11:42 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 7 Jan 2016 14:01:14 +0000 (15:01 +0100)
* struct extent_io_ops
* struct btrfs_free_space_op

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/free-space-cache.c
fs/btrfs/free-space-cache.h
fs/btrfs/inode-map.c
fs/btrfs/inode.c
fs/btrfs/tests/free-space-tests.c

index cfe99bec49dedd723e2a7fff04ace299be37ef87..ed8a3b7d356541ad8674eec9c0cdc9393807dd55 100644 (file)
@@ -2016,7 +2016,7 @@ static bool use_bitmap(struct btrfs_free_space_ctl *ctl,
        return true;
 }
 
-static struct btrfs_free_space_op free_space_op = {
+static const struct btrfs_free_space_op free_space_op = {
        .recalc_thresholds      = recalculate_thresholds,
        .use_bitmap             = use_bitmap,
 };
index f251865eb6f3a628540740a93055e8cdc5aed08c..33178c490ace0c55418d5ab40415594e1a91bb0c 100644 (file)
@@ -37,7 +37,7 @@ struct btrfs_free_space_ctl {
        int total_bitmaps;
        int unit;
        u64 start;
-       struct btrfs_free_space_op *op;
+       const struct btrfs_free_space_op *op;
        void *private;
        struct mutex cache_writeout_mutex;
        struct list_head trimming_ranges;
index 767a6056ac45afce29844e469f582baec8ef28cd..53014e963617e7e979a96b3329da4041ba721574 100644 (file)
@@ -334,7 +334,7 @@ static bool use_bitmap(struct btrfs_free_space_ctl *ctl,
        return true;
 }
 
-static struct btrfs_free_space_op free_ino_op = {
+static const struct btrfs_free_space_op free_ino_op = {
        .recalc_thresholds      = recalculate_thresholds,
        .use_bitmap             = use_bitmap,
 };
@@ -356,7 +356,7 @@ static bool pinned_use_bitmap(struct btrfs_free_space_ctl *ctl,
        return false;
 }
 
-static struct btrfs_free_space_op pinned_free_ino_op = {
+static const struct btrfs_free_space_op pinned_free_ino_op = {
        .recalc_thresholds      = pinned_recalc_thresholds,
        .use_bitmap             = pinned_use_bitmap,
 };
index 0214a812fc0e55570db01006e70af35518306b7f..c4cfba79ab47531b02dc0e56e943e09a942ff41b 100644 (file)
@@ -74,7 +74,7 @@ static const struct inode_operations btrfs_file_inode_operations;
 static const struct address_space_operations btrfs_aops;
 static const struct address_space_operations btrfs_symlink_aops;
 static const struct file_operations btrfs_dir_file_operations;
-static struct extent_io_ops btrfs_extent_io_ops;
+static const struct extent_io_ops btrfs_extent_io_ops;
 
 static struct kmem_cache *btrfs_inode_cachep;
 struct kmem_cache *btrfs_trans_handle_cachep;
@@ -10020,7 +10020,7 @@ static const struct file_operations btrfs_dir_file_operations = {
        .fsync          = btrfs_sync_file,
 };
 
-static struct extent_io_ops btrfs_extent_io_ops = {
+static const struct extent_io_ops btrfs_extent_io_ops = {
        .fill_delalloc = run_delalloc_range,
        .submit_bio_hook = btrfs_submit_bio_hook,
        .merge_bio_hook = btrfs_merge_bio_hook,
index 46c2f292ea949b429142426a46789fe2d4e609fa..69a11e63d668339ecb9f2f3a42b7eeeb22b9d634 100644 (file)
@@ -445,11 +445,11 @@ test_steal_space_from_bitmap_to_extent(struct btrfs_block_group_cache *cache)
        int ret;
        u64 offset;
        u64 max_extent_size;
-       struct btrfs_free_space_op test_free_space_ops = {
+       const struct btrfs_free_space_op test_free_space_ops = {
                .recalc_thresholds = cache->free_space_ctl->op->recalc_thresholds,
                .use_bitmap = test_use_bitmap,
        };
-       struct btrfs_free_space_op *orig_free_space_ops;
+       const struct btrfs_free_space_op *orig_free_space_ops;
 
        test_msg("Running space stealing from bitmap to extent\n");