xfs
[Top] [All Lists]

Re: [PATCH 9/9] Clean up open coded inode dirty checks

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 9/9] Clean up open coded inode dirty checks
From: Jan Engelhardt <jengelh@xxxxxxxxxxxxxxx>
Date: Fri, 23 Nov 2007 19:16:08 +0100 (CET)
Cc: David Chinner <dgc@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx>, lkml <linux-kernel@xxxxxxxxxxxxxxx>
In-reply-to: <20071123180239.GA13229@xxxxxxxxxxxxx>
References: <20071122004422.GO114266761@xxxxxxx> <20071123180239.GA13229@xxxxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
On Nov 23 2007 18:02, Christoph Hellwig wrote:
>
>> +STATIC_INLINE int xfs_inode_clean(xfs_inode_t *ip)
>> +{
>> +    return (((ip->i_itemp == NULL) ||
>> +            !(ip->i_itemp->ili_format.ilf_fields & XFS_ILOG_ALL)) &&
>> +            (ip->i_update_core == 0));
>> +}
>
>Can we please get rid of this useless STATIC_INLINE junk?  It's really
>hurting my eyes.
>
>As does to a lesser extent the verbose style of this
>function.

I have to disagree, but whatever.

>static inline int xfs_inode_clean(struct xfs_inode *ip)
               ^                   ^
could be bool - and const
>{
>       return (!ip->i_itemp ||
>               !(ip->i_itemp->ili_format.ilf_fields & XFS_ILOG_ALL)) &&
>              !ip->i_update_core;
>}

Perhaps for greater readability:

static inline bool xfs_inode_clean(const struct xfs_inode *ip)
{
        if (ip->i_itemp == NULL)
                return true;
        if (!(ip->i_itemp->ili_format.ilf_fields & XFS_ILOG_ALL) &&
            ip->i_update_core == NULL)
                return true;
        return false;
}


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