Re: [PATCH v2 11/12] ext4: simplify i_state checks in __ext4_update_other_inode_time()

Christoph Hellwig
2021-01-11T10:54:26Z

On Fri, Jan 08, 2021 at 11:59:02PM -0800, Eric Biggers wrote:
> if ((inode->i_state & (I_FREEING | I_WILL_FREE | I_NEW |
> - I_DIRTY_INODE)) ||
> - ((inode->i_state & I_DIRTY_TIME) == 0))
> + I_DIRTY_TIME)) != I_DIRTY_TIME)
> return;
>
> spin_lock(&inode->i_lock);
> - if (((inode->i_state & (I_FREEING | I_WILL_FREE | I_NEW |
> - I_DIRTY_INODE)) == 0) &&
> - (inode->i_state & I_DIRTY_TIME)) {
> + if ((inode->i_state & (I_FREEING | I_WILL_FREE | I_NEW |
> + I_DIRTY_TIME)) == I_DIRTY_TIME) {

I think a descriptively named inline helper in fs.h would really improve
this..