lkml.org 
[lkml]   [2007]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 9/9] Clean up open coded inode dirty checks

On Nov 23 2007 11:47, Joe Perches wrote:
>On Fri, 2007-11-23 at 19:16 +0100, Jan Engelhardt wrote:
>> 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;
>> }
>
>Your code changed the test.

See - the previous cryptic constructs could not even be decoded ;-)

>xfs_inode.i_update_core is an unsigned char.
>
>I believe reordering the tests to avoid a possibly
>unnecessary dereference is better.
>
> if (ip->i_update_core)
> return false;
> if (!ip->i_itemp)
> return true;
> return ip->i_itemp->ili_format.ilf_fields & XFS_ILOG_ALL;

Yeah, something like that.

Note: the function SHOULD return bool for this, to quash the
ilf_fields & XFS_ILOG_ALL into 0/1.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-23 21:19    [W:0.031 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site