aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kernel.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2022-03-26 12:01:35 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2022-03-26 12:01:35 -0700
commit3f7282139fe1594be464b90141d56738e7a0ea8a (patch)
tree2a6dfc4449ceeee6b5509c3fcc58c33865c89af6 /include/linux/kernel.h
parentMerge tag 'for-5.18/alloc-cleanups-2022-03-25' of git://git.kernel.dk/linux-block (diff)
parentcrypto: fix crc64 testmgr digest byte order (diff)
downloadlinux-dev-3f7282139fe1594be464b90141d56738e7a0ea8a.tar.xz
linux-dev-3f7282139fe1594be464b90141d56738e7a0ea8a.zip
Merge tag 'for-5.18/64bit-pi-2022-03-25' of git://git.kernel.dk/linux-block
Pull block layer 64-bit data integrity support from Jens Axboe: "This adds support for 64-bit data integrity in the block layer and in NVMe" * tag 'for-5.18/64bit-pi-2022-03-25' of git://git.kernel.dk/linux-block: crypto: fix crc64 testmgr digest byte order nvme: add support for enhanced metadata block: add pi for extended integrity crypto: add rocksoft 64b crc guard tag framework lib: add rocksoft model crc64 linux/kernel: introduce lower_48_bits function asm-generic: introduce be48 unaligned accessors nvme: allow integrity on extended metadata formats block: support pi with extended metadata
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r--include/linux/kernel.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index a890428bcc1a..08ba5995aa8b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -64,6 +64,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
*