scoutfs: add scoutfs_key_is_zeros()

Add a little function for testing if a given scoutfs key is all zeros.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2020-08-26 14:39:12 -07:00
committed by Zach Brown
parent c98e75006e
commit 22716c0389
+7
View File
@@ -80,6 +80,13 @@ static inline void scoutfs_key_set_zeros(struct scoutfs_key *key)
key->_sk_fourth = 0;
}
static inline bool scoutfs_key_is_zeros(struct scoutfs_key *key)
{
return key->sk_zone == 0 && key->_sk_first == 0 && key->sk_type == 0 &&
key->_sk_second == 0 && key->_sk_third == 0 &&
key->_sk_fourth == 0;
}
static inline void scoutfs_key_copy_or_zeros(struct scoutfs_key *dst,
struct scoutfs_key *src)
{