UBIFS: harmonize znode flag helpers
We have 3 znode flags: cow, obsolete, dirty. For the last flag we have a 'ubifs_zn_dirty()' helper function, but for the other 2 flags we use 'test_bit()' directly. This patch makes the situation more consistent and introduces helpers for the other 2 flags: 'ubifs_zn_cow()' and 'ubifs_zn_obsolete()'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
This commit is contained in:

committed by
Artem Bityutskiy

parent
1f42596ec0
commit
f42eed7cba
@@ -38,6 +38,29 @@ static inline int ubifs_zn_dirty(const struct ubifs_znode *znode)
|
||||
return !!test_bit(DIRTY_ZNODE, &znode->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* ubifs_zn_obsolete - check if znode is obsolete.
|
||||
* @znode: znode to check
|
||||
*
|
||||
* This helper function returns %1 if @znode is obsolete and %0 otherwise.
|
||||
*/
|
||||
static inline int ubifs_zn_obsolete(const struct ubifs_znode *znode)
|
||||
{
|
||||
return !!test_bit(OBSOLETE_ZNODE, &znode->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* ubifs_zn_cow - check if znode has to be copied on write.
|
||||
* @znode: znode to check
|
||||
*
|
||||
* This helper function returns %1 if @znode is has COW flag set and %0
|
||||
* otherwise.
|
||||
*/
|
||||
static inline int ubifs_zn_cow(const struct ubifs_znode *znode)
|
||||
{
|
||||
return !!test_bit(COW_ZNODE, &znode->flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* ubifs_wake_up_bgt - wake up background thread.
|
||||
* @c: UBIFS file-system description object
|
||||
|
Reference in New Issue
Block a user