Skip to content

Commit

Permalink
block: move lower_48_bits() to block
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Keith Busch authored and Jens Axboe committed Apr 12, 2022
1 parent 2869019 commit 868e613
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 0 additions & 9 deletions include/linux/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@
} \
)

/**
* 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
Expand Down
9 changes: 9 additions & 0 deletions include/linux/t10-pi.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ struct crc64_pi_tuple {
__u8 ref_tag[6];
};

/**
* 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);
}

static inline u64 ext_pi_ref_tag(struct request *rq)
{
unsigned int shift = ilog2(queue_logical_block_size(rq->q));
Expand Down

0 comments on commit 868e613

Please sign in to comment.