diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-08-28 21:46:28 -0400 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-10-15 21:38:56 -0400 |
commit | b677c210cec0d6755335ffc01691982c417dd39e (patch) | |
tree | 9a61fdd81e48aac948346a096bed9c72e5f34114 /fs/xfs/linux-2.6/xfs_vnode.c | |
parent | 09262b4339de5417a10803fbfac277eebb38ca5a (diff) |
[XFS] move v_iocount from bhv_vnode to xfs_inode
struct bhv_vnode is on it's way out, so move the I/O count to the XFS
inode.
SGI-PV: 969608
SGI-Modid: xfs-linux-melb:xfs-kern:29497a
Signed-off-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_vnode.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_vnode.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c index e6c559aee446..bde8d2e7f559 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.c +++ b/fs/xfs/linux-2.6/xfs_vnode.c | |||
@@ -20,6 +20,17 @@ | |||
20 | #include "xfs_bmap_btree.h" | 20 | #include "xfs_bmap_btree.h" |
21 | #include "xfs_inode.h" | 21 | #include "xfs_inode.h" |
22 | 22 | ||
23 | /* | ||
24 | * And this gunk is needed for xfs_mount.h" | ||
25 | */ | ||
26 | #include "xfs_log.h" | ||
27 | #include "xfs_trans.h" | ||
28 | #include "xfs_sb.h" | ||
29 | #include "xfs_dmapi.h" | ||
30 | #include "xfs_inum.h" | ||
31 | #include "xfs_ag.h" | ||
32 | #include "xfs_mount.h" | ||
33 | |||
23 | uint64_t vn_generation; /* vnode generation number */ | 34 | uint64_t vn_generation; /* vnode generation number */ |
24 | DEFINE_SPINLOCK(vnumber_lock); | 35 | DEFINE_SPINLOCK(vnumber_lock); |
25 | 36 | ||
@@ -42,19 +53,19 @@ vn_init(void) | |||
42 | 53 | ||
43 | void | 54 | void |
44 | vn_iowait( | 55 | vn_iowait( |
45 | bhv_vnode_t *vp) | 56 | xfs_inode_t *ip) |
46 | { | 57 | { |
47 | wait_queue_head_t *wq = vptosync(vp); | 58 | wait_queue_head_t *wq = vptosync(ip); |
48 | 59 | ||
49 | wait_event(*wq, (atomic_read(&vp->v_iocount) == 0)); | 60 | wait_event(*wq, (atomic_read(&ip->i_iocount) == 0)); |
50 | } | 61 | } |
51 | 62 | ||
52 | void | 63 | void |
53 | vn_iowake( | 64 | vn_iowake( |
54 | bhv_vnode_t *vp) | 65 | xfs_inode_t *ip) |
55 | { | 66 | { |
56 | if (atomic_dec_and_test(&vp->v_iocount)) | 67 | if (atomic_dec_and_test(&ip->i_iocount)) |
57 | wake_up(vptosync(vp)); | 68 | wake_up(vptosync(ip)); |
58 | } | 69 | } |
59 | 70 | ||
60 | /* | 71 | /* |
@@ -64,12 +75,12 @@ vn_iowake( | |||
64 | */ | 75 | */ |
65 | void | 76 | void |
66 | vn_ioerror( | 77 | vn_ioerror( |
67 | bhv_vnode_t *vp, | 78 | xfs_inode_t *ip, |
68 | int error, | 79 | int error, |
69 | char *f, | 80 | char *f, |
70 | int l) | 81 | int l) |
71 | { | 82 | { |
72 | bhv_vfs_t *vfsp = vfs_from_sb(vp->v_inode.i_sb); | 83 | bhv_vfs_t *vfsp = XFS_MTOVFS(ip->i_mount); |
73 | 84 | ||
74 | if (unlikely(error == -ENODEV)) | 85 | if (unlikely(error == -ENODEV)) |
75 | bhv_vfs_force_shutdown(vfsp, SHUTDOWN_DEVICE_REQ, f, l); | 86 | bhv_vfs_force_shutdown(vfsp, SHUTDOWN_DEVICE_REQ, f, l); |
@@ -92,8 +103,6 @@ vn_initialize( | |||
92 | 103 | ||
93 | ASSERT(VN_CACHED(vp) == 0); | 104 | ASSERT(VN_CACHED(vp) == 0); |
94 | 105 | ||
95 | atomic_set(&vp->v_iocount, 0); | ||
96 | |||
97 | #ifdef XFS_VNODE_TRACE | 106 | #ifdef XFS_VNODE_TRACE |
98 | vp->v_trace = ktrace_alloc(VNODE_TRACE_SIZE, KM_SLEEP); | 107 | vp->v_trace = ktrace_alloc(VNODE_TRACE_SIZE, KM_SLEEP); |
99 | #endif /* XFS_VNODE_TRACE */ | 108 | #endif /* XFS_VNODE_TRACE */ |