diff options
author | Liu Bo <bo.liu@linux.alibaba.com> | 2018-09-13 19:44:42 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-10-15 17:23:31 +0200 |
commit | abb57ef3ff9720c42bbc06bcd1788da9ce1a3eb8 (patch) | |
tree | 3fadcf36a6e3770833520651cfd2141520144e57 /fs/btrfs/extent_io.h | |
parent | Btrfs: assert page dirty bit on extent buffer pages (diff) | |
download | linux-abb57ef3ff9720c42bbc06bcd1788da9ce1a3eb8.tar.xz linux-abb57ef3ff9720c42bbc06bcd1788da9ce1a3eb8.zip |
Btrfs: skip set_page_dirty if eb pages are already dirty
As long as @eb is marked with EXTENT_BUFFER_DIRTY, all of its pages
are dirty, so no need to set pages dirty again.
Ftrace showed that the loop took 10us on my dev box, so removing this
can save us at least 10us if eb is already dirty and otherwise avoid a
potentially expensive calls to set_page_dirty.
Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent_io.h')
-rw-r--r-- | fs/btrfs/extent_io.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index b4d03e677e1d..f2ab42d57f02 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -479,7 +479,7 @@ void extent_buffer_bitmap_set(struct extent_buffer *eb, unsigned long start, void extent_buffer_bitmap_clear(struct extent_buffer *eb, unsigned long start, unsigned long pos, unsigned long len); void clear_extent_buffer_dirty(struct extent_buffer *eb); -int set_extent_buffer_dirty(struct extent_buffer *eb); +bool set_extent_buffer_dirty(struct extent_buffer *eb); void set_extent_buffer_uptodate(struct extent_buffer *eb); void clear_extent_buffer_uptodate(struct extent_buffer *eb); int extent_buffer_under_io(struct extent_buffer *eb); |