Skip to content

Commit 5829586

Browse files
rleonkawasaki
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 by upcoming VFIO patches for dma-buf operations. 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 <[email protected]>
1 parent d9dcbd1 commit 5829586

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
@@ -5,11 +5,6 @@
55
#include <linux/blk-mq-dma.h>
66
#include "blk.h"
77

8-
struct phys_vec {
9-
phys_addr_t paddr;
10-
u32 len;
11-
};
12-
138
static bool blk_map_iter_next(struct request *req, struct req_iterator *iter,
149
struct phys_vec *vec)
1510
{

include/linux/types.h

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

173+
struct phys_vec {
174+
phys_addr_t paddr;
175+
u32 len;
176+
};
177+
173178
typedef phys_addr_t resource_size_t;
174179

175180
/*

0 commit comments

Comments
 (0)