diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-24 19:10:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-09-24 19:10:23 -0400 |
commit | 9c9fa97a8edbc3668dfc7a25de516e80c146e86f (patch) | |
tree | 2dc0e90203796a4b346ce190f9521c3294104058 /include/linux/fs.h | |
parent | 5184d449600f501a8688069f35c138c6b3bf8b94 (diff) | |
parent | 2b38d01b4de8b1bbda7f5f7e91252609557635fc (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge updates from Andrew Morton:
- a few hot fixes
- ocfs2 updates
- almost all of -mm (slab-generic, slab, slub, kmemleak, kasan,
cleanups, debug, pagecache, memcg, gup, pagemap, memory-hotplug,
sparsemem, vmalloc, initialization, z3fold, compaction, mempolicy,
oom-kill, hugetlb, migration, thp, mmap, madvise, shmem, zswap,
zsmalloc)
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (132 commits)
mm/zsmalloc.c: fix a -Wunused-function warning
zswap: do not map same object twice
zswap: use movable memory if zpool support allocate movable memory
zpool: add malloc_support_movable to zpool_driver
shmem: fix obsolete comment in shmem_getpage_gfp()
mm/madvise: reduce code duplication in error handling paths
mm: mmap: increase sockets maximum memory size pgoff for 32bits
mm/mmap.c: refine find_vma_prev() with rb_last()
riscv: make mmap allocation top-down by default
mips: use generic mmap top-down layout and brk randomization
mips: replace arch specific way to determine 32bit task with generic version
mips: adjust brk randomization offset to fit generic version
mips: use STACK_TOP when computing mmap base address
mips: properly account for stack randomization and stack guard gap
arm: use generic mmap top-down layout and brk randomization
arm: use STACK_TOP when computing mmap base address
arm: properly account for stack randomization and stack guard gap
arm64, mm: make randomization selected by generic topdown mmap layout
arm64, mm: move generic mmap layout functions to mm
arm64: consider stack randomization for mmap base only when necessary
...
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index 866268c2c6e3..b0c6b0d34d02 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -429,6 +429,7 @@ int pagecache_write_end(struct file *, struct address_space *mapping, | |||
429 | * @i_pages: Cached pages. | 429 | * @i_pages: Cached pages. |
430 | * @gfp_mask: Memory allocation flags to use for allocating pages. | 430 | * @gfp_mask: Memory allocation flags to use for allocating pages. |
431 | * @i_mmap_writable: Number of VM_SHARED mappings. | 431 | * @i_mmap_writable: Number of VM_SHARED mappings. |
432 | * @nr_thps: Number of THPs in the pagecache (non-shmem only). | ||
432 | * @i_mmap: Tree of private and shared mappings. | 433 | * @i_mmap: Tree of private and shared mappings. |
433 | * @i_mmap_rwsem: Protects @i_mmap and @i_mmap_writable. | 434 | * @i_mmap_rwsem: Protects @i_mmap and @i_mmap_writable. |
434 | * @nrpages: Number of page entries, protected by the i_pages lock. | 435 | * @nrpages: Number of page entries, protected by the i_pages lock. |
@@ -446,6 +447,10 @@ struct address_space { | |||
446 | struct xarray i_pages; | 447 | struct xarray i_pages; |
447 | gfp_t gfp_mask; | 448 | gfp_t gfp_mask; |
448 | atomic_t i_mmap_writable; | 449 | atomic_t i_mmap_writable; |
450 | #ifdef CONFIG_READ_ONLY_THP_FOR_FS | ||
451 | /* number of thp, only for non-shmem files */ | ||
452 | atomic_t nr_thps; | ||
453 | #endif | ||
449 | struct rb_root_cached i_mmap; | 454 | struct rb_root_cached i_mmap; |
450 | struct rw_semaphore i_mmap_rwsem; | 455 | struct rw_semaphore i_mmap_rwsem; |
451 | unsigned long nrpages; | 456 | unsigned long nrpages; |
@@ -2798,6 +2803,33 @@ static inline errseq_t filemap_sample_wb_err(struct address_space *mapping) | |||
2798 | return errseq_sample(&mapping->wb_err); | 2803 | return errseq_sample(&mapping->wb_err); |
2799 | } | 2804 | } |
2800 | 2805 | ||
2806 | static inline int filemap_nr_thps(struct address_space *mapping) | ||
2807 | { | ||
2808 | #ifdef CONFIG_READ_ONLY_THP_FOR_FS | ||
2809 | return atomic_read(&mapping->nr_thps); | ||
2810 | #else | ||
2811 | return 0; | ||
2812 | #endif | ||
2813 | } | ||
2814 | |||
2815 | static inline void filemap_nr_thps_inc(struct address_space *mapping) | ||
2816 | { | ||
2817 | #ifdef CONFIG_READ_ONLY_THP_FOR_FS | ||
2818 | atomic_inc(&mapping->nr_thps); | ||
2819 | #else | ||
2820 | WARN_ON_ONCE(1); | ||
2821 | #endif | ||
2822 | } | ||
2823 | |||
2824 | static inline void filemap_nr_thps_dec(struct address_space *mapping) | ||
2825 | { | ||
2826 | #ifdef CONFIG_READ_ONLY_THP_FOR_FS | ||
2827 | atomic_dec(&mapping->nr_thps); | ||
2828 | #else | ||
2829 | WARN_ON_ONCE(1); | ||
2830 | #endif | ||
2831 | } | ||
2832 | |||
2801 | extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end, | 2833 | extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end, |
2802 | int datasync); | 2834 | int datasync); |
2803 | extern int vfs_fsync(struct file *file, int datasync); | 2835 | extern int vfs_fsync(struct file *file, int datasync); |