xfs
[Top] [All Lists]

Re: [PATCH v2 7/8] xfs: Add xfs_log_rlimit.[c|h]

To: Jeff Liu <jeff.liu@xxxxxxxxxx>
Subject: Re: [PATCH v2 7/8] xfs: Add xfs_log_rlimit.[c|h]
From: "Michael L. Semon" <mlsemon35@xxxxxxxxx>
Date: Fri, 17 May 2013 04:36:35 -0400
Cc: "xfs@xxxxxxxxxxx" <xfs@xxxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=n9DXKejepiFVwHlq5fFvj0Ti6671WDz4zFO77qshydY=; b=F3mX0AwSqzkuz2AFZLtuHF606aWaVd88/qpoMUZSHIGY6b3vBwB94gwXPOFr8zhLj0 x/6KmN3dM8MQu5rIzwA+H4atQ4ii5vUrlFaIcP/Yznw/852/y8OwuRfsHtudAE1dcS8m uRp75hx6TatiILd4VaPhZHlkYYQSPikzThgGH+5j1bzLldx4B3g9LpmrgWhSnrKx/IFD surtnmGQGui+wBI22W1gj4Oo3Ox8ZSwIzyY4NFib47HSuAliHBJ2KOjRaY/mrVkuVttD gy84GwyuipCg4fCgwQUZriILkSVEuip4/IVqqFLkUToJuYze7bkUp8Ozou68j66WOMHS j5yQ==
In-reply-to: <5195C279.3060502@xxxxxxxxxx>
References: <5195C279.3060502@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130509 Thunderbird/17.0.6
On 05/17/2013 01:39 AM, Jeff Liu wrote:
From: Jie Liu <jeff.liu@xxxxxxxxxx>

Add source files for xfs_log_rlimit.[c|h].
The new source would be used for the log space validation.

Update: To build the kernel, I'm getting by on a sysadmin hack that looks like this:

--- linux/fs/xfs/xfs_log_rlimit.c.orig  2013-05-17 03:36:28.983493357 -0400
+++ linux/fs/xfs/xfs_log_rlimit.c       2013-05-17 04:21:07.090661828 -0400
@@ -127,8 +127,10 @@
         * Also, the log size should be a multiple of the log stripe unit, round
         * it up to lsunit boundary if lsunit is specified.
         */
-       minlblks = lsunit ? (roundup(BTOBB(maxlres), lsunit) + 2 * lsunit) * 2 :
-                           BTOBB(maxlres) * 2;
+       minlblks = lsunit ?
+               (roundup((const int)(BTOBB(maxlres)), lsunit) +
+               2 * lsunit) * 2 :
+                       BTOBB(maxlres) * 2;

        if (log->l_logBBsize < minlblks) {
                xfs_crit(mp,

However, that makes no sense. There is a roundup in <linux/kernel.h> that goes like this:

/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
#define roundup(x, y) (                                 \
{                                                       \
        const typeof(y) __y = y;                        \
        (((x) + (__y - 1)) / __y) * __y;                \
}                                                       \
)

Okay, so that gave me the inspiration to cast the type so gcc-4.8.0 wouldn't call __divdi3. But why did this make a difference?

Disclaimer: I'm not a C macro guru, so I don't know which random sequence of punctuation keys would make roundup() happy.

Michael

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