[XFS] Create xfs_iflags_test_and_clear helper function
SGI-PV: 969608 SGI-Modid: xfs-linux-melb:xfs-kern:29496a Signed-off-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: David Chinner <dgc@sgi.com> Signed-off-by: Tim Shimmin <tes@sgi.com>
This commit is contained in:

committed by
Tim Shimmin

parent
b3aea4edc2
commit
09262b4339
@@ -360,6 +360,19 @@ xfs_iflags_test(xfs_inode_t *ip, unsigned short flags)
|
||||
spin_unlock(&ip->i_flags_lock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static inline int
|
||||
xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags)
|
||||
{
|
||||
int ret;
|
||||
|
||||
spin_lock(&ip->i_flags_lock);
|
||||
ret = ip->i_flags & flags;
|
||||
if (ret)
|
||||
ip->i_flags &= ~flags;
|
||||
spin_unlock(&ip->i_flags_lock);
|
||||
return ret;
|
||||
}
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user