xfs
[Top] [All Lists]

[PATCH] xfs: call roundup_64() to calculate the min_logblks

To: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>
Subject: [PATCH] xfs: call roundup_64() to calculate the min_logblks
From: Jeff Liu <jeff.liu@xxxxxxxxxx>
Date: Tue, 13 Aug 2013 13:32:00 +0800
Cc: kbuild test robot <fengguang.wu@xxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120410 Thunderbird/11.0.1
From: Jie Liu <jeff.liu@xxxxxxxxxx>

Replace roundup() with roundup_64() as we calculate min_logblks
with 64-bit divisions.  Hence, call roundup() will cause the
following error while compiling a 32-bit kernel:

fs/built-in.o: In function `xfs_log_calc_minimum_size':
fs/xfs/xfs_log_rlimit.c:140: undefined reference to `__udivdi3'

Reported-by: Fengguang Wu <fengguang.wu@xxxxxxxxx>
Cc: Dave Chinner <dchinner@xxxxxxxxxx>
Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx>
---
 fs/xfs/xfs_log_rlimit.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/xfs/xfs_log_rlimit.c b/fs/xfs/xfs_log_rlimit.c
index 6b17ef4..bbcec0b 100644
--- a/fs/xfs/xfs_log_rlimit.c
+++ b/fs/xfs/xfs_log_rlimit.c
@@ -136,10 +136,12 @@ xfs_log_calc_minimum_size(
         * Also, the log size should be a multiple of the log stripe unit, round
         * it up to lsunit boundary if lsunit is specified.
         */
-       if (lsunit)
-               min_logblks = roundup(BTOBB(max_logres), lsunit) + 2 * lsunit;
-       else
+       if (lsunit) {
+               min_logblks = roundup_64(BTOBB(max_logres), lsunit) +
+                             2 * lsunit;
+       } else
                min_logblks = BTOBB(max_logres) + 2 * BBSIZE;
        min_logblks *= XFS_MIN_LOG_FACTOR;
+
        return XFS_BB_TO_FSB(mp, min_logblks);
 }
-- 
1.7.9.5

<Prev in Thread] Current Thread [Next in Thread>