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_aops.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_aops.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 22a40bd0cce2..1dd198ec2890 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -140,9 +140,11 @@ xfs_destroy_ioend( | |||
140 | next = bh->b_private; | 140 | next = bh->b_private; |
141 | bh->b_end_io(bh, !ioend->io_error); | 141 | bh->b_end_io(bh, !ioend->io_error); |
142 | } | 142 | } |
143 | if (unlikely(ioend->io_error)) | 143 | if (unlikely(ioend->io_error)) { |
144 | vn_ioerror(ioend->io_vnode, ioend->io_error, __FILE__,__LINE__); | 144 | vn_ioerror(XFS_I(ioend->io_inode), ioend->io_error, |
145 | vn_iowake(ioend->io_vnode); | 145 | __FILE__,__LINE__); |
146 | } | ||
147 | vn_iowake(XFS_I(ioend->io_inode)); | ||
146 | mempool_free(ioend, xfs_ioend_pool); | 148 | mempool_free(ioend, xfs_ioend_pool); |
147 | } | 149 | } |
148 | 150 | ||
@@ -157,14 +159,10 @@ STATIC void | |||
157 | xfs_setfilesize( | 159 | xfs_setfilesize( |
158 | xfs_ioend_t *ioend) | 160 | xfs_ioend_t *ioend) |
159 | { | 161 | { |
160 | xfs_inode_t *ip; | 162 | xfs_inode_t *ip = XFS_I(ioend->io_inode); |
161 | xfs_fsize_t isize; | 163 | xfs_fsize_t isize; |
162 | xfs_fsize_t bsize; | 164 | xfs_fsize_t bsize; |
163 | 165 | ||
164 | ip = xfs_vtoi(ioend->io_vnode); | ||
165 | if (!ip) | ||
166 | return; | ||
167 | |||
168 | ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); | 166 | ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFREG); |
169 | ASSERT(ioend->io_type != IOMAP_READ); | 167 | ASSERT(ioend->io_type != IOMAP_READ); |
170 | 168 | ||
@@ -228,12 +226,11 @@ xfs_end_bio_unwritten( | |||
228 | { | 226 | { |
229 | xfs_ioend_t *ioend = | 227 | xfs_ioend_t *ioend = |
230 | container_of(work, xfs_ioend_t, io_work); | 228 | container_of(work, xfs_ioend_t, io_work); |
231 | bhv_vnode_t *vp = ioend->io_vnode; | ||
232 | xfs_off_t offset = ioend->io_offset; | 229 | xfs_off_t offset = ioend->io_offset; |
233 | size_t size = ioend->io_size; | 230 | size_t size = ioend->io_size; |
234 | 231 | ||
235 | if (likely(!ioend->io_error)) { | 232 | if (likely(!ioend->io_error)) { |
236 | xfs_bmap(xfs_vtoi(vp), offset, size, | 233 | xfs_bmap(XFS_I(ioend->io_inode), offset, size, |
237 | BMAPI_UNWRITTEN, NULL, NULL); | 234 | BMAPI_UNWRITTEN, NULL, NULL); |
238 | xfs_setfilesize(ioend); | 235 | xfs_setfilesize(ioend); |
239 | } | 236 | } |
@@ -277,10 +274,10 @@ xfs_alloc_ioend( | |||
277 | ioend->io_error = 0; | 274 | ioend->io_error = 0; |
278 | ioend->io_list = NULL; | 275 | ioend->io_list = NULL; |
279 | ioend->io_type = type; | 276 | ioend->io_type = type; |
280 | ioend->io_vnode = vn_from_inode(inode); | 277 | ioend->io_inode = inode; |
281 | ioend->io_buffer_head = NULL; | 278 | ioend->io_buffer_head = NULL; |
282 | ioend->io_buffer_tail = NULL; | 279 | ioend->io_buffer_tail = NULL; |
283 | atomic_inc(&ioend->io_vnode->v_iocount); | 280 | atomic_inc(&XFS_I(ioend->io_inode)->i_iocount); |
284 | ioend->io_offset = 0; | 281 | ioend->io_offset = 0; |
285 | ioend->io_size = 0; | 282 | ioend->io_size = 0; |
286 | 283 | ||
@@ -506,7 +503,7 @@ xfs_cancel_ioend( | |||
506 | unlock_buffer(bh); | 503 | unlock_buffer(bh); |
507 | } while ((bh = next_bh) != NULL); | 504 | } while ((bh = next_bh) != NULL); |
508 | 505 | ||
509 | vn_iowake(ioend->io_vnode); | 506 | vn_iowake(XFS_I(ioend->io_inode)); |
510 | mempool_free(ioend, xfs_ioend_pool); | 507 | mempool_free(ioend, xfs_ioend_pool); |
511 | } while ((ioend = next) != NULL); | 508 | } while ((ioend = next) != NULL); |
512 | } | 509 | } |