mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-01 12:04:08 +00:00
Btrfs: update to the right index of defragment
When we use autodefrag, we forget to update the index which indicates the last page we've dirty. And we'll set dirty flags on a same set of pages again and again. Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
66c2689226
commit
e1f041e14c
1 changed files with 3 additions and 0 deletions
|
@ -1186,6 +1186,9 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
|
||||||
if (newer_off == (u64)-1)
|
if (newer_off == (u64)-1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (ret > 0)
|
||||||
|
i += ret;
|
||||||
|
|
||||||
newer_off = max(newer_off + 1,
|
newer_off = max(newer_off + 1,
|
||||||
(u64)i << PAGE_CACHE_SHIFT);
|
(u64)i << PAGE_CACHE_SHIFT);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue