aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorOlaf Weber <olaf@sgi.com>2006-06-09 00:48:12 -0400
committerNathan Scott <nathans@sgi.com>2006-06-09 00:48:12 -0400
commit3e57ecf640428c01ba1ed8c8fc538447ada1715b (patch)
treebcc92b0017b5ec8e106649cd53beffdd6addde07 /fs/xfs/xfs_vnodeops.c
parent128e6ced247cda88f96fa9f2e4ba8b2c4a681560 (diff)
[XFS] Add parameters to xfs_bmapi() and xfs_bunmapi() to have them report
the range spanned by modifications to the in-core extent map. Add XFS_BUNMAPI() and XFS_SWAP_EXTENTS() macros that call xfs_bunmapi() and xfs_swap_extents() via the ioops vector. Change all calls that may modify the in-core extent map for the data fork to go through the ioops vector. This allows a cache of extent map data to be kept in sync. SGI-PV: 947615 SGI-Modid: xfs-linux-melb:xfs-kern:209226a Signed-off-by: Olaf Weber <olaf@sgi.com> Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 7027ae68ee38..567d14d06d95 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc. 2 * Copyright (c) 2000-2006 Silicon Graphics, Inc.
3 * All Rights Reserved. 3 * All Rights Reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -1000,7 +1000,7 @@ xfs_readlink(
1000 nmaps = SYMLINK_MAPS; 1000 nmaps = SYMLINK_MAPS;
1001 1001
1002 error = xfs_bmapi(NULL, ip, 0, XFS_B_TO_FSB(mp, pathlen), 1002 error = xfs_bmapi(NULL, ip, 0, XFS_B_TO_FSB(mp, pathlen),
1003 0, NULL, 0, mval, &nmaps, NULL); 1003 0, NULL, 0, mval, &nmaps, NULL, NULL);
1004 1004
1005 if (error) { 1005 if (error) {
1006 goto error_return; 1006 goto error_return;
@@ -1208,8 +1208,8 @@ xfs_inactive_free_eofblocks(
1208 1208
1209 nimaps = 1; 1209 nimaps = 1;
1210 xfs_ilock(ip, XFS_ILOCK_SHARED); 1210 xfs_ilock(ip, XFS_ILOCK_SHARED);
1211 error = xfs_bmapi(NULL, ip, end_fsb, map_len, 0, 1211 error = XFS_BMAPI(mp, NULL, &ip->i_iocore, end_fsb, map_len, 0,
1212 NULL, 0, &imap, &nimaps, NULL); 1212 NULL, 0, &imap, &nimaps, NULL, NULL);
1213 xfs_iunlock(ip, XFS_ILOCK_SHARED); 1213 xfs_iunlock(ip, XFS_ILOCK_SHARED);
1214 1214
1215 if (!error && (nimaps != 0) && 1215 if (!error && (nimaps != 0) &&
@@ -1338,7 +1338,7 @@ xfs_inactive_symlink_rmt(
1338 nmaps = ARRAY_SIZE(mval); 1338 nmaps = ARRAY_SIZE(mval);
1339 if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size), 1339 if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size),
1340 XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps, 1340 XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps,
1341 &free_list))) 1341 &free_list, NULL)))
1342 goto error0; 1342 goto error0;
1343 /* 1343 /*
1344 * Invalidate the block(s). 1344 * Invalidate the block(s).
@@ -1353,7 +1353,7 @@ xfs_inactive_symlink_rmt(
1353 * Unmap the dead block(s) to the free_list. 1353 * Unmap the dead block(s) to the free_list.
1354 */ 1354 */
1355 if ((error = xfs_bunmapi(tp, ip, 0, size, XFS_BMAPI_METADATA, nmaps, 1355 if ((error = xfs_bunmapi(tp, ip, 0, size, XFS_BMAPI_METADATA, nmaps,
1356 &first_block, &free_list, &done))) 1356 &first_block, &free_list, NULL, &done)))
1357 goto error1; 1357 goto error1;
1358 ASSERT(done); 1358 ASSERT(done);
1359 /* 1359 /*
@@ -3457,7 +3457,7 @@ xfs_symlink(
3457 error = xfs_bmapi(tp, ip, first_fsb, fs_blocks, 3457 error = xfs_bmapi(tp, ip, first_fsb, fs_blocks,
3458 XFS_BMAPI_WRITE | XFS_BMAPI_METADATA, 3458 XFS_BMAPI_WRITE | XFS_BMAPI_METADATA,
3459 &first_block, resblks, mval, &nmaps, 3459 &first_block, resblks, mval, &nmaps,
3460 &free_list); 3460 &free_list, NULL);
3461 if (error) { 3461 if (error) {
3462 goto error1; 3462 goto error1;
3463 } 3463 }
@@ -4116,10 +4116,10 @@ retry:
4116 * Issue the xfs_bmapi() call to allocate the blocks 4116 * Issue the xfs_bmapi() call to allocate the blocks
4117 */ 4117 */
4118 XFS_BMAP_INIT(&free_list, &firstfsb); 4118 XFS_BMAP_INIT(&free_list, &firstfsb);
4119 error = xfs_bmapi(tp, ip, startoffset_fsb, 4119 error = XFS_BMAPI(mp, tp, &ip->i_iocore, startoffset_fsb,
4120 allocatesize_fsb, bmapi_flag, 4120 allocatesize_fsb, bmapi_flag,
4121 &firstfsb, 0, imapp, &nimaps, 4121 &firstfsb, 0, imapp, &nimaps,
4122 &free_list); 4122 &free_list, NULL);
4123 if (error) { 4123 if (error) {
4124 goto error0; 4124 goto error0;
4125 } 4125 }
@@ -4199,8 +4199,8 @@ xfs_zero_remaining_bytes(
4199 for (offset = startoff; offset <= endoff; offset = lastoffset + 1) { 4199 for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
4200 offset_fsb = XFS_B_TO_FSBT(mp, offset); 4200 offset_fsb = XFS_B_TO_FSBT(mp, offset);
4201 nimap = 1; 4201 nimap = 1;
4202 error = xfs_bmapi(NULL, ip, offset_fsb, 1, 0, NULL, 0, &imap, 4202 error = XFS_BMAPI(mp, NULL, &ip->i_iocore, offset_fsb, 1, 0,
4203 &nimap, NULL); 4203 NULL, 0, &imap, &nimap, NULL, NULL);
4204 if (error || nimap < 1) 4204 if (error || nimap < 1)
4205 break; 4205 break;
4206 ASSERT(imap.br_blockcount >= 1); 4206 ASSERT(imap.br_blockcount >= 1);
@@ -4338,8 +4338,8 @@ xfs_free_file_space(
4338 */ 4338 */
4339 if (rt && !XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb)) { 4339 if (rt && !XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb)) {
4340 nimap = 1; 4340 nimap = 1;
4341 error = xfs_bmapi(NULL, ip, startoffset_fsb, 1, 0, NULL, 0, 4341 error = XFS_BMAPI(mp, NULL, &ip->i_iocore, startoffset_fsb,
4342 &imap, &nimap, NULL); 4342 1, 0, NULL, 0, &imap, &nimap, NULL, NULL);
4343 if (error) 4343 if (error)
4344 goto out_unlock_iolock; 4344 goto out_unlock_iolock;
4345 ASSERT(nimap == 0 || nimap == 1); 4345 ASSERT(nimap == 0 || nimap == 1);
@@ -4353,8 +4353,8 @@ xfs_free_file_space(
4353 startoffset_fsb += mp->m_sb.sb_rextsize - mod; 4353 startoffset_fsb += mp->m_sb.sb_rextsize - mod;
4354 } 4354 }
4355 nimap = 1; 4355 nimap = 1;
4356 error = xfs_bmapi(NULL, ip, endoffset_fsb - 1, 1, 0, NULL, 0, 4356 error = XFS_BMAPI(mp, NULL, &ip->i_iocore, endoffset_fsb - 1,
4357 &imap, &nimap, NULL); 4357 1, 0, NULL, 0, &imap, &nimap, NULL, NULL);
4358 if (error) 4358 if (error)
4359 goto out_unlock_iolock; 4359 goto out_unlock_iolock;
4360 ASSERT(nimap == 0 || nimap == 1); 4360 ASSERT(nimap == 0 || nimap == 1);
@@ -4426,9 +4426,9 @@ xfs_free_file_space(
4426 * issue the bunmapi() call to free the blocks 4426 * issue the bunmapi() call to free the blocks
4427 */ 4427 */
4428 XFS_BMAP_INIT(&free_list, &firstfsb); 4428 XFS_BMAP_INIT(&free_list, &firstfsb);
4429 error = xfs_bunmapi(tp, ip, startoffset_fsb, 4429 error = XFS_BUNMAPI(mp, tp, &ip->i_iocore, startoffset_fsb,
4430 endoffset_fsb - startoffset_fsb, 4430 endoffset_fsb - startoffset_fsb,
4431 0, 2, &firstfsb, &free_list, &done); 4431 0, 2, &firstfsb, &free_list, NULL, &done);
4432 if (error) { 4432 if (error) {
4433 goto error0; 4433 goto error0;
4434 } 4434 }