aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 2e4428bd60ec..73ccadce90bc 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -50,12 +50,12 @@ static void end_workqueue_fn(struct btrfs_work *work);
50static void free_fs_root(struct btrfs_root *root); 50static void free_fs_root(struct btrfs_root *root);
51static void btrfs_check_super_valid(struct btrfs_fs_info *fs_info, 51static void btrfs_check_super_valid(struct btrfs_fs_info *fs_info,
52 int read_only); 52 int read_only);
53static int btrfs_destroy_ordered_operations(struct btrfs_root *root); 53static void btrfs_destroy_ordered_operations(struct btrfs_root *root);
54static int btrfs_destroy_ordered_extents(struct btrfs_root *root); 54static void btrfs_destroy_ordered_extents(struct btrfs_root *root);
55static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, 55static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
56 struct btrfs_root *root); 56 struct btrfs_root *root);
57static int btrfs_destroy_pending_snapshots(struct btrfs_transaction *t); 57static void btrfs_destroy_pending_snapshots(struct btrfs_transaction *t);
58static int btrfs_destroy_delalloc_inodes(struct btrfs_root *root); 58static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root);
59static int btrfs_destroy_marked_extents(struct btrfs_root *root, 59static int btrfs_destroy_marked_extents(struct btrfs_root *root,
60 struct extent_io_tree *dirty_pages, 60 struct extent_io_tree *dirty_pages,
61 int mark); 61 int mark);
@@ -1139,10 +1139,10 @@ void clean_tree_block(struct btrfs_trans_handle *trans, struct btrfs_root *root,
1139 } 1139 }
1140} 1140}
1141 1141
1142static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize, 1142static void __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
1143 u32 stripesize, struct btrfs_root *root, 1143 u32 stripesize, struct btrfs_root *root,
1144 struct btrfs_fs_info *fs_info, 1144 struct btrfs_fs_info *fs_info,
1145 u64 objectid) 1145 u64 objectid)
1146{ 1146{
1147 root->node = NULL; 1147 root->node = NULL;
1148 root->commit_root = NULL; 1148 root->commit_root = NULL;
@@ -1194,7 +1194,6 @@ static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
1194 root->defrag_running = 0; 1194 root->defrag_running = 0;
1195 root->root_key.objectid = objectid; 1195 root->root_key.objectid = objectid;
1196 root->anon_dev = 0; 1196 root->anon_dev = 0;
1197 return 0;
1198} 1197}
1199 1198
1200static int __must_check find_and_setup_root(struct btrfs_root *tree_root, 1199static int __must_check find_and_setup_root(struct btrfs_root *tree_root,
@@ -2897,7 +2896,7 @@ int write_ctree_super(struct btrfs_trans_handle *trans,
2897 return ret; 2896 return ret;
2898} 2897}
2899 2898
2900int btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root) 2899void btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root)
2901{ 2900{
2902 spin_lock(&fs_info->fs_roots_radix_lock); 2901 spin_lock(&fs_info->fs_roots_radix_lock);
2903 radix_tree_delete(&fs_info->fs_roots_radix, 2902 radix_tree_delete(&fs_info->fs_roots_radix,
@@ -2910,7 +2909,6 @@ int btrfs_free_fs_root(struct btrfs_fs_info *fs_info, struct btrfs_root *root)
2910 __btrfs_remove_free_space_cache(root->free_ino_pinned); 2909 __btrfs_remove_free_space_cache(root->free_ino_pinned);
2911 __btrfs_remove_free_space_cache(root->free_ino_ctl); 2910 __btrfs_remove_free_space_cache(root->free_ino_ctl);
2912 free_fs_root(root); 2911 free_fs_root(root);
2913 return 0;
2914} 2912}
2915 2913
2916static void free_fs_root(struct btrfs_root *root) 2914static void free_fs_root(struct btrfs_root *root)
@@ -2927,7 +2925,7 @@ static void free_fs_root(struct btrfs_root *root)
2927 kfree(root); 2925 kfree(root);
2928} 2926}
2929 2927
2930static int del_fs_roots(struct btrfs_fs_info *fs_info) 2928static void del_fs_roots(struct btrfs_fs_info *fs_info)
2931{ 2929{
2932 int ret; 2930 int ret;
2933 struct btrfs_root *gang[8]; 2931 struct btrfs_root *gang[8];
@@ -2956,7 +2954,6 @@ static int del_fs_roots(struct btrfs_fs_info *fs_info)
2956 for (i = 0; i < ret; i++) 2954 for (i = 0; i < ret; i++)
2957 btrfs_free_fs_root(fs_info, gang[i]); 2955 btrfs_free_fs_root(fs_info, gang[i]);
2958 } 2956 }
2959 return 0;
2960} 2957}
2961 2958
2962int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info) 2959int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info)
@@ -3299,7 +3296,7 @@ int btrfs_error_commit_super(struct btrfs_root *root)
3299 return ret; 3296 return ret;
3300} 3297}
3301 3298
3302static int btrfs_destroy_ordered_operations(struct btrfs_root *root) 3299static void btrfs_destroy_ordered_operations(struct btrfs_root *root)
3303{ 3300{
3304 struct btrfs_inode *btrfs_inode; 3301 struct btrfs_inode *btrfs_inode;
3305 struct list_head splice; 3302 struct list_head splice;
@@ -3321,11 +3318,9 @@ static int btrfs_destroy_ordered_operations(struct btrfs_root *root)
3321 3318
3322 spin_unlock(&root->fs_info->ordered_extent_lock); 3319 spin_unlock(&root->fs_info->ordered_extent_lock);
3323 mutex_unlock(&root->fs_info->ordered_operations_mutex); 3320 mutex_unlock(&root->fs_info->ordered_operations_mutex);
3324
3325 return 0;
3326} 3321}
3327 3322
3328static int btrfs_destroy_ordered_extents(struct btrfs_root *root) 3323static void btrfs_destroy_ordered_extents(struct btrfs_root *root)
3329{ 3324{
3330 struct list_head splice; 3325 struct list_head splice;
3331 struct btrfs_ordered_extent *ordered; 3326 struct btrfs_ordered_extent *ordered;
@@ -3357,8 +3352,6 @@ static int btrfs_destroy_ordered_extents(struct btrfs_root *root)
3357 } 3352 }
3358 3353
3359 spin_unlock(&root->fs_info->ordered_extent_lock); 3354 spin_unlock(&root->fs_info->ordered_extent_lock);
3360
3361 return 0;
3362} 3355}
3363 3356
3364static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, 3357static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
@@ -3413,7 +3406,7 @@ static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
3413 return ret; 3406 return ret;
3414} 3407}
3415 3408
3416static int btrfs_destroy_pending_snapshots(struct btrfs_transaction *t) 3409static void btrfs_destroy_pending_snapshots(struct btrfs_transaction *t)
3417{ 3410{
3418 struct btrfs_pending_snapshot *snapshot; 3411 struct btrfs_pending_snapshot *snapshot;
3419 struct list_head splice; 3412 struct list_head splice;
@@ -3431,11 +3424,9 @@ static int btrfs_destroy_pending_snapshots(struct btrfs_transaction *t)
3431 3424
3432 kfree(snapshot); 3425 kfree(snapshot);
3433 } 3426 }
3434
3435 return 0;
3436} 3427}
3437 3428
3438static int btrfs_destroy_delalloc_inodes(struct btrfs_root *root) 3429static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root)
3439{ 3430{
3440 struct btrfs_inode *btrfs_inode; 3431 struct btrfs_inode *btrfs_inode;
3441 struct list_head splice; 3432 struct list_head splice;
@@ -3455,8 +3446,6 @@ static int btrfs_destroy_delalloc_inodes(struct btrfs_root *root)
3455 } 3446 }
3456 3447
3457 spin_unlock(&root->fs_info->delalloc_lock); 3448 spin_unlock(&root->fs_info->delalloc_lock);
3458
3459 return 0;
3460} 3449}
3461 3450
3462static int btrfs_destroy_marked_extents(struct btrfs_root *root, 3451static int btrfs_destroy_marked_extents(struct btrfs_root *root,