aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/linux-2.6/xfs_aops.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c
index c6108971b4e6..94d3cdfbf9b8 100644
--- a/fs/xfs/linux-2.6/xfs_aops.c
+++ b/fs/xfs/linux-2.6/xfs_aops.c
@@ -941,13 +941,12 @@ __linvfs_get_block(
941 int retpbbm = 1; 941 int retpbbm = 1;
942 int error; 942 int error;
943 943
944 if (blocks) {
945 offset = blocks << inode->i_blkbits; /* 64 bit goodness */
946 size = (ssize_t) min_t(xfs_off_t, offset, LONG_MAX);
947 } else {
948 size = 1 << inode->i_blkbits;
949 }
950 offset = (xfs_off_t)iblock << inode->i_blkbits; 944 offset = (xfs_off_t)iblock << inode->i_blkbits;
945 if (blocks)
946 size = (ssize_t) min_t(xfs_off_t, LONG_MAX,
947 (xfs_off_t)blocks << inode->i_blkbits);
948 else
949 size = 1 << inode->i_blkbits;
951 950
952 VOP_BMAP(vp, offset, size, 951 VOP_BMAP(vp, offset, size,
953 create ? flags : BMAPI_READ, &iomap, &retpbbm, error); 952 create ? flags : BMAPI_READ, &iomap, &retpbbm, error);
@@ -1007,7 +1006,7 @@ __linvfs_get_block(
1007 ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0); 1006 ASSERT(iomap.iomap_bsize - iomap.iomap_delta > 0);
1008 offset = min_t(xfs_off_t, 1007 offset = min_t(xfs_off_t,
1009 iomap.iomap_bsize - iomap.iomap_delta, 1008 iomap.iomap_bsize - iomap.iomap_delta,
1010 blocks << inode->i_blkbits); 1009 (xfs_off_t)blocks << inode->i_blkbits);
1011 bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset); 1010 bh_result->b_size = (u32) min_t(xfs_off_t, UINT_MAX, offset);
1012 } 1011 }
1013 1012