提交 7ee8809d 编写于 作者: K Keith Busch 提交者: Jens Axboe

linux/kernel: introduce lower_48_bits function

Recent data integrity field enhancements allow reference tags to be up
to 48 bits. Introduce an inline helper function since this will be a
repeated operation.
Suggested-by: NBart Van Assche <bvanassche@acm.org>
Signed-off-by: NKeith Busch <kbusch@kernel.org>
Reviewed-by: NBart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20220303201312.3255347-5-kbusch@kernel.orgSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 c2ea5fcf
......@@ -63,6 +63,15 @@
} \
)
/**
* lower_48_bits() - return bits 0-47 of a number
* @n: the number we're accessing
*/
static inline u64 lower_48_bits(u64 n)
{
return n & ((1ull << 48) - 1);
}
/**
* upper_32_bits - return bits 32-63 of a number
* @n: the number we're accessing
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册