Skip to contentSkip to conversation

Use sgl_alloc_order() and sgl_free_order()

PATCH Applied Bart Van Assche 2 participants 5 messages Feb 12, 2018 – Feb 14, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Use sgl_alloc_order() and sgl_free_order()

Hello Martin,

In kernel v4.16-rc1 the functions sgl_alloc_order() and sgl_free_order() were introduced in lib/scatterlist.c. This patch series introduces these functions in the ipr and pmcraid SCSI drivers. Please consider these patches for kernel v4.17.

Thanks,

Bart.

Bart Van Assche (3):
scsi/ipr: Use sgl_alloc_order() and sgl_free_order() scsi/pmcraid: Remove an unused structure member scsi/pmcraid: Use sgl_alloc_order() and sgl_free_order()

 drivers/scsi/Kconfig   |  2 ++
 drivers/scsi/ipr.c     | 49 ++++++++-----------------------------------------
 drivers/scsi/ipr.h     |  2 +-
 drivers/scsi/pmcraid.c | 43 ++++---------------------------------------
 drivers/scsi/pmcraid.h |  3 +--
 5 files changed, 16 insertions(+), 83 deletions(-)
Signature · 1 line
2.16.1
#1 lore raw

PATCH 1/3 scsi/ipr: Use sgl_alloc_order() and sgl_free_order()

Use the sgl_alloc_order() and sgl_free_order() functions instead of open coding these functions.

---
 drivers/scsi/Kconfig |  1 +
 drivers/scsi/ipr.c   | 49 ++++++++-----------------------------------------
 drivers/scsi/ipr.h   |  2 +-
 3 files changed, 10 insertions(+), 42 deletions(-)
drivers/scsi/Kconfig +1 -0
index 8a739b74cfb7..7e3f6e37fb66 100644
@@ -1059,6 +1059,7 @@ config SCSI_IPR
 	depends on PCI && SCSI && ATA
 	select FW_LOADER
 	select IRQ_POLL
+	select SGL_ALLOC
 	---help---
 	  This driver supports the IBM Power Linux family RAID adapters.
 	  This includes IBM pSeries 5712, 5703, 5709, and 570A, as well
drivers/scsi/ipr.c +8 -41

74 lines not on this page · raw message

drivers/scsi/ipr.h +1 -1
index c7f0e9e3cd7d..93570734cbfb 100644
@@ -1454,7 +1454,7 @@ struct ipr_sglist {
 	u32 num_sg;
 	u32 num_dma_sg;
 	u32 buffer_len;
-	struct scatterlist scatterlist[1];
+	struct scatterlist *scatterlist;
 };
 
 enum ipr_sdt_state {
Signature · 1 line
2.16.1
#2 lore raw

PATCH 2/3 scsi/pmcraid: Remove an unused structure member

In reply to Bart Van Assche
---
 drivers/scsi/pmcraid.h | 1 -
 1 file changed, 1 deletion(-)
drivers/scsi/pmcraid.h +0 -1
index 8bfac72a242b..44da91712115 100644
@@ -542,7 +542,6 @@ struct pmcraid_sglist {
 	u32 order;
 	u32 num_sg;
 	u32 num_dma_sg;
-	u32 buffer_len;
 	struct scatterlist scatterlist[1];
 };
 
Signature · 1 line
2.16.1
#3 lore raw

PATCH 3/3 scsi/pmcraid: Use sgl_alloc_order() and sgl_free_order()

In reply to Bart Van Assche

Use the sgl_alloc_order() and sgl_free_order() functions instead of open coding these functions.

---
 drivers/scsi/Kconfig   |  1 +
 drivers/scsi/pmcraid.c | 43 ++++---------------------------------------
 drivers/scsi/pmcraid.h |  2 +-
 3 files changed, 6 insertions(+), 40 deletions(-)
drivers/scsi/Kconfig +1 -0
index 7e3f6e37fb66..8647ca9199b3 100644
@@ -1577,6 +1577,7 @@ config ZFCP
 config SCSI_PMCRAID
 	tristate "PMC SIERRA Linux MaxRAID adapter support"
 	depends on PCI && SCSI && NET
+	select SGL_ALLOC
 	---help---
 	  This driver supports the PMC SIERRA MaxRAID adapters.
 
drivers/scsi/pmcraid.c +4 -39

66 lines not on this page · raw message

drivers/scsi/pmcraid.h +1 -1
index 44da91712115..754ef30927e2 100644
@@ -542,7 +542,7 @@ struct pmcraid_sglist {
 	u32 order;
 	u32 num_sg;
 	u32 num_dma_sg;
-	struct scatterlist scatterlist[1];
+	struct scatterlist *scatterlist;
 };
 
 /* page D0 inquiry data of focal point resource */
Signature · 1 line
2.16.1
#4 lore raw
In reply to Bart Van Assche

Bart,

Quoted 4 lines

In kernel v4.16-rc1 the functions sgl_alloc_order() and sgl_free_order() were introduced in lib/scatterlist.c. This patch series introduces these functions in the ipr and pmcraid SCSI drivers. Please consider these patches for kernel v4.17.

Applied to 4.17/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering