diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_vnode.h')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.h | 65 |
1 files changed, 23 insertions, 42 deletions
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 41ca2cec5d31..683ce16210ff 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h | |||
@@ -22,20 +22,6 @@ struct file; | |||
22 | struct xfs_iomap; | 22 | struct xfs_iomap; |
23 | struct attrlist_cursor_kern; | 23 | struct attrlist_cursor_kern; |
24 | 24 | ||
25 | typedef struct inode bhv_vnode_t; | ||
26 | |||
27 | /* | ||
28 | * Vnode to Linux inode mapping. | ||
29 | */ | ||
30 | static inline bhv_vnode_t *vn_from_inode(struct inode *inode) | ||
31 | { | ||
32 | return inode; | ||
33 | } | ||
34 | static inline struct inode *vn_to_inode(bhv_vnode_t *vnode) | ||
35 | { | ||
36 | return vnode; | ||
37 | } | ||
38 | |||
39 | /* | 25 | /* |
40 | * Return values for xfs_inactive. A return value of | 26 | * Return values for xfs_inactive. A return value of |
41 | * VN_INACTIVE_NOCACHE implies that the file system behavior | 27 | * VN_INACTIVE_NOCACHE implies that the file system behavior |
@@ -76,57 +62,52 @@ extern void vn_iowait(struct xfs_inode *ip); | |||
76 | extern void vn_iowake(struct xfs_inode *ip); | 62 | extern void vn_iowake(struct xfs_inode *ip); |
77 | extern void vn_ioerror(struct xfs_inode *ip, int error, char *f, int l); | 63 | extern void vn_ioerror(struct xfs_inode *ip, int error, char *f, int l); |
78 | 64 | ||
79 | static inline int vn_count(bhv_vnode_t *vp) | 65 | static inline int vn_count(struct inode *vp) |
80 | { | 66 | { |
81 | return atomic_read(&vn_to_inode(vp)->i_count); | 67 | return atomic_read(&vp->i_count); |
82 | } | 68 | } |
83 | 69 | ||
84 | /* | 70 | #define IHOLD(ip) \ |
85 | * Vnode reference counting functions (and macros for compatibility). | 71 | do { \ |
86 | */ | 72 | ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \ |
87 | extern bhv_vnode_t *vn_hold(bhv_vnode_t *); | 73 | atomic_inc(&(VFS_I(ip)->i_count)); \ |
74 | xfs_itrace_hold((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ | ||
75 | } while (0) | ||
88 | 76 | ||
89 | #if defined(XFS_INODE_TRACE) | 77 | #define IRELE(ip) \ |
90 | #define VN_HOLD(vp) \ | 78 | do { \ |
91 | ((void)vn_hold(vp), \ | 79 | xfs_itrace_rele((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ |
92 | xfs_itrace_hold(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address)) | 80 | iput(VFS_I(ip)); \ |
93 | #define VN_RELE(vp) \ | 81 | } while (0) |
94 | (xfs_itrace_rele(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address), \ | ||
95 | iput(vn_to_inode(vp))) | ||
96 | #else | ||
97 | #define VN_HOLD(vp) ((void)vn_hold(vp)) | ||
98 | #define VN_RELE(vp) (iput(vn_to_inode(vp))) | ||
99 | #endif | ||
100 | 82 | ||
101 | static inline bhv_vnode_t *vn_grab(bhv_vnode_t *vp) | 83 | static inline struct inode *vn_grab(struct inode *vp) |
102 | { | 84 | { |
103 | struct inode *inode = igrab(vn_to_inode(vp)); | 85 | return igrab(vp); |
104 | return inode ? vn_from_inode(inode) : NULL; | ||
105 | } | 86 | } |
106 | 87 | ||
107 | /* | 88 | /* |
108 | * Dealing with bad inodes | 89 | * Dealing with bad inodes |
109 | */ | 90 | */ |
110 | static inline int VN_BAD(bhv_vnode_t *vp) | 91 | static inline int VN_BAD(struct inode *vp) |
111 | { | 92 | { |
112 | return is_bad_inode(vn_to_inode(vp)); | 93 | return is_bad_inode(vp); |
113 | } | 94 | } |
114 | 95 | ||
115 | /* | 96 | /* |
116 | * Extracting atime values in various formats | 97 | * Extracting atime values in various formats |
117 | */ | 98 | */ |
118 | static inline void vn_atime_to_bstime(bhv_vnode_t *vp, xfs_bstime_t *bs_atime) | 99 | static inline void vn_atime_to_bstime(struct inode *vp, xfs_bstime_t *bs_atime) |
119 | { | 100 | { |
120 | bs_atime->tv_sec = vp->i_atime.tv_sec; | 101 | bs_atime->tv_sec = vp->i_atime.tv_sec; |
121 | bs_atime->tv_nsec = vp->i_atime.tv_nsec; | 102 | bs_atime->tv_nsec = vp->i_atime.tv_nsec; |
122 | } | 103 | } |
123 | 104 | ||
124 | static inline void vn_atime_to_timespec(bhv_vnode_t *vp, struct timespec *ts) | 105 | static inline void vn_atime_to_timespec(struct inode *vp, struct timespec *ts) |
125 | { | 106 | { |
126 | *ts = vp->i_atime; | 107 | *ts = vp->i_atime; |
127 | } | 108 | } |
128 | 109 | ||
129 | static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt) | 110 | static inline void vn_atime_to_time_t(struct inode *vp, time_t *tt) |
130 | { | 111 | { |
131 | *tt = vp->i_atime.tv_sec; | 112 | *tt = vp->i_atime.tv_sec; |
132 | } | 113 | } |
@@ -134,9 +115,9 @@ static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt) | |||
134 | /* | 115 | /* |
135 | * Some useful predicates. | 116 | * Some useful predicates. |
136 | */ | 117 | */ |
137 | #define VN_MAPPED(vp) mapping_mapped(vn_to_inode(vp)->i_mapping) | 118 | #define VN_MAPPED(vp) mapping_mapped(vp->i_mapping) |
138 | #define VN_CACHED(vp) (vn_to_inode(vp)->i_mapping->nrpages) | 119 | #define VN_CACHED(vp) (vp->i_mapping->nrpages) |
139 | #define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \ | 120 | #define VN_DIRTY(vp) mapping_tagged(vp->i_mapping, \ |
140 | PAGECACHE_TAG_DIRTY) | 121 | PAGECACHE_TAG_DIRTY) |
141 | 122 | ||
142 | 123 | ||