[PATCH] xfsprogs: simplify xfs_calc_dquots_per_chunk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The do_div call was commented out because userspace's
do_div is not safe to call with a 32-bit dividend.

Just keep the simple division and remove the other cruft,
we'll change the kernel to match as well; there is no need
for do_div here.

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

diff --git a/libxfs/xfs_dquot_buf.c b/libxfs/xfs_dquot_buf.c
index aae8854..a19a20a 100644
--- a/libxfs/xfs_dquot_buf.c
+++ b/libxfs/xfs_dquot_buf.c
@@ -29,27 +29,12 @@
 #include "xfs_trace.h"
 #include "xfs_quota_defs.h"
 
-/*
- * XXX: kernel implementation causes ndquots calc to go real
- * bad. Just leaving the existing userspace calc here right now.
- */
 int
 xfs_calc_dquots_per_chunk(
 	unsigned int		nbblks)	/* basic block units */
 {
-
 	ASSERT(nbblks > 0);
 	return BBTOB(nbblks) / sizeof(xfs_dqblk_t);
-
-#if 0	/* kernel code that goes wrong in userspace! */
-	unsigned int	ndquots;
-
-	ASSERT(nbblks > 0);
-	ndquots = BBTOB(nbblks);
-	do_div(ndquots, sizeof(xfs_dqblk_t));
-
-	return ndquots;
-#endif
 }
 
 /*

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux