diff options
author | Christoph Hellwig <hch@infradead.org> | 2007-08-29 11:44:50 +1000 |
---|---|---|
committer | Tim Shimmin <tes@chook.melbourne.sgi.com> | 2007-10-16 11:38:36 +1000 |
commit | 09262b4339de5417a10803fbfac277eebb38ca5a (patch) | |
tree | b375b3c7c221a9b696e44e7faf94ee0df2323078 /fs/xfs/xfs_inode.h | |
parent | b3aea4edc2903fdee34920630b8b2433f6452f02 (diff) | |
download | op-kernel-dev-09262b4339de5417a10803fbfac277eebb38ca5a.zip op-kernel-dev-09262b4339de5417a10803fbfac277eebb38ca5a.tar.gz |
[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>
Diffstat (limited to 'fs/xfs/xfs_inode.h')
-rw-r--r-- | fs/xfs/xfs_inode.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 79d7246..ea1e24e 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -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__ */ |