diff options
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r-- | fs/xfs/xfs_inode.h | 82 |
1 files changed, 17 insertions, 65 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 41555de1d1db..ec1f28c4fc4f 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h | |||
@@ -213,7 +213,6 @@ typedef struct xfs_icdinode { | |||
213 | 213 | ||
214 | struct bhv_desc; | 214 | struct bhv_desc; |
215 | struct cred; | 215 | struct cred; |
216 | struct ktrace; | ||
217 | struct xfs_buf; | 216 | struct xfs_buf; |
218 | struct xfs_bmap_free; | 217 | struct xfs_bmap_free; |
219 | struct xfs_bmbt_irec; | 218 | struct xfs_bmbt_irec; |
@@ -222,13 +221,6 @@ struct xfs_mount; | |||
222 | struct xfs_trans; | 221 | struct xfs_trans; |
223 | struct xfs_dquot; | 222 | struct xfs_dquot; |
224 | 223 | ||
225 | #if defined(XFS_ILOCK_TRACE) | ||
226 | #define XFS_ILOCK_KTRACE_SIZE 32 | ||
227 | extern void xfs_ilock_trace(struct xfs_inode *, int, unsigned int, inst_t *); | ||
228 | #else | ||
229 | #define xfs_ilock_trace(i,n,f,ra) | ||
230 | #endif | ||
231 | |||
232 | typedef struct dm_attrs_s { | 224 | typedef struct dm_attrs_s { |
233 | __uint32_t da_dmevmask; /* DMIG event mask */ | 225 | __uint32_t da_dmevmask; /* DMIG event mask */ |
234 | __uint16_t da_dmstate; /* DMIG state info */ | 226 | __uint16_t da_dmstate; /* DMIG state info */ |
@@ -271,26 +263,6 @@ typedef struct xfs_inode { | |||
271 | 263 | ||
272 | /* VFS inode */ | 264 | /* VFS inode */ |
273 | struct inode i_vnode; /* embedded VFS inode */ | 265 | struct inode i_vnode; /* embedded VFS inode */ |
274 | |||
275 | /* Trace buffers per inode. */ | ||
276 | #ifdef XFS_INODE_TRACE | ||
277 | struct ktrace *i_trace; /* general inode trace */ | ||
278 | #endif | ||
279 | #ifdef XFS_BMAP_TRACE | ||
280 | struct ktrace *i_xtrace; /* inode extent list trace */ | ||
281 | #endif | ||
282 | #ifdef XFS_BTREE_TRACE | ||
283 | struct ktrace *i_btrace; /* inode bmap btree trace */ | ||
284 | #endif | ||
285 | #ifdef XFS_RW_TRACE | ||
286 | struct ktrace *i_rwtrace; /* inode read/write trace */ | ||
287 | #endif | ||
288 | #ifdef XFS_ILOCK_TRACE | ||
289 | struct ktrace *i_lock_trace; /* inode lock/unlock trace */ | ||
290 | #endif | ||
291 | #ifdef XFS_DIR2_TRACE | ||
292 | struct ktrace *i_dir_trace; /* inode directory trace */ | ||
293 | #endif | ||
294 | } xfs_inode_t; | 266 | } xfs_inode_t; |
295 | 267 | ||
296 | #define XFS_ISIZE(ip) (((ip)->i_d.di_mode & S_IFMT) == S_IFREG) ? \ | 268 | #define XFS_ISIZE(ip) (((ip)->i_d.di_mode & S_IFMT) == S_IFREG) ? \ |
@@ -406,6 +378,14 @@ static inline void xfs_ifunlock(xfs_inode_t *ip) | |||
406 | #define XFS_LOCK_MASK (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \ | 378 | #define XFS_LOCK_MASK (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED \ |
407 | | XFS_ILOCK_EXCL | XFS_ILOCK_SHARED) | 379 | | XFS_ILOCK_EXCL | XFS_ILOCK_SHARED) |
408 | 380 | ||
381 | #define XFS_LOCK_FLAGS \ | ||
382 | { XFS_IOLOCK_EXCL, "IOLOCK_EXCL" }, \ | ||
383 | { XFS_IOLOCK_SHARED, "IOLOCK_SHARED" }, \ | ||
384 | { XFS_ILOCK_EXCL, "ILOCK_EXCL" }, \ | ||
385 | { XFS_ILOCK_SHARED, "ILOCK_SHARED" }, \ | ||
386 | { XFS_IUNLOCK_NONOTIFY, "IUNLOCK_NONOTIFY" } | ||
387 | |||
388 | |||
409 | /* | 389 | /* |
410 | * Flags for lockdep annotations. | 390 | * Flags for lockdep annotations. |
411 | * | 391 | * |
@@ -455,6 +435,10 @@ static inline void xfs_ifunlock(xfs_inode_t *ip) | |||
455 | #define XFS_ITRUNC_DEFINITE 0x1 | 435 | #define XFS_ITRUNC_DEFINITE 0x1 |
456 | #define XFS_ITRUNC_MAYBE 0x2 | 436 | #define XFS_ITRUNC_MAYBE 0x2 |
457 | 437 | ||
438 | #define XFS_ITRUNC_FLAGS \ | ||
439 | { XFS_ITRUNC_DEFINITE, "DEFINITE" }, \ | ||
440 | { XFS_ITRUNC_MAYBE, "MAYBE" } | ||
441 | |||
458 | /* | 442 | /* |
459 | * For multiple groups support: if S_ISGID bit is set in the parent | 443 | * For multiple groups support: if S_ISGID bit is set in the parent |
460 | * directory, group of new file is set to that of the parent, and | 444 | * directory, group of new file is set to that of the parent, and |
@@ -507,48 +491,16 @@ void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); | |||
507 | void xfs_synchronize_times(xfs_inode_t *); | 491 | void xfs_synchronize_times(xfs_inode_t *); |
508 | void xfs_mark_inode_dirty_sync(xfs_inode_t *); | 492 | void xfs_mark_inode_dirty_sync(xfs_inode_t *); |
509 | 493 | ||
510 | #if defined(XFS_INODE_TRACE) | ||
511 | |||
512 | #define INODE_TRACE_SIZE 16 /* number of trace entries */ | ||
513 | #define INODE_KTRACE_ENTRY 1 | ||
514 | #define INODE_KTRACE_EXIT 2 | ||
515 | #define INODE_KTRACE_HOLD 3 | ||
516 | #define INODE_KTRACE_REF 4 | ||
517 | #define INODE_KTRACE_RELE 5 | ||
518 | |||
519 | extern void _xfs_itrace_entry(struct xfs_inode *, const char *, inst_t *); | ||
520 | extern void _xfs_itrace_exit(struct xfs_inode *, const char *, inst_t *); | ||
521 | extern void xfs_itrace_hold(struct xfs_inode *, char *, int, inst_t *); | ||
522 | extern void _xfs_itrace_ref(struct xfs_inode *, char *, int, inst_t *); | ||
523 | extern void xfs_itrace_rele(struct xfs_inode *, char *, int, inst_t *); | ||
524 | #define xfs_itrace_entry(ip) \ | ||
525 | _xfs_itrace_entry(ip, __func__, (inst_t *)__return_address) | ||
526 | #define xfs_itrace_exit(ip) \ | ||
527 | _xfs_itrace_exit(ip, __func__, (inst_t *)__return_address) | ||
528 | #define xfs_itrace_exit_tag(ip, tag) \ | ||
529 | _xfs_itrace_exit(ip, tag, (inst_t *)__return_address) | ||
530 | #define xfs_itrace_ref(ip) \ | ||
531 | _xfs_itrace_ref(ip, __FILE__, __LINE__, (inst_t *)__return_address) | ||
532 | |||
533 | #else | ||
534 | #define xfs_itrace_entry(a) | ||
535 | #define xfs_itrace_exit(a) | ||
536 | #define xfs_itrace_exit_tag(a, b) | ||
537 | #define xfs_itrace_hold(a, b, c, d) | ||
538 | #define xfs_itrace_ref(a) | ||
539 | #define xfs_itrace_rele(a, b, c, d) | ||
540 | #endif | ||
541 | |||
542 | #define IHOLD(ip) \ | 494 | #define IHOLD(ip) \ |
543 | do { \ | 495 | do { \ |
544 | ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \ | 496 | ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \ |
545 | atomic_inc(&(VFS_I(ip)->i_count)); \ | 497 | atomic_inc(&(VFS_I(ip)->i_count)); \ |
546 | xfs_itrace_hold((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ | 498 | trace_xfs_ihold(ip, _THIS_IP_); \ |
547 | } while (0) | 499 | } while (0) |
548 | 500 | ||
549 | #define IRELE(ip) \ | 501 | #define IRELE(ip) \ |
550 | do { \ | 502 | do { \ |
551 | xfs_itrace_rele((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ | 503 | trace_xfs_irele(ip, _THIS_IP_); \ |
552 | iput(VFS_I(ip)); \ | 504 | iput(VFS_I(ip)); \ |
553 | } while (0) | 505 | } while (0) |
554 | 506 | ||
@@ -577,11 +529,11 @@ int xfs_iread_extents(struct xfs_trans *, struct xfs_inode *, int); | |||
577 | int xfs_iextents_copy(struct xfs_inode *, xfs_bmbt_rec_t *, int); | 529 | int xfs_iextents_copy(struct xfs_inode *, xfs_bmbt_rec_t *, int); |
578 | 530 | ||
579 | xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); | 531 | xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); |
580 | void xfs_iext_insert(xfs_ifork_t *, xfs_extnum_t, xfs_extnum_t, | 532 | void xfs_iext_insert(xfs_inode_t *, xfs_extnum_t, xfs_extnum_t, |
581 | xfs_bmbt_irec_t *); | 533 | xfs_bmbt_irec_t *, int); |
582 | void xfs_iext_add(xfs_ifork_t *, xfs_extnum_t, int); | 534 | void xfs_iext_add(xfs_ifork_t *, xfs_extnum_t, int); |
583 | void xfs_iext_add_indirect_multi(xfs_ifork_t *, int, xfs_extnum_t, int); | 535 | void xfs_iext_add_indirect_multi(xfs_ifork_t *, int, xfs_extnum_t, int); |
584 | void xfs_iext_remove(xfs_ifork_t *, xfs_extnum_t, int); | 536 | void xfs_iext_remove(xfs_inode_t *, xfs_extnum_t, int, int); |
585 | void xfs_iext_remove_inline(xfs_ifork_t *, xfs_extnum_t, int); | 537 | void xfs_iext_remove_inline(xfs_ifork_t *, xfs_extnum_t, int); |
586 | void xfs_iext_remove_direct(xfs_ifork_t *, xfs_extnum_t, int); | 538 | void xfs_iext_remove_direct(xfs_ifork_t *, xfs_extnum_t, int); |
587 | void xfs_iext_remove_indirect(xfs_ifork_t *, xfs_extnum_t, int); | 539 | void xfs_iext_remove_indirect(xfs_ifork_t *, xfs_extnum_t, int); |