mirror of
https://github.com/versity/scoutfs.git
synced 2026-04-22 22:40:31 +00:00
scoutfs: add zero key set and test functions
Add some quick functions to set a key to all zeros and to test if a key is all zeros. Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
@@ -100,4 +100,16 @@ static inline struct scoutfs_key *scoutfs_max_key(struct scoutfs_key *a,
|
||||
return scoutfs_key_cmp(a, b) > 0 ? a : b;
|
||||
}
|
||||
|
||||
static inline bool scoutfs_key_is_zero(struct scoutfs_key *key)
|
||||
{
|
||||
return key->inode == 0 && key->type == 0 && key->offset == 0;
|
||||
}
|
||||
|
||||
static inline void scoutfs_key_set_zero(struct scoutfs_key *key)
|
||||
{
|
||||
key->inode = 0;
|
||||
key->type = 0;
|
||||
key->offset = 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user