diff options
author | Jan Kara <jack@suse.cz> | 2017-11-15 20:34:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-15 21:21:03 -0500 |
commit | 72b045aecdd856b083521f2a963705b4c2e59680 (patch) | |
tree | 586bdb2ee2ed3322084e10355b02e4e9c8fd622a /include/linux/pagemap.h | |
parent | 6b4c54e3787bc03e810062bd257a3b05fd9c72d6 (diff) |
mm: implement find_get_pages_range_tag()
Patch series "Ranged pagevec tagged lookup", v3.
In this series I provide a ranged variant of pagevec_lookup_tag() and
use it in places where it makes sense. This series removes some common
code and it also has a potential for speeding up some operations
similarly as for pagevec_lookup_range() (but for now I can think of only
artificial cases where this happens).
This patch (of 16):
Implement a variant of find_get_pages_tag() that stops iterating at
given index. Lots of users of this function (through pagevec_lookup())
actually want a range lookup and all of them are currently open-coding
this.
Also create corresponding pagevec_lookup_range_tag() function.
Link: http://lkml.kernel.org/r/20171009151359.31984-2-jack@suse.cz
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Bob Peterson <rpeterso@redhat.com>
Cc: Chao Yu <yuchao0@huawei.com>
Cc: David Howells <dhowells@redhat.com>
Cc: David Sterba <dsterba@suse.com>
Cc: Ilya Dryomov <idryomov@gmail.com>
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Steve French <sfrench@samba.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r-- | include/linux/pagemap.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index e08b5339023c..956d6a80e126 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -366,8 +366,16 @@ static inline unsigned find_get_pages(struct address_space *mapping, | |||
366 | } | 366 | } |
367 | unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, | 367 | unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start, |
368 | unsigned int nr_pages, struct page **pages); | 368 | unsigned int nr_pages, struct page **pages); |
369 | unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, | 369 | unsigned find_get_pages_range_tag(struct address_space *mapping, pgoff_t *index, |
370 | int tag, unsigned int nr_pages, struct page **pages); | 370 | pgoff_t end, int tag, unsigned int nr_pages, |
371 | struct page **pages); | ||
372 | static inline unsigned find_get_pages_tag(struct address_space *mapping, | ||
373 | pgoff_t *index, int tag, unsigned int nr_pages, | ||
374 | struct page **pages) | ||
375 | { | ||
376 | return find_get_pages_range_tag(mapping, index, (pgoff_t)-1, tag, | ||
377 | nr_pages, pages); | ||
378 | } | ||
371 | unsigned find_get_entries_tag(struct address_space *mapping, pgoff_t start, | 379 | unsigned find_get_entries_tag(struct address_space *mapping, pgoff_t start, |
372 | int tag, unsigned int nr_entries, | 380 | int tag, unsigned int nr_entries, |
373 | struct page **entries, pgoff_t *indices); | 381 | struct page **entries, pgoff_t *indices); |