btrfs: Opencode ordered_data_tree_panic
PATCH 1/1 btrfs: Opencode ordered_data_tree_panic
It's a simple wrapper over btrfs_panic and is called only once. Just open code it.
--- fs/btrfs/extent-tree.c | 5 +---- fs/btrfs/ordered-data.c | 10 +--------- 2 files changed, 2 insertions(+), 13 deletions(-)
fs/btrfs/extent-tree.c +1 -4
@@ -4172,11 +4172,8 @@ int btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info,struct btrfs_block_group *cache; cache =btrfs_lookup_block_group (fs_info, start); -if (!cache) { -btrfs_err (fs_info,"Unable to find block group for %llu" , - start); +if (!cache)return -ENOSPC ; - }btrfs_add_free_space (cache, start, len);btrfs_free_reserved_bytes (cache, len, delalloc);
fs/btrfs/ordered-data.c +1 -9
@@ -52,14 +52,6 @@ static struct rb_node *tree_insert(struct rb_root *root, u64 file_offset,return NULL ; } -static void ordered_data_tree_panic (struct inode *inode,int errno, -u64 offset) -{ -struct btrfs_fs_info *fs_info =btrfs_sb (inode->i_sb); -btrfs_panic (fs_info, errno, -"Inconsistency in ordered tree at offset %llu" , offset); -} -/* * look for a given offset in the tree, and if it can't be found return the * first lesser offset
@@ -219,7 +211,7 @@ static int __btrfs_add_ordered_extent(struct inode *inode, u64 file_offset, node =tree_insert (&tree->tree, file_offset, &entry->rb_node);if (node) -ordered_data_tree_panic (inode, -EEXIST , file_offset); +btrfs_panic (fs_info, -EEXIST ,"Inconsistency in ordered tree at offset %llu" ,offset);spin_unlock_irq (&tree->lock);spin_lock (&root->ordered_extent_lock);
Signature · 1 line
2.17.1
Quoted 16 lines · Nikolay Borisov
It's a simple wrapper over
btrfs_panicand is called only once. Just open code it.Signed-off-by Nikolay Borisov <[email protected]>--- fs/btrfs/extent-tree.c | 5 +---- fs/btrfs/ordered-data.c | 10 +--------- 2 files changed, 2 insertions(+), 13 deletions(-)fs/btrfs/extent-tree.c +0
-0@@ -4172,11 +4172,8 @@ int btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info,struct btrfs_block_group *cache;
fs/btrfs/extent-tree.c int btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info, · line 4179
Quoted 10 lines
fs/btrfs/extent-tree.c +1
-4cache =btrfs_lookup_block_group (fs_info, start); -if (!cache) { -btrfs_err (fs_info,"Unable to find block group for %llu" , - start); +if (!cache)return -ENOSPC ; - }btrfs_add_free_space (cache, start, len);btrfs_free_reserved_bytes (cache, len, delalloc);
Grrr this hunk should be dropped.... Shall I resend ?
Quoted 29 lines
fs/btrfs/ordered-data.c +1
-9@@ -52,14 +52,6 @@ static struct rb_node *tree_insert(struct rb_root *root, u64 file_offset,return NULL ; } -static void ordered_data_tree_panic (struct inode *inode,int errno, -u64 offset) -{ -struct btrfs_fs_info *fs_info =btrfs_sb (inode->i_sb); -btrfs_panic (fs_info, errno, -"Inconsistency in ordered tree at offset %llu" , offset); -} -/* * look for a given offset in the tree, and if it can't be found return the * first lesser offset @@ -219,7 +211,7 @@ static int __btrfs_add_ordered_extent(struct inode *inode, u64 file_offset, node =tree_insert (&tree->tree, file_offset, &entry->rb_node);if (node) -ordered_data_tree_panic (inode, -EEXIST , file_offset); +btrfs_panic (fs_info, -EEXIST ,"Inconsistency in ordered tree at offset %llu" ,offset);spin_unlock_irq (&tree->lock);spin_lock (&root->ordered_extent_lock);
Quoted 27 lines · Nikolay Borisov
Quoted 24 lines · Nikolay Borisov
It's a simple wrapper over
btrfs_panicand is called only once. Just open code it.Signed-off-by Nikolay Borisov <[email protected]>--- fs/btrfs/extent-tree.c | 5 +---- fs/btrfs/ordered-data.c | 10 +--------- 2 files changed, 2 insertions(+), 13 deletions(-)fs/btrfs/extent-tree.c +1
-4@@ -4172,11 +4172,8 @@ int btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info,struct btrfs_block_group *cache; cache =btrfs_lookup_block_group (fs_info, start); -if (!cache) { -btrfs_err (fs_info,"Unable to find block group for %llu" , - start); +if (!cache)return -ENOSPC ; - }
Quoted 4 lines
fs/btrfs/extent-tree.c int btrfs_free_reserved_extent(struct btrfs_fs_info *fs_info, · line 4179
Quoted 2 lines
fs/btrfs/extent-tree.c +0
-0btrfs_add_free_space (cache, start, len);btrfs_free_reserved_bytes (cache, len, delalloc);Grrr this hunk should be dropped.... Shall I resend ?
No, i'll drop it
Quoted 4 lines · Nikolay Borisov
It's a simple wrapper over
btrfs_panicand is called only once. Just open code it.Signed-off-by Nikolay Borisov <[email protected]>
Added to misc-next with 1st hunk dropped and fixed coding style, thanks.