Skip to content

Commit fcf463b

Browse files
rleonaxboe
authored andcommitted
types: move phys_vec definition to common header
Move the struct phys_vec definition from block/blk-mq-dma.c to include/linux/types.h to make it available for use across the kernel. The phys_vec structure represents a physical address range with a length, which is used by the new physical address-based DMA mapping API. This structure is already used by the block layer and will be needed for DMA phys API users. Moving this definition to types.h provides a centralized location for this common data structure and eliminates code duplication across subsystems that need to work with physical address ranges. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 073b9bf commit fcf463b

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

block/blk-mq-dma.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
#include <linux/blk-mq-dma.h>
77
#include "blk.h"
88

9-
struct phys_vec {
10-
phys_addr_t paddr;
11-
size_t len;
12-
};
13-
149
static bool __blk_map_iter_next(struct blk_map_iter *iter)
1510
{
1611
if (iter->iter.bi_size)

include/linux/types.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ typedef u64 phys_addr_t;
171171
typedef u32 phys_addr_t;
172172
#endif
173173

174+
struct phys_vec {
175+
phys_addr_t paddr;
176+
size_t len;
177+
};
178+
174179
typedef phys_addr_t resource_size_t;
175180

176181
/*

0 commit comments

Comments
 (0)