diff options
author | Dave Chinner <david@fromorbit.com> | 2015-02-23 18:27:47 -0500 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2015-02-23 18:27:47 -0500 |
commit | 88e8fda99a4c99a1a6482510655dbd88cccd221b (patch) | |
tree | b5f10ecc7c99ebf3eeb7a6733c15d3930b5f8a63 /fs/xfs/xfs_inode.h | |
parent | 4225441a1eec45241efe529d23403d8ca3d1d71b (diff) | |
parent | 723cac48473358939759885a18e8df113ea96138 (diff) |
Merge branch 'xfs-mmap-lock' into for-next
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r-- | fs/xfs/xfs_inode.h | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index c73b63d51bc1..8f22d20368d8 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -56,6 +56,7 @@ typedef struct xfs_inode { | |||
56 | struct xfs_inode_log_item *i_itemp; /* logging information */ | 56 | struct xfs_inode_log_item *i_itemp; /* logging information */ |
57 | mrlock_t i_lock; /* inode lock */ | 57 | mrlock_t i_lock; /* inode lock */ |
58 | mrlock_t i_iolock; /* inode IO lock */ | 58 | mrlock_t i_iolock; /* inode IO lock */ |
59 | mrlock_t i_mmaplock; /* inode mmap IO lock */ | ||
59 | atomic_t i_pincount; /* inode pin count */ | 60 | atomic_t i_pincount; /* inode pin count */ |
60 | spinlock_t i_flags_lock; /* inode i_flags lock */ | 61 | spinlock_t i_flags_lock; /* inode i_flags lock */ |
61 | /* Miscellaneous state. */ | 62 | /* Miscellaneous state. */ |
@@ -263,15 +264,20 @@ static inline int xfs_isiflocked(struct xfs_inode *ip) | |||
263 | #define XFS_IOLOCK_SHARED (1<<1) | 264 | #define XFS_IOLOCK_SHARED (1<<1) |
264 | #define XFS_ILOCK_EXCL (1<<2) | 265 | #define XFS_ILOCK_EXCL (1<<2) |
265 | #define XFS_ILOCK_SHARED (1<<3) | 266 | #define XFS_ILOCK_SHARED (1<<3) |
267 | #define XFS_MMAPLOCK_EXCL (1<<4) | ||
268 | #define XFS_MMAPLOCK_SHARED (1<<5) | ||
266 | 269 | ||
267 | #define XFS_LOCK_MASK (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \ | 270 | #define XFS_LOCK_MASK (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \ |
268 | | XFS_ILOCK_EXCL | XFS_ILOCK_SHARED) | 271 | | XFS_ILOCK_EXCL | XFS_ILOCK_SHARED \ |
272 | | XFS_MMAPLOCK_EXCL | XFS_MMAPLOCK_SHARED) | ||
269 | 273 | ||
270 | #define XFS_LOCK_FLAGS \ | 274 | #define XFS_LOCK_FLAGS \ |
271 | { XFS_IOLOCK_EXCL, "IOLOCK_EXCL" }, \ | 275 | { XFS_IOLOCK_EXCL, "IOLOCK_EXCL" }, \ |
272 | { XFS_IOLOCK_SHARED, "IOLOCK_SHARED" }, \ | 276 | { XFS_IOLOCK_SHARED, "IOLOCK_SHARED" }, \ |
273 | { XFS_ILOCK_EXCL, "ILOCK_EXCL" }, \ | 277 | { XFS_ILOCK_EXCL, "ILOCK_EXCL" }, \ |
274 | { XFS_ILOCK_SHARED, "ILOCK_SHARED" } | 278 | { XFS_ILOCK_SHARED, "ILOCK_SHARED" }, \ |
279 | { XFS_MMAPLOCK_EXCL, "MMAPLOCK_EXCL" }, \ | ||
280 | { XFS_MMAPLOCK_SHARED, "MMAPLOCK_SHARED" } | ||
275 | 281 | ||
276 | 282 | ||
277 | /* | 283 | /* |
@@ -302,17 +308,26 @@ static inline int xfs_isiflocked(struct xfs_inode *ip) | |||
302 | #define XFS_IOLOCK_SHIFT 16 | 308 | #define XFS_IOLOCK_SHIFT 16 |
303 | #define XFS_IOLOCK_PARENT (XFS_LOCK_PARENT << XFS_IOLOCK_SHIFT) | 309 | #define XFS_IOLOCK_PARENT (XFS_LOCK_PARENT << XFS_IOLOCK_SHIFT) |
304 | 310 | ||
311 | #define XFS_MMAPLOCK_SHIFT 20 | ||
312 | |||
305 | #define XFS_ILOCK_SHIFT 24 | 313 | #define XFS_ILOCK_SHIFT 24 |
306 | #define XFS_ILOCK_PARENT (XFS_LOCK_PARENT << XFS_ILOCK_SHIFT) | 314 | #define XFS_ILOCK_PARENT (XFS_LOCK_PARENT << XFS_ILOCK_SHIFT) |
307 | #define XFS_ILOCK_RTBITMAP (XFS_LOCK_RTBITMAP << XFS_ILOCK_SHIFT) | 315 | #define XFS_ILOCK_RTBITMAP (XFS_LOCK_RTBITMAP << XFS_ILOCK_SHIFT) |
308 | #define XFS_ILOCK_RTSUM (XFS_LOCK_RTSUM << XFS_ILOCK_SHIFT) | 316 | #define XFS_ILOCK_RTSUM (XFS_LOCK_RTSUM << XFS_ILOCK_SHIFT) |
309 | 317 | ||
310 | #define XFS_IOLOCK_DEP_MASK 0x00ff0000 | 318 | #define XFS_IOLOCK_DEP_MASK 0x000f0000 |
319 | #define XFS_MMAPLOCK_DEP_MASK 0x00f00000 | ||
311 | #define XFS_ILOCK_DEP_MASK 0xff000000 | 320 | #define XFS_ILOCK_DEP_MASK 0xff000000 |
312 | #define XFS_LOCK_DEP_MASK (XFS_IOLOCK_DEP_MASK | XFS_ILOCK_DEP_MASK) | 321 | #define XFS_LOCK_DEP_MASK (XFS_IOLOCK_DEP_MASK | \ |
313 | 322 | XFS_MMAPLOCK_DEP_MASK | \ | |
314 | #define XFS_IOLOCK_DEP(flags) (((flags) & XFS_IOLOCK_DEP_MASK) >> XFS_IOLOCK_SHIFT) | 323 | XFS_ILOCK_DEP_MASK) |
315 | #define XFS_ILOCK_DEP(flags) (((flags) & XFS_ILOCK_DEP_MASK) >> XFS_ILOCK_SHIFT) | 324 | |
325 | #define XFS_IOLOCK_DEP(flags) (((flags) & XFS_IOLOCK_DEP_MASK) \ | ||
326 | >> XFS_IOLOCK_SHIFT) | ||
327 | #define XFS_MMAPLOCK_DEP(flags) (((flags) & XFS_MMAPLOCK_DEP_MASK) \ | ||
328 | >> XFS_MMAPLOCK_SHIFT) | ||
329 | #define XFS_ILOCK_DEP(flags) (((flags) & XFS_ILOCK_DEP_MASK) \ | ||
330 | >> XFS_ILOCK_SHIFT) | ||
316 | 331 | ||
317 | /* | 332 | /* |
318 | * For multiple groups support: if S_ISGID bit is set in the parent | 333 | * For multiple groups support: if S_ISGID bit is set in the parent |