aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mount.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mount.h')
-rw-r--r--include/linux/mount.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 51f55f903aff..5d5275364867 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -30,7 +30,7 @@ struct mnt_namespace;
30#define MNT_STRICTATIME 0x80 30#define MNT_STRICTATIME 0x80
31 31
32#define MNT_SHRINKABLE 0x100 32#define MNT_SHRINKABLE 0x100
33#define MNT_IMBALANCED_WRITE_COUNT 0x200 /* just for debugging */ 33#define MNT_WRITE_HOLD 0x200
34 34
35#define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */ 35#define MNT_SHARED 0x1000 /* if the vfsmount is a shared mount */
36#define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */ 36#define MNT_UNBINDABLE 0x2000 /* if the vfsmount is a unbindable mount */
@@ -65,13 +65,22 @@ struct vfsmount {
65 int mnt_expiry_mark; /* true if marked for expiry */ 65 int mnt_expiry_mark; /* true if marked for expiry */
66 int mnt_pinned; 66 int mnt_pinned;
67 int mnt_ghosts; 67 int mnt_ghosts;
68 /* 68#ifdef CONFIG_SMP
69 * This value is not stable unless all of the mnt_writers[] spinlocks 69 int *mnt_writers;
70 * are held, and all mnt_writer[]s on this mount have 0 as their ->count 70#else
71 */ 71 int mnt_writers;
72 atomic_t __mnt_writers; 72#endif
73}; 73};
74 74
75static inline int *get_mnt_writers_ptr(struct vfsmount *mnt)
76{
77#ifdef CONFIG_SMP
78 return mnt->mnt_writers;
79#else
80 return &mnt->mnt_writers;
81#endif
82}
83
75static inline struct vfsmount *mntget(struct vfsmount *mnt) 84static inline struct vfsmount *mntget(struct vfsmount *mnt)
76{ 85{
77 if (mnt) 86 if (mnt)
@@ -79,7 +88,11 @@ static inline struct vfsmount *mntget(struct vfsmount *mnt)
79 return mnt; 88 return mnt;
80} 89}
81 90
91struct file; /* forward dec */
92
82extern int mnt_want_write(struct vfsmount *mnt); 93extern int mnt_want_write(struct vfsmount *mnt);
94extern int mnt_want_write_file(struct file *file);
95extern int mnt_clone_write(struct vfsmount *mnt);
83extern void mnt_drop_write(struct vfsmount *mnt); 96extern void mnt_drop_write(struct vfsmount *mnt);
84extern void mntput_no_expire(struct vfsmount *mnt); 97extern void mntput_no_expire(struct vfsmount *mnt);
85extern void mnt_pin(struct vfsmount *mnt); 98extern void mnt_pin(struct vfsmount *mnt);