Message ID | 63892ea2d5c1b429e828ac270b517fbd05d5bd77.1739756953.git.naohiro.aota@wdc.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | btrfs-progs: zoned: support zone capacity and | expand |
diff --git a/include/kerncompat.h b/include/kerncompat.h index 42c84460c1e5..e95bb4a53342 100644 --- a/include/kerncompat.h +++ b/include/kerncompat.h @@ -127,6 +127,16 @@ } #endif +/** + * min_not_zero - return the minimum that is _not_ zero, unless both are zero + * @x: value1 + * @y: value2 + */ +#define min_not_zero(x, y) ({ \ + typeof(x) __x = (x); \ + typeof(y) __y = (y); \ + __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); }) + static inline void print_trace(void) { #ifndef BTRFS_DISABLE_BACKTRACE
Introduce min_not_zero() macro from the kernel. Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> --- include/kerncompat.h | 10 ++++++++++ 1 file changed, 10 insertions(+)