Skip to content

Commit

Permalink
Btrfs: remove wait_ordered_range in btrfs_evict_inode
Browse files Browse the repository at this point in the history
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()
     ...

As VFS has called ->invalidatepage() to get all ordered extents done (if
there are any) and truncated all page cache pages (no dirty pages to
writeback after this step), wait_ordered_range() is just a noop.

Signed-off-by: Liu Bo <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
liubogithub authored and kdave committed Oct 15, 2018
1 parent abb57ef commit 4183c52
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5362,9 +5362,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);

Expand Down

0 comments on commit 4183c52

Please sign in to comment.