diff mbox series

btrfs: Do not check for writeback in btrfs_releasepage()

Message ID 20191018181544.26515-2-rgoldwyn@suse.de (mailing list archive)
State New, archived
Headers show
Series btrfs: Do not check for writeback in btrfs_releasepage() | expand

Commit Message

Goldwyn Rodrigues Oct. 18, 2019, 6:15 p.m. UTC
From: Goldwyn Rodrigues <rgoldwyn@suse.com>

We check for PageWriteback in try_to_release_page(), the
sole caller of address_space->releasepage(). We don't need
to check it again in btrfs_releasepage()

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
---
 fs/btrfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Goldwyn Rodrigues Oct. 18, 2019, 11:35 p.m. UTC | #1
Scratch this. btrfs_releasepage() is called from btrfs_invalidatepage()
as well. Sorry for the noise.


On 13:15 18/10, Goldwyn Rodrigues wrote:
> From: Goldwyn Rodrigues <rgoldwyn@suse.com>
> 
> We check for PageWriteback in try_to_release_page(), the
> sole caller of address_space->releasepage(). We don't need
> to check it again in btrfs_releasepage()
> 
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
> ---
>  fs/btrfs/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 0f2754eaa05b..10303c2379a9 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -8793,7 +8793,7 @@ static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags)
>  
>  static int btrfs_releasepage(struct page *page, gfp_t gfp_flags)
>  {
> -	if (PageWriteback(page) || PageDirty(page))
> +	if (PageDirty(page))
>  		return 0;
>  	return __btrfs_releasepage(page, gfp_flags);
>  }
> -- 
> 2.16.4
>
diff mbox series

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0f2754eaa05b..10303c2379a9 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -8793,7 +8793,7 @@  static int __btrfs_releasepage(struct page *page, gfp_t gfp_flags)
 
 static int btrfs_releasepage(struct page *page, gfp_t gfp_flags)
 {
-	if (PageWriteback(page) || PageDirty(page))
+	if (PageDirty(page))
 		return 0;
 	return __btrfs_releasepage(page, gfp_flags);
 }