aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6/xfs_vnode.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_vnode.h')
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 0cf92ca80ce7..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)) 119static 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}
123static 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.
@@ -498,7 +504,7 @@ extern void vn_iowake(struct vnode *vp);
498 504
499static inline int vn_count(struct vnode *vp) 505static inline int vn_count(struct vnode *vp)
500{ 506{
501 return atomic_read(&LINVFS_GET_IP(vp)->i_count); 507 return atomic_read(&vn_to_inode(vp)->i_count);
502} 508}
503 509
504/* 510/*
@@ -512,16 +518,16 @@ extern vnode_t *vn_hold(struct vnode *);
512 vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address)) 518 vn_trace_hold(vp, __FILE__, __LINE__, (inst_t *)__return_address))
513#define VN_RELE(vp) \ 519#define VN_RELE(vp) \
514 (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \ 520 (vn_trace_rele(vp, __FILE__, __LINE__, (inst_t *)__return_address), \
515 iput(LINVFS_GET_IP(vp))) 521 iput(vn_to_inode(vp)))
516#else 522#else
517#define VN_HOLD(vp) ((void)vn_hold(vp)) 523#define VN_HOLD(vp) ((void)vn_hold(vp))
518#define VN_RELE(vp) (iput(LINVFS_GET_IP(vp))) 524#define VN_RELE(vp) (iput(vn_to_inode(vp)))
519#endif 525#endif
520 526
521static inline struct vnode *vn_grab(struct vnode *vp) 527static inline struct vnode *vn_grab(struct vnode *vp)
522{ 528{
523 struct inode *inode = igrab(LINVFS_GET_IP(vp)); 529 struct inode *inode = igrab(vn_to_inode(vp));
524 return inode ? LINVFS_GET_VP(inode) : NULL; 530 return inode ? vn_from_inode(inode) : NULL;
525} 531}
526 532
527/* 533/*
@@ -529,7 +535,7 @@ static inline struct vnode *vn_grab(struct vnode *vp)
529 */ 535 */
530#define VNAME(dentry) ((char *) (dentry)->d_name.name) 536#define VNAME(dentry) ((char *) (dentry)->d_name.name)
531#define VNAMELEN(dentry) ((dentry)->d_name.len) 537#define VNAMELEN(dentry) ((dentry)->d_name.len)
532#define VNAME_TO_VNODE(dentry) (LINVFS_GET_VP((dentry)->d_inode)) 538#define VNAME_TO_VNODE(dentry) (vn_from_inode((dentry)->d_inode))
533 539
534/* 540/*
535 * Vnode spinlock manipulation. 541 * Vnode spinlock manipulation.
@@ -558,12 +564,12 @@ static __inline__ void vn_flagclr(struct vnode *vp, uint flag)
558 */ 564 */
559static inline void vn_mark_bad(struct vnode *vp) 565static inline void vn_mark_bad(struct vnode *vp)
560{ 566{
561 make_bad_inode(LINVFS_GET_IP(vp)); 567 make_bad_inode(vn_to_inode(vp));
562} 568}
563 569
564static inline int VN_BAD(struct vnode *vp) 570static inline int VN_BAD(struct vnode *vp)
565{ 571{
566 return is_bad_inode(LINVFS_GET_IP(vp)); 572 return is_bad_inode(vn_to_inode(vp));
567} 573}
568 574
569/* 575/*
@@ -588,9 +594,9 @@ static inline void vn_atime_to_time_t(struct vnode *vp, time_t *tt)
588/* 594/*
589 * Some useful predicates. 595 * Some useful predicates.
590 */ 596 */
591#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)
592#define VN_CACHED(vp) (LINVFS_GET_IP(vp)->i_mapping->nrpages) 598#define VN_CACHED(vp) (vn_to_inode(vp)->i_mapping->nrpages)
593#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, \
594 PAGECACHE_TAG_DIRTY) 600 PAGECACHE_TAG_DIRTY)
595#define VMODIFY(vp) VN_FLAGSET(vp, VMODIFIED) 601#define VMODIFY(vp) VN_FLAGSET(vp, VMODIFIED)
596#define VUNMODIFY(vp) VN_FLAGCLR(vp, VMODIFIED) 602#define VUNMODIFY(vp) VN_FLAGCLR(vp, VMODIFIED)