aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@sgi.com>2006-01-11 04:58:44 -0500
committerNathan Scott <nathans@sgi.com>2006-01-11 04:58:44 -0500
commit75e17b3caf29b262000dc7348f1be9a7d5403463 (patch)
tree4bdf782dd3624fd23832b035ebbdbb4daca7dd94 /fs/xfs/linux-2.6
parent204ab25f36fbd44a24458c0227cf2629c8caf00d (diff)
[XFS] add helper to get xfs_inode from vnode
SGI-PV: 947206 SGI-Modid: xfs-linux-melb:xfs-kern:203960a 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_aops.c4
-rw-r--r--fs/xfs/linux-2.6/xfs_file.c6
-rw-r--r--fs/xfs/linux-2.6/xfs_ioctl.c5
-rw-r--r--fs/xfs/linux-2.6/xfs_iops.c16
4 files changed, 20 insertions, 11 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index 52707b5ddcb8..d1db8c17a74e 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -54,7 +54,6 @@ xfs_page_trace(
54 int mask) 54 int mask)
55{ 55{
56 xfs_inode_t *ip; 56 xfs_inode_t *ip;
57 bhv_desc_t *bdp;
58 vnode_t *vp = LINVFS_GET_VP(inode); 57 vnode_t *vp = LINVFS_GET_VP(inode);
59 loff_t isize = i_size_read(inode); 58 loff_t isize = i_size_read(inode);
60 loff_t offset = page_offset(page); 59 loff_t offset = page_offset(page);
@@ -63,8 +62,7 @@ xfs_page_trace(
63 if (page_has_buffers(page)) 62 if (page_has_buffers(page))
64 xfs_count_page_state(page, &delalloc, &unmapped, &unwritten); 63 xfs_count_page_state(page, &delalloc, &unmapped, &unwritten);
65 64
66 bdp = vn_bhv_lookup(VN_BHV_HEAD(vp), &xfs_vnodeops); 65 ip = xfs_vtoi(vp);
67 ip = XFS_BHVTOI(bdp);
68 if (!ip->i_rwtrace) 66 if (!ip->i_rwtrace)
69 return; 67 return;
70 68
diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
index 06111d0bbae4..ced4404339c7 100644
--- a/fs/xfs/linux-2.6/xfs_file.c
+++ b/fs/xfs/linux-2.6/xfs_file.c
@@ -509,16 +509,14 @@ linvfs_open_exec(
509 vnode_t *vp = LINVFS_GET_VP(inode); 509 vnode_t *vp = LINVFS_GET_VP(inode);
510 xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp); 510 xfs_mount_t *mp = XFS_VFSTOM(vp->v_vfsp);
511 int error = 0; 511 int error = 0;
512 bhv_desc_t *bdp;
513 xfs_inode_t *ip; 512 xfs_inode_t *ip;
514 513
515 if (vp->v_vfsp->vfs_flag & VFS_DMI) { 514 if (vp->v_vfsp->vfs_flag & VFS_DMI) {
516 bdp = vn_bhv_lookup(VN_BHV_HEAD(vp), &xfs_vnodeops); 515 ip = xfs_vtoi(vp);
517 if (!bdp) { 516 if (!ip) {
518 error = -EINVAL; 517 error = -EINVAL;
519 goto open_exec_out; 518 goto open_exec_out;
520 } 519 }
521 ip = XFS_BHVTOI(bdp);
522 if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ)) { 520 if (DM_EVENT_ENABLED(vp->v_vfsp, ip, DM_EVENT_READ)) {
523 error = -XFS_SEND_DATA(mp, DM_EVENT_READ, vp, 521 error = -XFS_SEND_DATA(mp, DM_EVENT_READ, vp,
524 0, 0, 0, NULL); 522 0, 0, 0, NULL);
diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c
index 7ad7b680e996..b3b2cfda273c 100644
--- a/fs/xfs/linux-2.6/xfs_ioctl.c
+++ b/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -145,13 +145,10 @@ xfs_find_handle(
145 145
146 if (cmd != XFS_IOC_PATH_TO_FSHANDLE) { 146 if (cmd != XFS_IOC_PATH_TO_FSHANDLE) {
147 xfs_inode_t *ip; 147 xfs_inode_t *ip;
148 bhv_desc_t *bhv;
149 int lock_mode; 148 int lock_mode;
150 149
151 /* need to get access to the xfs_inode to read the generation */ 150 /* need to get access to the xfs_inode to read the generation */
152 bhv = vn_bhv_lookup_unlocked(VN_BHV_HEAD(vp), &xfs_vnodeops); 151 ip = xfs_vtoi(vp);
153 ASSERT(bhv);
154 ip = XFS_BHVTOI(bhv);
155 ASSERT(ip); 152 ASSERT(ip);
156 lock_mode = xfs_ilock_map_shared(ip); 153 lock_mode = xfs_ilock_map_shared(ip);
157 154
diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
index fe5e9894fdee..d388d14efe3e 100644
--- a/fs/xfs/linux-2.6/xfs_iops.c
+++ b/fs/xfs/linux-2.6/xfs_iops.c
@@ -59,6 +59,22 @@
59 (S_ISDIR(inode->i_mode) && inode->i_sb->s_flags & MS_NODIRATIME)) 59 (S_ISDIR(inode->i_mode) && inode->i_sb->s_flags & MS_NODIRATIME))
60 60
61/* 61/*
62 * Get a XFS inode from a given vnode.
63 */
64xfs_inode_t *
65xfs_vtoi(
66 struct vnode *vp)
67{
68 bhv_desc_t *bdp;
69
70 bdp = bhv_lookup_range(VN_BHV_HEAD(vp),
71 VNODE_POSITION_XFS, VNODE_POSITION_XFS);
72 if (unlikely(bdp == NULL))
73 return NULL;
74 return XFS_BHVTOI(bdp);
75}
76
77/*
62 * Bring the atime in the XFS inode uptodate. 78 * Bring the atime in the XFS inode uptodate.
63 * Used before logging the inode to disk or when the Linux inode goes away. 79 * Used before logging the inode to disk or when the Linux inode goes away.
64 */ 80 */