diff mbox series

[3/9] btrfs: open code set_extent_new

Message ID 34f3abd71b4da58527bfc16268a4d915f98e5305.1684967923.git.dsterba@suse.com (mailing list archive)
State New, archived
Headers show
Series Parameter cleanups in extent state helpers | expand

Commit Message

David Sterba May 24, 2023, 11:04 p.m. UTC
The helper is used only once.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/extent-io-tree.h | 6 ------
 fs/btrfs/extent-tree.c    | 5 +++--
 2 files changed, 3 insertions(+), 8 deletions(-)

Comments

Christoph Hellwig May 25, 2023, 8:59 a.m. UTC | #1
Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>
Qu Wenruo May 25, 2023, 10:32 a.m. UTC | #2
On 2023/5/25 07:04, David Sterba wrote:
> The helper is used only once.
>
> Signed-off-by: David Sterba <dsterba@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>   fs/btrfs/extent-io-tree.h | 6 ------
>   fs/btrfs/extent-tree.c    | 5 +++--
>   2 files changed, 3 insertions(+), 8 deletions(-)
>
> diff --git a/fs/btrfs/extent-io-tree.h b/fs/btrfs/extent-io-tree.h
> index e5289d67b6b7..293e49377104 100644
> --- a/fs/btrfs/extent-io-tree.h
> +++ b/fs/btrfs/extent-io-tree.h
> @@ -193,12 +193,6 @@ int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
>   		       u32 bits, u32 clear_bits,
>   		       struct extent_state **cached_state);
>
> -static inline int set_extent_new(struct extent_io_tree *tree, u64 start,
> -		u64 end)
> -{
> -	return set_extent_bit(tree, start, end, EXTENT_NEW, NULL, GFP_NOFS);
> -}
> -
>   int find_first_extent_bit(struct extent_io_tree *tree, u64 start,
>   			  u64 *start_ret, u64 *end_ret, u32 bits,
>   			  struct extent_state **cached_state);
> diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
> index 5de5b577e7fd..5c7c72042193 100644
> --- a/fs/btrfs/extent-tree.c
> +++ b/fs/btrfs/extent-tree.c
> @@ -4832,8 +4832,9 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
>   			set_extent_dirty(&root->dirty_log_pages, buf->start,
>   					buf->start + buf->len - 1, GFP_NOFS);
>   		else
> -			set_extent_new(&root->dirty_log_pages, buf->start,
> -					buf->start + buf->len - 1);
> +			set_extent_bit(&root->dirty_log_pages, buf->start,
> +				       buf->start + buf->len - 1,
> +				       EXTENT_NEW, NULL, GFP_NOFS);
>   	} else {
>   		buf->log_index = -1;
>   		set_extent_dirty(&trans->transaction->dirty_pages, buf->start,
diff mbox series

Patch

diff --git a/fs/btrfs/extent-io-tree.h b/fs/btrfs/extent-io-tree.h
index e5289d67b6b7..293e49377104 100644
--- a/fs/btrfs/extent-io-tree.h
+++ b/fs/btrfs/extent-io-tree.h
@@ -193,12 +193,6 @@  int convert_extent_bit(struct extent_io_tree *tree, u64 start, u64 end,
 		       u32 bits, u32 clear_bits,
 		       struct extent_state **cached_state);
 
-static inline int set_extent_new(struct extent_io_tree *tree, u64 start,
-		u64 end)
-{
-	return set_extent_bit(tree, start, end, EXTENT_NEW, NULL, GFP_NOFS);
-}
-
 int find_first_extent_bit(struct extent_io_tree *tree, u64 start,
 			  u64 *start_ret, u64 *end_ret, u32 bits,
 			  struct extent_state **cached_state);
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 5de5b577e7fd..5c7c72042193 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4832,8 +4832,9 @@  btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
 			set_extent_dirty(&root->dirty_log_pages, buf->start,
 					buf->start + buf->len - 1, GFP_NOFS);
 		else
-			set_extent_new(&root->dirty_log_pages, buf->start,
-					buf->start + buf->len - 1);
+			set_extent_bit(&root->dirty_log_pages, buf->start,
+				       buf->start + buf->len - 1,
+				       EXTENT_NEW, NULL, GFP_NOFS);
 	} else {
 		buf->log_index = -1;
 		set_extent_dirty(&trans->transaction->dirty_pages, buf->start,