Re: [PATCH 1/4] fs/buffer: use sleeping lookup in __getblk_slowpath()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu 15-05-25 10:39:22, Davidlohr Bueso wrote:
> Just as with the fast path, call the lookup variant depending
> on the gfp flags.
> 
> Signed-off-by: Davidlohr Bueso <dave@xxxxxxxxxxxx>

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@xxxxxxx>

								Honza
> ---
>  fs/buffer.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/buffer.c b/fs/buffer.c
> index b8e1e6e325cd..5a4342881f3b 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -1122,6 +1122,8 @@ static struct buffer_head *
>  __getblk_slow(struct block_device *bdev, sector_t block,
>  	     unsigned size, gfp_t gfp)
>  {
> +	bool blocking = gfpflags_allow_blocking(gfp);
> +
>  	/* Size must be multiple of hard sectorsize */
>  	if (unlikely(size & (bdev_logical_block_size(bdev)-1) ||
>  			(size < 512 || size > PAGE_SIZE))) {
> @@ -1137,7 +1139,10 @@ __getblk_slow(struct block_device *bdev, sector_t block,
>  	for (;;) {
>  		struct buffer_head *bh;
>  
> -		bh = __find_get_block(bdev, block, size);
> +		if (blocking)
> +			bh = __find_get_block_nonatomic(bdev, block, size);
> +		else
> +			bh = __find_get_block(bdev, block, size);
>  		if (bh)
>  			return bh;
>  
> -- 
> 2.39.5
> 
-- 
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux