diff options
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r-- | fs/xfs/xfs_inode.h | 96 |
1 files changed, 19 insertions, 77 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 41555de1d1db..9965e40a4615 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 | * |
@@ -440,21 +420,15 @@ static inline void xfs_ifunlock(xfs_inode_t *ip) | |||
440 | #define XFS_ILOCK_DEP(flags) (((flags) & XFS_ILOCK_DEP_MASK) >> XFS_ILOCK_SHIFT) | 420 | #define XFS_ILOCK_DEP(flags) (((flags) & XFS_ILOCK_DEP_MASK) >> XFS_ILOCK_SHIFT) |
441 | 421 | ||
442 | /* | 422 | /* |
443 | * Flags for xfs_iflush() | ||
444 | */ | ||
445 | #define XFS_IFLUSH_DELWRI_ELSE_SYNC 1 | ||
446 | #define XFS_IFLUSH_DELWRI_ELSE_ASYNC 2 | ||
447 | #define XFS_IFLUSH_SYNC 3 | ||
448 | #define XFS_IFLUSH_ASYNC 4 | ||
449 | #define XFS_IFLUSH_DELWRI 5 | ||
450 | #define XFS_IFLUSH_ASYNC_NOBLOCK 6 | ||
451 | |||
452 | /* | ||
453 | * Flags for xfs_itruncate_start(). | 423 | * Flags for xfs_itruncate_start(). |
454 | */ | 424 | */ |
455 | #define XFS_ITRUNC_DEFINITE 0x1 | 425 | #define XFS_ITRUNC_DEFINITE 0x1 |
456 | #define XFS_ITRUNC_MAYBE 0x2 | 426 | #define XFS_ITRUNC_MAYBE 0x2 |
457 | 427 | ||
428 | #define XFS_ITRUNC_FLAGS \ | ||
429 | { XFS_ITRUNC_DEFINITE, "DEFINITE" }, \ | ||
430 | { XFS_ITRUNC_MAYBE, "MAYBE" } | ||
431 | |||
458 | /* | 432 | /* |
459 | * For multiple groups support: if S_ISGID bit is set in the parent | 433 | * 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 | 434 | * directory, group of new file is set to that of the parent, and |
@@ -497,58 +471,26 @@ int xfs_itruncate_finish(struct xfs_trans **, xfs_inode_t *, | |||
497 | int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); | 471 | int xfs_iunlink(struct xfs_trans *, xfs_inode_t *); |
498 | 472 | ||
499 | void xfs_iext_realloc(xfs_inode_t *, int, int); | 473 | void xfs_iext_realloc(xfs_inode_t *, int, int); |
500 | void xfs_ipin(xfs_inode_t *); | 474 | void xfs_iunpin_wait(xfs_inode_t *); |
501 | void xfs_iunpin(xfs_inode_t *); | ||
502 | int xfs_iflush(xfs_inode_t *, uint); | 475 | int xfs_iflush(xfs_inode_t *, uint); |
503 | void xfs_ichgtime(xfs_inode_t *, int); | 476 | void xfs_ichgtime(xfs_inode_t *, int); |
504 | void xfs_lock_inodes(xfs_inode_t **, int, uint); | 477 | void xfs_lock_inodes(xfs_inode_t **, int, uint); |
505 | void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); | 478 | void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); |
506 | 479 | ||
507 | void xfs_synchronize_times(xfs_inode_t *); | 480 | void xfs_synchronize_times(xfs_inode_t *); |
481 | void xfs_mark_inode_dirty(xfs_inode_t *); | ||
508 | void xfs_mark_inode_dirty_sync(xfs_inode_t *); | 482 | void xfs_mark_inode_dirty_sync(xfs_inode_t *); |
509 | 483 | ||
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) \ | 484 | #define IHOLD(ip) \ |
543 | do { \ | 485 | do { \ |
544 | ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \ | 486 | ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \ |
545 | atomic_inc(&(VFS_I(ip)->i_count)); \ | 487 | atomic_inc(&(VFS_I(ip)->i_count)); \ |
546 | xfs_itrace_hold((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ | 488 | trace_xfs_ihold(ip, _THIS_IP_); \ |
547 | } while (0) | 489 | } while (0) |
548 | 490 | ||
549 | #define IRELE(ip) \ | 491 | #define IRELE(ip) \ |
550 | do { \ | 492 | do { \ |
551 | xfs_itrace_rele((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ | 493 | trace_xfs_irele(ip, _THIS_IP_); \ |
552 | iput(VFS_I(ip)); \ | 494 | iput(VFS_I(ip)); \ |
553 | } while (0) | 495 | } while (0) |
554 | 496 | ||
@@ -577,11 +519,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); | 519 | int xfs_iextents_copy(struct xfs_inode *, xfs_bmbt_rec_t *, int); |
578 | 520 | ||
579 | xfs_bmbt_rec_host_t *xfs_iext_get_ext(xfs_ifork_t *, xfs_extnum_t); | 521 | 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, | 522 | void xfs_iext_insert(xfs_inode_t *, xfs_extnum_t, xfs_extnum_t, |
581 | xfs_bmbt_irec_t *); | 523 | xfs_bmbt_irec_t *, int); |
582 | void xfs_iext_add(xfs_ifork_t *, xfs_extnum_t, int); | 524 | 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); | 525 | 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); | 526 | 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); | 527 | 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); | 528 | 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); | 529 | void xfs_iext_remove_indirect(xfs_ifork_t *, xfs_extnum_t, int); |