IB: expand ib_umem_get() prototype
Add a new parameter, dmasync, to the ib_umem_get() prototype. Use dmasync = 1 when mapping user-allocated CQs with ib_umem_get(). Signed-off-by: Arthur Kepner <akepner@sgi.com> Cc: Tony Luck <tony.luck@intel.com> Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: Jes Sorensen <jes@sgi.com> Cc: Randy Dunlap <randy.dunlap@oracle.com> Cc: Roland Dreier <rdreier@cisco.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: David Miller <davem@davemloft.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Grant Grundler <grundler@parisc-linux.org> Cc: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
309df0c503
commit
cb9fbc5c37
@@ -62,7 +62,7 @@ struct ib_umem_chunk {
|
||||
#ifdef CONFIG_INFINIBAND_USER_MEM
|
||||
|
||||
struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
|
||||
size_t size, int access);
|
||||
size_t size, int access, int dmasync);
|
||||
void ib_umem_release(struct ib_umem *umem);
|
||||
int ib_umem_page_count(struct ib_umem *umem);
|
||||
|
||||
@@ -72,7 +72,7 @@ int ib_umem_page_count(struct ib_umem *umem);
|
||||
|
||||
static inline struct ib_umem *ib_umem_get(struct ib_ucontext *context,
|
||||
unsigned long addr, size_t size,
|
||||
int access) {
|
||||
int access, int dmasync) {
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
static inline void ib_umem_release(struct ib_umem *umem) { }
|
||||
|
@@ -1542,6 +1542,24 @@ static inline void ib_dma_unmap_single(struct ib_device *dev,
|
||||
dma_unmap_single(dev->dma_device, addr, size, direction);
|
||||
}
|
||||
|
||||
static inline u64 ib_dma_map_single_attrs(struct ib_device *dev,
|
||||
void *cpu_addr, size_t size,
|
||||
enum dma_data_direction direction,
|
||||
struct dma_attrs *attrs)
|
||||
{
|
||||
return dma_map_single_attrs(dev->dma_device, cpu_addr, size,
|
||||
direction, attrs);
|
||||
}
|
||||
|
||||
static inline void ib_dma_unmap_single_attrs(struct ib_device *dev,
|
||||
u64 addr, size_t size,
|
||||
enum dma_data_direction direction,
|
||||
struct dma_attrs *attrs)
|
||||
{
|
||||
return dma_unmap_single_attrs(dev->dma_device, addr, size,
|
||||
direction, attrs);
|
||||
}
|
||||
|
||||
/**
|
||||
* ib_dma_map_page - Map a physical page to DMA address
|
||||
* @dev: The device for which the dma_addr is to be created
|
||||
@@ -1611,6 +1629,21 @@ static inline void ib_dma_unmap_sg(struct ib_device *dev,
|
||||
dma_unmap_sg(dev->dma_device, sg, nents, direction);
|
||||
}
|
||||
|
||||
static inline int ib_dma_map_sg_attrs(struct ib_device *dev,
|
||||
struct scatterlist *sg, int nents,
|
||||
enum dma_data_direction direction,
|
||||
struct dma_attrs *attrs)
|
||||
{
|
||||
return dma_map_sg_attrs(dev->dma_device, sg, nents, direction, attrs);
|
||||
}
|
||||
|
||||
static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev,
|
||||
struct scatterlist *sg, int nents,
|
||||
enum dma_data_direction direction,
|
||||
struct dma_attrs *attrs)
|
||||
{
|
||||
dma_unmap_sg_attrs(dev->dma_device, sg, nents, direction, attrs);
|
||||
}
|
||||
/**
|
||||
* ib_sg_dma_address - Return the DMA address from a scatter/gather entry
|
||||
* @dev: The device for which the DMA addresses were created
|
||||
|
Reference in New Issue
Block a user