Whamcloud - gitweb
LU-12400 lnet: Infiniband sg_dma changes for linux 5.1
[fs/lustre-release.git] / lnet / klnds / o2iblnd / o2iblnd.h
index 111133c..fd6f97c 100644 (file)
@@ -1122,6 +1122,12 @@ static inline void kiblnd_dma_unmap_sg(struct ib_device *dev,
         ib_dma_unmap_sg(dev, sg, nents, direction);
 }
 
+#ifndef HAVE_IB_SG_DMA_ADDRESS
+#include <linux/scatterlist.h>
+#define ib_sg_dma_address(dev, sg)     sg_dma_address((dev), (sg))
+#define ib_sg_dma_len(dev, sg)         sg_dma_len((dev), (sg))
+#endif
+
 static inline __u64 kiblnd_sg_dma_address(struct ib_device *dev,
                                           struct scatterlist *sg)
 {