aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_qm.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2011-09-18 16:40:45 -0400
committerAlex Elder <aelder@sgi.com>2011-10-11 22:15:03 -0400
commit5c8ed2021ff291f5e399a9b43c4f699b2fc58fbb (patch)
tree36d8375935324279fb27e50daa7fc6873ff68cea /fs/xfs/xfs_qm.c
parentaef9a89586fc8475bf0333b8736d5aa8aa6f4897 (diff)
xfs: introduce xfs_bmapi_read()
xfs_bmapi() currently handles both extent map reading and allocation. As a result, the code is littered with "if (wr)" branches to conditionally do allocation operations if required. This makes the code much harder to follow and causes significant indent issues with the code. Given that read mapping is much simpler than allocation, we can split out read mapping from xfs_bmapi() and reuse the logic that we have already factored out do do all the hard work of handling the extent map manipulations. The results in a much simpler function for the common extent read operations, and will allow the allocation code to be simplified in another commit. Once xfs_bmapi_read() is implemented, convert all the callers of xfs_bmapi() that are only reading extents to use the new function. Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r--fs/xfs/xfs_qm.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index f51bef885e6d..ddaf97a57ec6 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -1347,11 +1347,8 @@ xfs_qm_dqiterate(
1347 * the inode is never added to the transaction. 1347 * the inode is never added to the transaction.
1348 */ 1348 */
1349 xfs_ilock(qip, XFS_ILOCK_SHARED); 1349 xfs_ilock(qip, XFS_ILOCK_SHARED);
1350 error = xfs_bmapi(NULL, qip, lblkno, 1350 error = xfs_bmapi_read(qip, lblkno, maxlblkcnt - lblkno,
1351 maxlblkcnt - lblkno, 1351 map, &nmaps, 0);
1352 XFS_BMAPI_METADATA,
1353 NULL,
1354 0, map, &nmaps, NULL);
1355 xfs_iunlock(qip, XFS_ILOCK_SHARED); 1352 xfs_iunlock(qip, XFS_ILOCK_SHARED);
1356 if (error) 1353 if (error)
1357 break; 1354 break;