Btrfs: remove wait_ordered_range in btrfs_evict_inode
PATCH 1/1 Btrfs: remove wait_ordered_range in btrfs_evict_inode
As VFS has called ->invalidatepage() to get all ordered extents done and truncated all page cache pages, wait_ordered_range() is just a noop.
--- fs/btrfs/inode.c | 3 --- 1 file changed, 3 deletions(-)
fs/btrfs/inode.c +0 -3
@@ -5390,9 +5390,6 @@ void btrfs_evict_inode(struct inode *inode)if (is_bad_inode (inode)) goto no_delete; -/* do we really want it for ->i_nlink > 0 and zero btrfs_root_refs? */ -if (!special_file (inode->i_mode)) -btrfs_wait_ordered_range (inode,0 , (u64)-1 );btrfs_free_io_failure_record (BTRFS_I (inode),0 , (u64)-1 );
Signature · 1 line
1.8.3.1
Quoted 3 lines · Liu Bo
As VFS has called ->invalidatepage() to get all ordered extents done and truncated all page cache pages,
wait_ordered_range()is just a noop.
Agreed, though looking up the exact points when there are no pages to be waited for took me some time. More references and hints in the changelog would be good. I'll add the patch to misc-next so it can be tested, but please send me an update if you have idea how to rephrase the changelog. Thanks.
Quoted 5 lines · David Sterba
Quoted 3 lines · Liu Bo
As VFS has called ->invalidatepage() to get all ordered extents done and truncated all page cache pages,
wait_ordered_range()is just a noop.
Quoted 7 lines
Agreed, though looking up the exact points when there are no pages to be waited for took me some time. More references and hints in the changelog would be good. I'll add the patch to misc-next so it can be tested, but please send me an update if you have idea how to rephrase the changelog. Thanks.
Reviewed-by David Sterba <[email protected]>
OK, I'll add some call stack, hopefully can make it better.
thanks,
-liubo
PATCH v2 1/1 Btrfs: remove wait_ordered_rane in btrfs_evict_inode
In reply to Liu BoWhen we delete an inode,
btrfs_evict_inode() {
truncate_inode_pages_final()
truncate_inode_pages_range()
lock_page()
truncate_cleanup_page()
btrfs_invalidatepage()
wait_on_page_writeback
btrfs_lookup_ordered_range()
cancel_dirty_page()
unlock_page()
...
btrfs_wait_ordered_range()
...As VFS has called ->invalidatepage() to get all ordered extents done (if there is any) and truncated all page cache pages (no dirty pages to writeback after this step), wait_ordered_range() is just a noop.
---
v2: More details in the description.
fs/btrfs/inode.c | 3 --- 1 file changed, 3 deletions(-)
fs/btrfs/inode.c +0 -3
@@ -5390,9 +5390,6 @@ void btrfs_evict_inode(struct inode *inode)if (is_bad_inode (inode)) goto no_delete; -/* do we really want it for ->i_nlink > 0 and zero btrfs_root_refs? */ -if (!special_file (inode->i_mode)) -btrfs_wait_ordered_range (inode,0 , (u64)-1 );btrfs_free_io_failure_record (BTRFS_I (inode),0 , (u64)-1 );
Signature · 1 line
1.8.3.1
Re: [PATCH v2] Btrfs: remove wait_ordered_rane in btrfs_evict_inode
Quoted 16 lines · Liu Bo
When we delete an inode,
btrfs_evict_inode() { truncate_inode_pages_final() truncate_inode_pages_range() lock_page() truncate_cleanup_page() btrfs_invalidatepage() wait_on_page_writeback btrfs_lookup_ordered_range() cancel_dirty_page() unlock_page() ... btrfs_wait_ordered_range() ...
Quoted 8 lines
As VFS has called ->invalidatepage() to get all ordered extents done (if there is any) and truncated all page cache pages (no dirty pages to writeback after this step),
wait_ordered_range()is just a noop.Reviewed-by David Sterba <[email protected]>Signed-off-by Liu Bo <[email protected]>---
v2: More details in the description.
Thanks, patch updated.