Files
Jaegeuk Kim ed2952aaf0 Merge remote-tracking branch 'origin/upstream-f2fs-stable-linux-4.14.y' into android-4.14
Revert commit 884759fa73 ("f2fs: show the fsync_mode=nobarrier mount option")
Revert commit 8145e4913c ("f2fs: fix unnecessary periodic wakeup of discard thread when dev is busy")
Revert commit 39fe1cda39 ("f2fs: let discard thread wait a little longer if dev is busy")
Revert commit 4bbf1ce3a1 ("f2fs: avoid fsync() failure caused by EAGAIN in writepage()")
Revert commit 67226fb52c ("f2fs: fix race in between GC and atomic open")
Revert commit ad8d61efc9 ("f2fs: fix to detect failure of dquot_initialize")
Revert commit c92d09e35d ("f2fs: Fix deadlock in shutdown ioctl")
Revert commit 4f979af7b0 ("f2fs: fix to wait page writeback during revoking atomic write")
Revert commit de13b2ac74 ("f2fs: fix to don't trigger writeback during recovery")
Revert commit f3f0291977 ("f2fs: fix error path of move_data_page")
Revert commit 122031c292 ("disable loading f2fs module on PAGE_SIZE > 4KB")
Revert commit eab3a34122 ("f2fs: give message and set need_fsck given broken node id")

Merge remote-tracking branch 'origin/upstream-f2fs-stable-linux-4.14.y' into android-4.14

Cherry-picked from origin/upstream-f2fs-stable-linux-4.14.y:

1bb3cca126 treewide: Use array_size in f2fs_kvzalloc()
cf663a62b1 treewide: Use array_size() in f2fs_kzalloc()
eac699e689 treewide: Use array_size() in f2fs_kmalloc()
fc8ab902e9 overflow.h: Add allocation size calculation helpers
ccd39d96d1 f2fs: fix to clear FI_VOLATILE_FILE correctly
57344fb593 f2fs: let sync node IO interrupt async one
6cf9490912 f2fs: don't change wbc->sync_mode
c4a1d7bb27 f2fs: fix to update mtime correctly
b693f29b24 fs: f2fs: insert space around that ':' and ', '
9449a17f33 fs: f2fs: add missing blank lines after declarations
b6f703cbed fs: f2fs: changed variable type of offset "unsigned" to "loff_t"
9919f98051 f2fs: clean up symbol namespace
1a37234c5e f2fs: make set_de_type() static
57d24d20b7 f2fs: make __f2fs_write_data_pages() static
e269eadf64 f2fs: fix to avoid accessing cross the boundary
3e1842e7ca f2fs: fix to let caller retry allocating block address
b97a9b9308 disable loading f2fs module on PAGE_SIZE > 4KB
46df5fe2ba f2fs: fix error path of move_data_page
1b8f49aeb0 f2fs: don't drop dentry pages after fs shutdown
5dbd21b17b f2fs: fix to avoid race during access gc_thread pointer
b6f0cb1850 f2fs: clean up with clear_radix_tree_dirty_tag
b9272dd416 f2fs: fix to don't trigger writeback during recovery
d46792d624 f2fs: clear discard_wake earlier
161d1c91b8 f2fs: let discard thread wait a little longer if dev is busy
4329d61ca5 f2fs: avoid stucking GC due to atomic write
223d239c6d f2fs: introduce sbi->gc_mode to determine the policy
c5f57523fc f2fs: keep migration IO order in LFS mode
4a4f98b7e1 f2fs: fix to wait page writeback during revoking atomic write
6c5d01ab37 f2fs: Fix deadlock in shutdown ioctl
1f315091b8 f2fs: detect synchronous writeback more earlier
c806c4187a mm: remove nr_pages argument from pagevec_lookup_{,range}_tag()
8aa71a3295 ceph: use pagevec_lookup_range_nr_tag()
b44cc9e860 mm: add variant of pagevec_lookup_range_tag() taking number of pages
af44f89b90 mm: use pagevec_lookup_range_tag() in write_cache_pages()
a01f2023a8 mm: use pagevec_lookup_range_tag() in __filemap_fdatawait_range()
ed5739e31e nilfs2: use pagevec_lookup_range_tag()
95954b0dbb gfs2: use pagevec_lookup_range_tag()
8d62b4b25b f2fs: use find_get_pages_tag() for looking up single page
53f38f268a f2fs: simplify page iteration loops
b0310cc6e6 f2fs: use pagevec_lookup_range_tag()
e62fbfd6d4 ext4: use pagevec_lookup_range_tag()
1062214924 ceph: use pagevec_lookup_range_tag()
4b65630c0d btrfs: use pagevec_lookup_range_tag()
8e8455a68c mm: implement find_get_pages_range_tag()
a9a6eb48b7 f2fs: clean up with is_valid_blkaddr()
992fa7bd77 f2fs: fix to initialize min_mtime with ULLONG_MAX
9af9ec1b6c f2fs: fix to let checkpoint guarantee atomic page persistence
d5f8aab3ae f2fs: fix to initialize i_current_depth according to inode type
12dab4e61b Revert "f2fs: add ovp valid_blocks check for bg gc victim to fg_gc"
34f089c528 f2fs: don't drop any page on f2fs_cp_error() case
76dffc9986 f2fs: fix spelling mistake: "extenstion" -> "extension"
a5a897aabd f2fs: enhance sanity_check_raw_super() to avoid potential overflows
f0b5d76682 f2fs: treat volatile file's data as hot one
50644840d8 f2fs: introduce release_discard_addr() for cleanup
39b292a402 f2fs: fix potential overflow
76ddd4ff06 f2fs: rename dio_rwsem to i_gc_rwsem
c75638d5f5 f2fs: move mnt_want_write_file after range check
cc7e70c070 f2fs: fix missing clear FI_NO_PREALLOC in some error case
c9b3f46fd2 f2fs: enforce fsync_mode=strict for renamed directory
cbbd81cf17 f2fs: sanity check for total valid node blocks
bbd9c950fd f2fs: sanity check on sit entry
d921ced41c f2fs: avoid bug_on on corrupted inode
32c00c538e f2fs: give message and set need_fsck given broken node id
568765d739 f2fs: clean up commit_inmem_pages()
ac2074b52e f2fs: do not check F2FS_INLINE_DOTS in recover
1f14739160 f2fs: remove duplicated dquot_initialize and fix error handling
913efaeca9 f2fs: fix to detect failure of dquot_initialize
f60d3b8fcc f2fs: stop issue discard if something wrong with f2fs
4470ece5c0 f2fs: fix return value in f2fs_ioc_commit_atomic_write
318a9d5ae7 f2fs: allocate hot_data for atomic write more strictly
bd5f1c23a7 f2fs: check if inmem_pages list is empty correctly
2e405acc86 f2fs: fix race in between GC and atomic open
408e9720d8 f2fs: change le32 to le16 of f2fs_inode->i_extra_size
2f3cee5b22 f2fs: check cur_valid_map_mir & raw_sit block count when flush sit entries
8cd907eea5 f2fs: correct return value of f2fs_trim_fs
0be91d342a f2fs: fix to show missing bits in FS_IOC_GETFLAGS
dbfe915c2c f2fs: remove unneeded F2FS_PROJINHERIT_FL
ee8586bbd6 f2fs: don't use GFP_ZERO for page caches
50332ac97d f2fs: issue all big range discards in umount process
1c3ec702f0 f2fs: remove redundant block plug
694cd12fe9 f2fs: remove unmatched zero_user_segment when convert inline dentry
39c9aacbcd f2fs: introduce private inode status mapping
755a8a8a3b fscrypt: log the crypto algorithm implementations
e81950ade1 fscrypt: add Speck128/256 support
9637768c61 fscrypt: only derive the needed portion of the key
deba2007d2 fscrypt: separate key lookup from key derivation
04566cd682 fscrypt: use a common logging function
2a95469530 fscrypt: remove internal key size constants
fc161f4450 fscrypt: remove unnecessary check for non-logon key type
ab8345a11c fscrypt: make fscrypt_operations.max_namelen an integer
65702a6ef7 fscrypt: drop empty name check from fname_decrypt()
219e65410c fscrypt: drop max_namelen check from fname_decrypt()
ef1def58e2 fscrypt: don't special-case EOPNOTSUPP from fscrypt_get_encryption_info()
49ddcfcdd7 fscrypt: don't clear flags on crypto transform
ff8225b62c fscrypt: remove stale comment from fscrypt_d_revalidate()
712401bc77 fscrypt: remove error messages for skcipher_request_alloc() failure
6e4e39cc92 fscrypt: remove unnecessary NULL check when allocating skcipher
42b3feb2bd fscrypt: clean up after fscrypt_prepare_lookup() conversions
e43a072723 ubifs: switch to fscrypt_prepare_lookup()
f76b2cb673 ext4: switch to fscrypt_prepare_lookup()
fc30ddc3b0 fscrypt: use unbound workqueue for decryption

Change-Id: I3912aa38b2bf515ef8af8ed4945e54bc63945c86
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-10-19 13:57:20 -07:00

90 lines
2.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* include/linux/pagevec.h
*
* In many places it is efficient to batch an operation up against multiple
* pages. A pagevec is a multipage container which is used for that.
*/
#ifndef _LINUX_PAGEVEC_H
#define _LINUX_PAGEVEC_H
/* 14 pointers + two long's align the pagevec structure to a power of two */
#define PAGEVEC_SIZE 14
struct page;
struct address_space;
struct pagevec {
unsigned long nr;
unsigned long cold;
struct page *pages[PAGEVEC_SIZE];
};
void __pagevec_release(struct pagevec *pvec);
void __pagevec_lru_add(struct pagevec *pvec);
unsigned pagevec_lookup_entries(struct pagevec *pvec,
struct address_space *mapping,
pgoff_t start, unsigned nr_entries,
pgoff_t *indices);
void pagevec_remove_exceptionals(struct pagevec *pvec);
unsigned pagevec_lookup_range(struct pagevec *pvec,
struct address_space *mapping,
pgoff_t *start, pgoff_t end);
static inline unsigned pagevec_lookup(struct pagevec *pvec,
struct address_space *mapping,
pgoff_t *start)
{
return pagevec_lookup_range(pvec, mapping, start, (pgoff_t)-1);
}
unsigned pagevec_lookup_range_tag(struct pagevec *pvec,
struct address_space *mapping, pgoff_t *index, pgoff_t end,
int tag);
unsigned pagevec_lookup_range_nr_tag(struct pagevec *pvec,
struct address_space *mapping, pgoff_t *index, pgoff_t end,
int tag, unsigned max_pages);
static inline unsigned pagevec_lookup_tag(struct pagevec *pvec,
struct address_space *mapping, pgoff_t *index, int tag)
{
return pagevec_lookup_range_tag(pvec, mapping, index, (pgoff_t)-1, tag);
}
static inline void pagevec_init(struct pagevec *pvec, int cold)
{
pvec->nr = 0;
pvec->cold = cold;
}
static inline void pagevec_reinit(struct pagevec *pvec)
{
pvec->nr = 0;
}
static inline unsigned pagevec_count(struct pagevec *pvec)
{
return pvec->nr;
}
static inline unsigned pagevec_space(struct pagevec *pvec)
{
return PAGEVEC_SIZE - pvec->nr;
}
/*
* Add a page to a pagevec. Returns the number of slots still available.
*/
static inline unsigned pagevec_add(struct pagevec *pvec, struct page *page)
{
pvec->pages[pvec->nr++] = page;
return pagevec_space(pvec);
}
static inline void pagevec_release(struct pagevec *pvec)
{
if (pagevec_count(pvec))
__pagevec_release(pvec);
}
#endif /* _LINUX_PAGEVEC_H */