mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
mm/truncate: bail out early from invalidate_inode_pages2_range() if mapping is empty
If mapping is empty (both ->nrpages and ->nrexceptional is zero) we can avoid pointless lookups in empty radix tree and bail out immediately after cleancache invalidation. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Andrey Ryabinin <[email protected]> Reviewed-by: Jan Kara <[email protected]> Acked-by: Konrad Rzeszutek Wilk <[email protected]> Cc: Alexander Viro <[email protected]> Cc: Ross Zwisler <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Alexey Kuznetsov <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Nikolay Borisov <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
a5f6a6a9c7
commit
32691f0fbe
1 changed files with 3 additions and 0 deletions
|
|
@ -624,6 +624,9 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
|
|||
int did_range_unmap = 0;
|
||||
|
||||
cleancache_invalidate_inode(mapping);
|
||||
if (mapping->nrpages == 0 && mapping->nrexceptional == 0)
|
||||
return 0;
|
||||
|
||||
pagevec_init(&pvec, 0);
|
||||
index = start;
|
||||
while (index <= end && pagevec_lookup_entries(&pvec, mapping, index,
|
||||
|
|
|
|||
Loading…
Reference in a new issue