Skip to content

Commit 868e613

Browse files
keithbuschaxboe
authored andcommitted
block: move lower_48_bits() to block
The function is not generally applicable enough to be included in the core kernel header. Move it to block since it's the only subsystem using it. Suggested-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Keith Busch <kbusch@kernel.org> Link: https://lore.kernel.org/r/20220327173316.315-1-kbusch@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 2869019 commit 868e613

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

include/linux/kernel.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,6 @@
6363
} \
6464
)
6565

66-
/**
67-
* lower_48_bits() - return bits 0-47 of a number
68-
* @n: the number we're accessing
69-
*/
70-
static inline u64 lower_48_bits(u64 n)
71-
{
72-
return n & ((1ull << 48) - 1);
73-
}
74-
7566
/**
7667
* upper_32_bits - return bits 32-63 of a number
7768
* @n: the number we're accessing

include/linux/t10-pi.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ struct crc64_pi_tuple {
5959
__u8 ref_tag[6];
6060
};
6161

62+
/**
63+
* lower_48_bits() - return bits 0-47 of a number
64+
* @n: the number we're accessing
65+
*/
66+
static inline u64 lower_48_bits(u64 n)
67+
{
68+
return n & ((1ull << 48) - 1);
69+
}
70+
6271
static inline u64 ext_pi_ref_tag(struct request *rq)
6372
{
6473
unsigned int shift = ilog2(queue_logical_block_size(rq->q));

0 commit comments

Comments
 (0)