aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@sgi.com>2005-09-02 02:24:19 -0400
committerNathan Scott <nathans@sgi.com>2005-09-02 02:24:19 -0400
commitcdb626878f6f5e37d678d30c9cacf5726b88a656 (patch)
tree2c9ff3f0ce5831bc34820ffbaffa8681fa1e0271 /fs/xfs/linux-2.6
parentbb3f724e12eb9c62c92ff6f14a856bc58ba35f5e (diff)
[XFS] replace vn_get usage by ihold
SGI-PV: 938306 SGI-Modid: xfs-linux:xfs-kern:194627a Signed-off-by: Christoph Hellwig <hch@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.c24
-rw-r--r--fs/xfs/linux-2.6/xfs_vnode.h21
2 files changed, 6 insertions, 39 deletions
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c
index 250cad54e892..353276bda344 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.c
+++ b/fs/xfs/linux-2.6/xfs_vnode.c
@@ -163,30 +163,6 @@ vn_initialize(
163} 163}
164 164
165/* 165/*
166 * Get a reference on a vnode.
167 */
168vnode_t *
169vn_get(
170 struct vnode *vp,
171 vmap_t *vmap)
172{
173 struct inode *inode;
174
175 XFS_STATS_INC(vn_get);
176 inode = LINVFS_GET_IP(vp);
177 if (inode->i_state & I_FREEING)
178 return NULL;
179
180 inode = ilookup(vmap->v_vfsp->vfs_super, vmap->v_ino);
181 if (!inode) /* Inode not present */
182 return NULL;
183
184 vn_trace_exit(vp, "vn_get", (inst_t *)__return_address);
185
186 return vp;
187}
188
189/*
190 * Revalidate the Linux inode from the vattr. 166 * Revalidate the Linux inode from the vattr.
191 * Note: i_size _not_ updated; we must hold the inode 167 * Note: i_size _not_ updated; we must hold the inode
192 * semaphore when doing that - callers responsibility. 168 * semaphore when doing that - callers responsibility.
diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h
index 56d85d85fb05..6cb0a01df25d 100644
--- a/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/fs/xfs/linux-2.6/xfs_vnode.h
@@ -505,20 +505,6 @@ extern int vn_wait(struct vnode *);
505extern vnode_t *vn_initialize(struct inode *); 505extern vnode_t *vn_initialize(struct inode *);
506 506
507/* 507/*
508 * Acquiring and invalidating vnodes:
509 *
510 * if (vn_get(vp, version, 0))
511 * ...;
512 * vn_purge(vp, version);
513 *
514 * vn_get and vn_purge must be called with vmap_t arguments, sampled
515 * while a lock that the vnode's VOP_RECLAIM function acquires is
516 * held, to ensure that the vnode sampled with the lock held isn't
517 * recycled (VOP_RECLAIMed) or deallocated between the release of the lock
518 * and the subsequent vn_get or vn_purge.
519 */
520
521/*
522 * vnode_map structures _must_ match vn_epoch and vnode structure sizes. 508 * vnode_map structures _must_ match vn_epoch and vnode structure sizes.
523 */ 509 */
524typedef struct vnode_map { 510typedef struct vnode_map {
@@ -532,7 +518,6 @@ typedef struct vnode_map {
532 (vmap).v_ino = (vp)->v_inode.i_ino; } 518 (vmap).v_ino = (vp)->v_inode.i_ino; }
533 519
534extern void vn_purge(struct vnode *, vmap_t *); 520extern void vn_purge(struct vnode *, vmap_t *);
535extern vnode_t *vn_get(struct vnode *, vmap_t *);
536extern int vn_revalidate(struct vnode *); 521extern int vn_revalidate(struct vnode *);
537extern void vn_revalidate_core(struct vnode *, vattr_t *); 522extern void vn_revalidate_core(struct vnode *, vattr_t *);
538extern void vn_remove(struct vnode *); 523extern void vn_remove(struct vnode *);
@@ -560,6 +545,12 @@ extern void vn_rele(struct vnode *);
560#define VN_RELE(vp) (iput(LINVFS_GET_IP(vp))) 545#define VN_RELE(vp) (iput(LINVFS_GET_IP(vp)))
561#endif 546#endif
562 547
548static inline struct vnode *vn_grab(struct vnode *vp)
549{
550 struct inode *inode = igrab(LINVFS_GET_IP(vp));
551 return inode ? LINVFS_GET_VP(inode) : NULL;
552}
553
563/* 554/*
564 * Vname handling macros. 555 * Vname handling macros.
565 */ 556 */