diff mbox series

Btrfs: remove no longer used logged range variables when logging extents

Message ID 20181026202640.24131-1-fdmanana@kernel.org (mailing list archive)
State New, archived
Headers show
Series Btrfs: remove no longer used logged range variables when logging extents | expand

Commit Message

Filipe Manana Oct. 26, 2018, 8:26 p.m. UTC
From: Filipe Manana <fdmanana@suse.com>

The logged_start and logged_end variables, at btrfs_log_changed_extents(),
were added in commit 8c6c592831a0 ("btrfs: log csums for all modified
extents"). However since the recent simplification for fsync, which makes
us wait for all ordered extents to complete before logging extents, we
no longer need those variables. Commit a2120a473a80 ("btrfs: clean up the
left over logged_list usage") forgot to remove them.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/tree-log.c | 8 --------
 1 file changed, 8 deletions(-)

Comments

Nikolay Borisov Oct. 28, 2018, 6:01 p.m. UTC | #1
On 26.10.18 г. 23:26 ч., fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> The logged_start and logged_end variables, at btrfs_log_changed_extents(),
> were added in commit 8c6c592831a0 ("btrfs: log csums for all modified
> extents"). However since the recent simplification for fsync, which makes
> us wait for all ordered extents to complete before logging extents, we
> no longer need those variables. Commit a2120a473a80 ("btrfs: clean up the
> left over logged_list usage") forgot to remove them.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>  fs/btrfs/tree-log.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
> index 1673dccc76c2..c86c5dd100b2 100644
> --- a/fs/btrfs/tree-log.c
> +++ b/fs/btrfs/tree-log.c
> @@ -4383,7 +4383,6 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans,
>  	struct extent_map *em, *n;
>  	struct list_head extents;
>  	struct extent_map_tree *tree = &inode->extent_tree;
> -	u64 logged_start, logged_end;
>  	u64 test_gen;
>  	int ret = 0;
>  	int num = 0;
> @@ -4393,8 +4392,6 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans,
>  	down_write(&inode->dio_sem);
>  	write_lock(&tree->lock);
>  	test_gen = root->fs_info->last_trans_committed;
> -	logged_start = start;
> -	logged_end = end;
>  
>  	list_for_each_entry_safe(em, n, &tree->modified_extents, list) {
>  		list_del_init(&em->list);
> @@ -4418,11 +4415,6 @@ static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans,
>  		    em->start >= i_size_read(&inode->vfs_inode))
>  			continue;
>  
> -		if (em->start < logged_start)
> -			logged_start = em->start;
> -		if ((em->start + em->len - 1) > logged_end)
> -			logged_end = em->start + em->len - 1;
> -
>  		/* Need a ref to keep it from getting evicted from cache */
>  		refcount_inc(&em->refs);
>  		set_bit(EXTENT_FLAG_LOGGING, &em->flags);
>
David Sterba Oct. 30, 2018, 5:28 p.m. UTC | #2
On Fri, Oct 26, 2018 at 09:26:40PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> The logged_start and logged_end variables, at btrfs_log_changed_extents(),
> were added in commit 8c6c592831a0 ("btrfs: log csums for all modified
> extents"). However since the recent simplification for fsync, which makes
> us wait for all ordered extents to complete before logging extents, we
> no longer need those variables. Commit a2120a473a80 ("btrfs: clean up the
> left over logged_list usage") forgot to remove them.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Added to misc-next, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 1673dccc76c2..c86c5dd100b2 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -4383,7 +4383,6 @@  static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans,
 	struct extent_map *em, *n;
 	struct list_head extents;
 	struct extent_map_tree *tree = &inode->extent_tree;
-	u64 logged_start, logged_end;
 	u64 test_gen;
 	int ret = 0;
 	int num = 0;
@@ -4393,8 +4392,6 @@  static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans,
 	down_write(&inode->dio_sem);
 	write_lock(&tree->lock);
 	test_gen = root->fs_info->last_trans_committed;
-	logged_start = start;
-	logged_end = end;
 
 	list_for_each_entry_safe(em, n, &tree->modified_extents, list) {
 		list_del_init(&em->list);
@@ -4418,11 +4415,6 @@  static int btrfs_log_changed_extents(struct btrfs_trans_handle *trans,
 		    em->start >= i_size_read(&inode->vfs_inode))
 			continue;
 
-		if (em->start < logged_start)
-			logged_start = em->start;
-		if ((em->start + em->len - 1) > logged_end)
-			logged_end = em->start + em->len - 1;
-
 		/* Need a ref to keep it from getting evicted from cache */
 		refcount_inc(&em->refs);
 		set_bit(EXTENT_FLAG_LOGGING, &em->flags);