diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_aops.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_aops.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 5f152f60d74d..28ccca98839b 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include "xfs_error.h" | 37 | #include "xfs_error.h" |
38 | #include "xfs_rw.h" | 38 | #include "xfs_rw.h" |
39 | #include "xfs_iomap.h" | 39 | #include "xfs_iomap.h" |
40 | #include "xfs_vnodeops.h" | ||
40 | #include <linux/mpage.h> | 41 | #include <linux/mpage.h> |
41 | #include <linux/pagevec.h> | 42 | #include <linux/pagevec.h> |
42 | #include <linux/writeback.h> | 43 | #include <linux/writeback.h> |
@@ -232,7 +233,8 @@ xfs_end_bio_unwritten( | |||
232 | size_t size = ioend->io_size; | 233 | size_t size = ioend->io_size; |
233 | 234 | ||
234 | if (likely(!ioend->io_error)) { | 235 | if (likely(!ioend->io_error)) { |
235 | bhv_vop_bmap(vp, offset, size, BMAPI_UNWRITTEN, NULL, NULL); | 236 | xfs_bmap(xfs_vtoi(vp), offset, size, |
237 | BMAPI_UNWRITTEN, NULL, NULL); | ||
236 | xfs_setfilesize(ioend); | 238 | xfs_setfilesize(ioend); |
237 | } | 239 | } |
238 | xfs_destroy_ioend(ioend); | 240 | xfs_destroy_ioend(ioend); |
@@ -305,7 +307,8 @@ xfs_map_blocks( | |||
305 | bhv_vnode_t *vp = vn_from_inode(inode); | 307 | bhv_vnode_t *vp = vn_from_inode(inode); |
306 | int error, nmaps = 1; | 308 | int error, nmaps = 1; |
307 | 309 | ||
308 | error = bhv_vop_bmap(vp, offset, count, flags, mapp, &nmaps); | 310 | error = xfs_bmap(xfs_vtoi(vp), offset, count, |
311 | flags, mapp, &nmaps); | ||
309 | if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE))) | 312 | if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE))) |
310 | VMODIFY(vp); | 313 | VMODIFY(vp); |
311 | return -error; | 314 | return -error; |
@@ -1323,7 +1326,6 @@ __xfs_get_blocks( | |||
1323 | int direct, | 1326 | int direct, |
1324 | bmapi_flags_t flags) | 1327 | bmapi_flags_t flags) |
1325 | { | 1328 | { |
1326 | bhv_vnode_t *vp = vn_from_inode(inode); | ||
1327 | xfs_iomap_t iomap; | 1329 | xfs_iomap_t iomap; |
1328 | xfs_off_t offset; | 1330 | xfs_off_t offset; |
1329 | ssize_t size; | 1331 | ssize_t size; |
@@ -1333,7 +1335,7 @@ __xfs_get_blocks( | |||
1333 | offset = (xfs_off_t)iblock << inode->i_blkbits; | 1335 | offset = (xfs_off_t)iblock << inode->i_blkbits; |
1334 | ASSERT(bh_result->b_size >= (1 << inode->i_blkbits)); | 1336 | ASSERT(bh_result->b_size >= (1 << inode->i_blkbits)); |
1335 | size = bh_result->b_size; | 1337 | size = bh_result->b_size; |
1336 | error = bhv_vop_bmap(vp, offset, size, | 1338 | error = xfs_bmap(XFS_I(inode), offset, size, |
1337 | create ? flags : BMAPI_READ, &iomap, &niomap); | 1339 | create ? flags : BMAPI_READ, &iomap, &niomap); |
1338 | if (error) | 1340 | if (error) |
1339 | return -error; | 1341 | return -error; |
@@ -1481,13 +1483,13 @@ xfs_vm_direct_IO( | |||
1481 | { | 1483 | { |
1482 | struct file *file = iocb->ki_filp; | 1484 | struct file *file = iocb->ki_filp; |
1483 | struct inode *inode = file->f_mapping->host; | 1485 | struct inode *inode = file->f_mapping->host; |
1484 | bhv_vnode_t *vp = vn_from_inode(inode); | ||
1485 | xfs_iomap_t iomap; | 1486 | xfs_iomap_t iomap; |
1486 | int maps = 1; | 1487 | int maps = 1; |
1487 | int error; | 1488 | int error; |
1488 | ssize_t ret; | 1489 | ssize_t ret; |
1489 | 1490 | ||
1490 | error = bhv_vop_bmap(vp, offset, 0, BMAPI_DEVICE, &iomap, &maps); | 1491 | error = xfs_bmap(XFS_I(inode), offset, 0, |
1492 | BMAPI_DEVICE, &iomap, &maps); | ||
1491 | if (error) | 1493 | if (error) |
1492 | return -error; | 1494 | return -error; |
1493 | 1495 | ||
@@ -1528,12 +1530,13 @@ xfs_vm_bmap( | |||
1528 | sector_t block) | 1530 | sector_t block) |
1529 | { | 1531 | { |
1530 | struct inode *inode = (struct inode *)mapping->host; | 1532 | struct inode *inode = (struct inode *)mapping->host; |
1531 | bhv_vnode_t *vp = vn_from_inode(inode); | 1533 | struct xfs_inode *ip = XFS_I(inode); |
1532 | 1534 | ||
1533 | vn_trace_entry(vp, __FUNCTION__, (inst_t *)__return_address); | 1535 | vn_trace_entry(vn_from_inode(inode), __FUNCTION__, |
1534 | bhv_vop_rwlock(vp, VRWLOCK_READ); | 1536 | (inst_t *)__return_address); |
1535 | bhv_vop_flush_pages(vp, (xfs_off_t)0, -1, 0, FI_REMAPF); | 1537 | xfs_rwlock(ip, VRWLOCK_READ); |
1536 | bhv_vop_rwunlock(vp, VRWLOCK_READ); | 1538 | xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF); |
1539 | xfs_rwunlock(ip, VRWLOCK_READ); | ||
1537 | return generic_block_bmap(mapping, block, xfs_get_blocks); | 1540 | return generic_block_bmap(mapping, block, xfs_get_blocks); |
1538 | } | 1541 | } |
1539 | 1542 | ||