summary refs log tree commit diff
path: root/fs/xfs/xfs_vnodeops.c
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2006-09-28 10:56:26 +1000
committerTim Shimmin <tes@sgi.com>2006-09-28 10:56:26 +1000
commit673cdf5c72ff9551df08a71f2ac1a8fe02888e8d (patch)
tree94857685aa78d1b1edc7f526a961ff59549cf415 /fs/xfs/xfs_vnodeops.c
parent87395deb0b3d174ffcc7f66569764f0715ac5174 (diff)
downloadlinux-673cdf5c72ff9551df08a71f2ac1a8fe02888e8d.tar.gz
[XFS] Fix rounding bug in xfs_free_file_space found by sparse checking.
SGI-PV: 954580
SGI-Modid: xfs-linux-melb:xfs-kern:26551a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r--fs/xfs/xfs_vnodeops.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
index 23cfa5837728..4fbc3e1cac00 100644
--- a/fs/xfs/xfs_vnodeops.c
+++ b/fs/xfs/xfs_vnodeops.c
@@ -4272,7 +4272,7 @@ xfs_free_file_space(
 	xfs_mount_t		*mp;
 	int			nimap;
 	uint			resblks;
-	int			rounding;
+	uint			rounding;
 	int			rt;
 	xfs_fileoff_t		startoffset_fsb;
 	xfs_trans_t		*tp;
@@ -4313,8 +4313,7 @@ xfs_free_file_space(
 		vn_iowait(vp);	/* wait for the completion of any pending DIOs */
 	}
 
-	rounding = MAX((__uint8_t)(1 << mp->m_sb.sb_blocklog),
-			(__uint8_t)NBPP);
+	rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, NBPP);
 	ilen = len + (offset & (rounding - 1));
 	ioffset = offset & ~(rounding - 1);
 	if (ilen & (rounding - 1))