diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_vnode.h')
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 0fe2419461d6..06f5845e9568 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
| @@ -116,8 +116,14 @@ typedef enum { | |||
| 116 | /* | 116 | /* |
| 117 | * Vnode to Linux inode mapping. | 117 | * Vnode to Linux inode mapping. |
| 118 | */ | 118 | */ |
| 119 | #define LINVFS_GET_VP(inode) ((vnode_t *)list_entry(inode, vnode_t, v_inode)) | 119 | static inline struct vnode *vn_from_inode(struct inode *inode) |
| 120 | #define LINVFS_GET_IP(vp) (&(vp)->v_inode) | 120 | { |
| 121 | return (vnode_t *)list_entry(inode, vnode_t, v_inode); | ||
| 122 | } | ||
| 123 | static inline struct inode *vn_to_inode(struct vnode *vnode) | ||
| 124 | { | ||
| 125 | return &vnode->v_inode; | ||
| 126 | } | ||
| 121 | 127 | ||
| 122 | /* | 128 | /* |
| 123 | * Vnode flags. | 129 | * Vnode flags. |
| @@ -490,6 +496,7 @@ typedef struct vnode_map { | |||
| 490 | (vmap).v_ino = (vp)->v_inode.i_ino; } | 496 | (vmap).v_ino = (vp)->v_inode.i_ino; } |
| 491 | 497 | ||
| 492 | extern int vn_revalidate(struct vnode *); | 498 | extern int vn_revalidate(struct vnode *); |
| 499 | extern int __vn_revalidate(struct vnode *, vattr_t *); | ||
| 493 | extern void vn_revalidate_core(struct vnode *, vattr_t *); | 500 | extern void vn_revalidate_core(struct vnode *, vattr_t *); |
| 494 | 501 | ||
| 495 | extern void vn_iowait(struct vnode *vp); | 502 | extern void vn_iowait(struct vnode *vp); |
| @@ -497,7 +504,7 @@ extern void vn_iowake(struct vnode *vp); | |||
| 497 | 504 | ||
| 498 | static inline int vn_count(struct vnode *vp) | 505 | static inline int vn_count(struct vnode *vp) |
| 499 | { | 506 | { |
| 500 | return atomic_read(&LINVFS_GET_IP(vp)->i_count); | 507 | return atomic_read(&vn_to_inode(vp)->i_count); |
| 501 | } | 508 | } |
| 502 | 509 | ||
| 503 | /* | 510 | /* |
| @@ -511,16 +518,16 @@ extern vnode_t *vn_hold(struct vnode *); | |||
| 511 | vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address)) | 518 | vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address)) |
| 512 | #define VN_RELE(vp) \ | 519 | #define VN_RELE(vp) \ |
| 513 | (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \ | 520 | (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \ |
| 514 | iput(LINVFS_GET_IP(vp))) | 521 | iput(vn_to_inode(vp))) |
| 515 | #else | 522 | #else |
| 516 | #define VN_HOLD(vp) ((void)vn_hold(vp)) | 523 | #define VN_HOLD(vp) ((void)vn_hold(vp)) |
| 517 | #define VN_RELE(vp) (iput(LINVFS_GET_IP(vp))) | 524 | #define VN_RELE(vp) (iput(vn_to_inode(vp))) |
| 518 | #endif | 525 | #endif |
| 519 | 526 | ||
| 520 | static inline struct vnode *vn_grab(struct vnode *vp) | 527 | static inline struct vnode *vn_grab(struct vnode *vp) |
| 521 | { | 528 | { |
| 522 | struct inode *inode = igrab(LINVFS_GET_IP(vp)); | 529 | struct inode *inode = igrab(vn_to_inode(vp)); |
| 523 | return inode ? LINVFS_GET_VP(inode) : NULL; | 530 | return inode ? vn_from_inode(inode) : NULL; |
| 524 | } | 531 | } |
| 525 | 532 | ||
| 526 | /* | 533 | /* |
| @@ -528,7 +535,7 @@ static inline struct vnode *vn_grab(struct vnode *vp) | |||
| 528 | */ | 535 | */ |
| 529 | #define VNAME(dentry) ((char *) (dentry)->d_name.name) | 536 | #define VNAME(dentry) ((char *) (dentry)->d_name.name) |
| 530 | #define VNAMELEN(dentry) ((dentry)->d_name.len) | 537 | #define VNAMELEN(dentry) ((dentry)->d_name.len) |
| 531 | #define VNAME_TO_VNODE(dentry) (LINVFS_GET_VP((dentry)->d_inode)) | 538 | #define VNAME_TO_VNODE(dentry) (vn_from_inode((dentry)->d_inode)) |
| 532 | 539 | ||
| 533 | /* | 540 | /* |
| 534 | * Vnode spinlock manipulation. | 541 | * Vnode spinlock manipulation. |
| @@ -557,12 +564,12 @@ static __inline__ void vn_flagclr(struct vnode *vp, uint flag) | |||
| 557 | */ | 564 | */ |
| 558 | static inline void vn_mark_bad(struct vnode *vp) | 565 | static inline void vn_mark_bad(struct vnode *vp) |
| 559 | { | 566 | { |
| 560 | make_bad_inode(LINVFS_GET_IP(vp)); | 567 | make_bad_inode(vn_to_inode(vp)); |
| 561 | } | 568 | } |
| 562 | 569 | ||
| 563 | static inline int VN_BAD(struct vnode *vp) | 570 | static inline int VN_BAD(struct vnode *vp) |
| 564 | { | 571 | { |
| 565 | return is_bad_inode(LINVFS_GET_IP(vp)); | 572 | return is_bad_inode(vn_to_inode(vp)); |
| 566 | } | 573 | } |
| 567 | 574 | ||
| 568 | /* | 575 | /* |
| @@ -587,9 +594,9 @@ static inline void vn_atime_to_time_t(struct vnode *vp, time_t *tt) | |||
| 587 | /* | 594 | /* |
| 588 | * Some useful predicates. | 595 | * Some useful predicates. |
| 589 | */ | 596 | */ |
| 590 | #define VN_MAPPED(vp) mapping_mapped(LINVFS_GET_IP(vp)->i_mapping) | 597 | #define VN_MAPPED(vp) mapping_mapped(vn_to_inode(vp)->i_mapping) |
| 591 | #define VN_CACHED(vp) (LINVFS_GET_IP(vp)->i_mapping->nrpages) | 598 | #define VN_CACHED(vp) (vn_to_inode(vp)->i_mapping->nrpages) |
| 592 | #define VN_DIRTY(vp) mapping_tagged(LINVFS_GET_IP(vp)->i_mapping, \ | 599 | #define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \ |
| 593 | PAGECACHE_TAG_DIRTY) | 600 | PAGECACHE_TAG_DIRTY) |
| 594 | #define VMODIFY(vp) VN_FLAGSET(vp, VMODIFIED) | 601 | #define VMODIFY(vp) VN_FLAGSET(vp, VMODIFIED) |
| 595 | #define VUNMODIFY(vp) VN_FLAGCLR(vp, VMODIFIED) | 602 | #define VUNMODIFY(vp) VN_FLAGCLR(vp, VMODIFIED) |
