aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index bb29b02d9bb6..4193a0bd99b0 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -18,6 +18,7 @@
18#include <linux/pid.h> 18#include <linux/pid.h>
19#include <linux/bug.h> 19#include <linux/bug.h>
20#include <linux/mutex.h> 20#include <linux/mutex.h>
21#include <linux/rwsem.h>
21#include <linux/capability.h> 22#include <linux/capability.h>
22#include <linux/semaphore.h> 23#include <linux/semaphore.h>
23#include <linux/fiemap.h> 24#include <linux/fiemap.h>
@@ -401,7 +402,7 @@ struct address_space {
401 atomic_t i_mmap_writable;/* count VM_SHARED mappings */ 402 atomic_t i_mmap_writable;/* count VM_SHARED mappings */
402 struct rb_root i_mmap; /* tree of private and shared mappings */ 403 struct rb_root i_mmap; /* tree of private and shared mappings */
403 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ 404 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
404 struct mutex i_mmap_mutex; /* protect tree, count, list */ 405 struct rw_semaphore i_mmap_rwsem; /* protect tree, count, list */
405 /* Protected by tree_lock together with the radix tree */ 406 /* Protected by tree_lock together with the radix tree */
406 unsigned long nrpages; /* number of total pages */ 407 unsigned long nrpages; /* number of total pages */
407 unsigned long nrshadows; /* number of shadow entries */ 408 unsigned long nrshadows; /* number of shadow entries */
@@ -467,6 +468,26 @@ struct block_device {
467 468
468int mapping_tagged(struct address_space *mapping, int tag); 469int mapping_tagged(struct address_space *mapping, int tag);
469 470
471static inline void i_mmap_lock_write(struct address_space *mapping)
472{
473 down_write(&mapping->i_mmap_rwsem);
474}
475
476static inline void i_mmap_unlock_write(struct address_space *mapping)
477{
478 up_write(&mapping->i_mmap_rwsem);
479}
480
481static inline void i_mmap_lock_read(struct address_space *mapping)
482{
483 down_read(&mapping->i_mmap_rwsem);
484}
485
486static inline void i_mmap_unlock_read(struct address_space *mapping)
487{
488 up_read(&mapping->i_mmap_rwsem);
489}
490
470/* 491/*
471 * Might pages of this file be mapped into userspace? 492 * Might pages of this file be mapped into userspace?
472 */ 493 */
@@ -2075,6 +2096,7 @@ extern int vfs_open(const struct path *, struct file *, const struct cred *);
2075extern struct file * dentry_open(const struct path *, int, const struct cred *); 2096extern struct file * dentry_open(const struct path *, int, const struct cred *);
2076extern int filp_close(struct file *, fl_owner_t id); 2097extern int filp_close(struct file *, fl_owner_t id);
2077 2098
2099extern struct filename *getname_flags(const char __user *, int, int *);
2078extern struct filename *getname(const char __user *); 2100extern struct filename *getname(const char __user *);
2079extern struct filename *getname_kernel(const char *); 2101extern struct filename *getname_kernel(const char *);
2080 2102