btrfs: defrag: use btrfs_mod_outstanding_extents in cluster_pages_for_defrag
diff mbox series

Message ID 20180905030733.29720-1-suy.fnst@cn.fujitsu.com
State New
Headers show
Series
  • btrfs: defrag: use btrfs_mod_outstanding_extents in cluster_pages_for_defrag
Related show

Commit Message

Su Yue Sept. 5, 2018, 3:07 a.m. UTC
Since commit 8b62f87bad9c ("Btrfs: rework outstanding_extents"),
manual operations of outstanding_extent in btrfs_inode are replaced by
btrfs_mod_outstanding_extents().
The one in cluster_pages_for_defrag seems to be lost, so replace it
of btrfs_mod_outstanding_extents().

Fixes: 8b62f87bad9c ("Btrfs: rework outstanding_extents")
Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>
---
 fs/btrfs/ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Sterba Sept. 6, 2018, 3:40 p.m. UTC | #1
On Wed, Sep 05, 2018 at 11:07:33AM +0800, Su Yue wrote:
> Since commit 8b62f87bad9c ("Btrfs: rework outstanding_extents"),
> manual operations of outstanding_extent in btrfs_inode are replaced by
> btrfs_mod_outstanding_extents().
> The one in cluster_pages_for_defrag seems to be lost, so replace it
> of btrfs_mod_outstanding_extents().
> 
> Fixes: 8b62f87bad9c ("Btrfs: rework outstanding_extents")
> Signed-off-by: Su Yue <suy.fnst@cn.fujitsu.com>

Reviewed-by: David Sterba <dsterba@suse.com>

Patch
diff mbox series

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 63600dc2ac4c..c180ded27092 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1308,7 +1308,7 @@  static int cluster_pages_for_defrag(struct inode *inode,
 
 	if (i_done != page_cnt) {
 		spin_lock(&BTRFS_I(inode)->lock);
-		BTRFS_I(inode)->outstanding_extents++;
+		btrfs_mod_outstanding_extents(BTRFS_I(inode), 1);
 		spin_unlock(&BTRFS_I(inode)->lock);
 		btrfs_delalloc_release_space(inode, data_reserved,
 				start_index << PAGE_SHIFT,