public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: modify path->reada in btrfs_shrink_device to READA_BACK
@ 2018-04-27  8:22 Gu Jinxiang
  2018-04-27  8:28 ` Nikolay Borisov
  2018-05-01 13:44 ` David Sterba
  0 siblings, 2 replies; 3+ messages in thread
From: Gu Jinxiang @ 2018-04-27  8:22 UTC (permalink / raw)
  To: linux-btrfs

In btrfs_shrink_device, before btrfs_search_slot, path->reada is
set to READA_FORWARD. But I think READA_BACK is correct.
Since,
 1.key.offset is set to (u64)-1
 2.After btrfs_search_slot, btrfs_previous_item is called.
So, for readahead previous items, READA_BACK is correct one.

Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
---
 fs/btrfs/volumes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 292266f6ab9c..1a3506a3003d 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -4473,7 +4473,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
 	if (!path)
 		return -ENOMEM;
 
-	path->reada = READA_FORWARD;
+	path->reada = READA_BACK;
 
 	mutex_lock(&fs_info->chunk_mutex);
 
-- 
1.9.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: modify path->reada in btrfs_shrink_device to READA_BACK
  2018-04-27  8:22 [PATCH] btrfs: modify path->reada in btrfs_shrink_device to READA_BACK Gu Jinxiang
@ 2018-04-27  8:28 ` Nikolay Borisov
  2018-05-01 13:44 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: Nikolay Borisov @ 2018-04-27  8:28 UTC (permalink / raw)
  To: Gu Jinxiang, linux-btrfs



On 27.04.2018 11:22, Gu Jinxiang wrote:
> In btrfs_shrink_device, before btrfs_search_slot, path->reada is
> set to READA_FORWARD. But I think READA_BACK is correct.
> Since,
>  1.key.offset is set to (u64)-1
>  2.After btrfs_search_slot, btrfs_previous_item is called.
> So, for readahead previous items, READA_BACK is correct one.

My analysis arrives at the same conclusions so:

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

> 
> Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
> ---
>  fs/btrfs/volumes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 292266f6ab9c..1a3506a3003d 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -4473,7 +4473,7 @@ int btrfs_shrink_device(struct btrfs_device *device, u64 new_size)
>  	if (!path)
>  		return -ENOMEM;
>  
> -	path->reada = READA_FORWARD;
> +	path->reada = READA_BACK;
>  
>  	mutex_lock(&fs_info->chunk_mutex);
>  
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] btrfs: modify path->reada in btrfs_shrink_device to READA_BACK
  2018-04-27  8:22 [PATCH] btrfs: modify path->reada in btrfs_shrink_device to READA_BACK Gu Jinxiang
  2018-04-27  8:28 ` Nikolay Borisov
@ 2018-05-01 13:44 ` David Sterba
  1 sibling, 0 replies; 3+ messages in thread
From: David Sterba @ 2018-05-01 13:44 UTC (permalink / raw)
  To: Gu Jinxiang; +Cc: linux-btrfs

On Fri, Apr 27, 2018 at 04:22:07PM +0800, Gu Jinxiang wrote:
> In btrfs_shrink_device, before btrfs_search_slot, path->reada is
> set to READA_FORWARD. But I think READA_BACK is correct.
> Since,
>  1.key.offset is set to (u64)-1
>  2.After btrfs_search_slot, btrfs_previous_item is called.
> So, for readahead previous items, READA_BACK is correct one.
> 
> Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>

Added to next, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-01 13:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-27  8:22 [PATCH] btrfs: modify path->reada in btrfs_shrink_device to READA_BACK Gu Jinxiang
2018-04-27  8:28 ` Nikolay Borisov
2018-05-01 13:44 ` David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox