scoutfs-utils: support small keys

Make the changes to support the new small key struct.  mkfs and print
work with simpler keys, segment items, and manifest entries.  The item
cache keys ioctl now just needs to work with arrays of keys.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2018-04-04 09:15:54 -05:00
committed by Mark Swan
parent 837310e8e6
commit 8e6c18a0fa
10 changed files with 422 additions and 640 deletions
+23
View File
@@ -0,0 +1,23 @@
#ifndef _SCOUTFS_CMP_H_
#define _SCOUTFS_CMP_H_
/*
* A generic ternary comparison macro with strict type checking.
*/
#define scoutfs_cmp(a, b) \
({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
int _ret; \
\
(void) (&_a == &_b); \
_ret = _a < _b ? -1 : _a > _b ? 1 : 0; \
_ret; \
})
static inline int scoutfs_cmp_u64s(u64 a, u64 b)
{
return a < b ? -1 : a > b ? 1 : 0;
}
#endif