summaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorMatthew Wilcox <mawilcox@microsoft.com>2018-04-10 19:36:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-11 13:28:39 -0400
commitb93b016313b3ba8003c3b8bb71f569af91f19fc7 (patch)
treead4be96414189dcdf8c972f351ba430996e9fdff /include/linux/fs.h
parentf6bb2a2c0b81c47282ddb7883f92e65a063c27dd (diff)
page cache: use xa_lock
Remove the address_space ->tree_lock and use the xa_lock newly added to the radix_tree_root. Rename the address_space ->page_tree to ->i_pages, since we don't really care that it's a tree. [willy@infradead.org: fix nds32, fs/dax.c] Link: http://lkml.kernel.org/r/20180406145415.GB20605@bombadil.infradead.orgLink: http://lkml.kernel.org/r/20180313132639.17387-9-willy@infradead.org Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com> Acked-by: Jeff Layton <jlayton@redhat.com> Cc: Darrick J. Wong <darrick.wong@oracle.com> Cc: Dave Chinner <david@fromorbit.com> Cc: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Cc: Will Deacon <will.deacon@arm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2aa02cad94d4..92efaf1f8977 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -13,6 +13,7 @@
13#include <linux/list_lru.h> 13#include <linux/list_lru.h>
14#include <linux/llist.h> 14#include <linux/llist.h>
15#include <linux/radix-tree.h> 15#include <linux/radix-tree.h>
16#include <linux/xarray.h>
16#include <linux/rbtree.h> 17#include <linux/rbtree.h>
17#include <linux/init.h> 18#include <linux/init.h>
18#include <linux/pid.h> 19#include <linux/pid.h>
@@ -390,12 +391,11 @@ int pagecache_write_end(struct file *, struct address_space *mapping,
390 391
391struct address_space { 392struct address_space {
392 struct inode *host; /* owner: inode, block_device */ 393 struct inode *host; /* owner: inode, block_device */
393 struct radix_tree_root page_tree; /* radix tree of all pages */ 394 struct radix_tree_root i_pages; /* cached pages */
394 spinlock_t tree_lock; /* and lock protecting it */
395 atomic_t i_mmap_writable;/* count VM_SHARED mappings */ 395 atomic_t i_mmap_writable;/* count VM_SHARED mappings */
396 struct rb_root_cached i_mmap; /* tree of private and shared mappings */ 396 struct rb_root_cached i_mmap; /* tree of private and shared mappings */
397 struct rw_semaphore i_mmap_rwsem; /* protect tree, count, list */ 397 struct rw_semaphore i_mmap_rwsem; /* protect tree, count, list */
398 /* Protected by tree_lock together with the radix tree */ 398 /* Protected by the i_pages lock */
399 unsigned long nrpages; /* number of total pages */ 399 unsigned long nrpages; /* number of total pages */
400 /* number of shadow or DAX exceptional entries */ 400 /* number of shadow or DAX exceptional entries */
401 unsigned long nrexceptional; 401 unsigned long nrexceptional;
@@ -1989,7 +1989,7 @@ static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
1989 * 1989 *
1990 * I_WB_SWITCH Cgroup bdi_writeback switching in progress. Used to 1990 * I_WB_SWITCH Cgroup bdi_writeback switching in progress. Used to
1991 * synchronize competing switching instances and to tell 1991 * synchronize competing switching instances and to tell
1992 * wb stat updates to grab mapping->tree_lock. See 1992 * wb stat updates to grab the i_pages lock. See
1993 * inode_switch_wb_work_fn() for details. 1993 * inode_switch_wb_work_fn() for details.
1994 * 1994 *
1995 * I_OVL_INUSE Used by overlayfs to get exclusive ownership on upper 1995 * I_OVL_INUSE Used by overlayfs to get exclusive ownership on upper