Skip to contentSkip to conversation

tcm: Drop legacy struct se_subsystem_api->get_dev_info() caller

PATCH New Nicholas A. Bellinger 1 participant 1 message Nov 9, 2010

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

PATCH 1/1 tcm: Drop legacy struct se_subsystem_api->get_dev_info() caller

From: Nicholas Bellinger <[email protected]>

This patch drops the last of the v2.x IOCTL inspired informational code for backend plugins that has long since gone the way of /dev/null in practice, but contines to live on in a currently PAGE_SIZE limited existence in:

/sys/kernel/config/target/core/$HBA/$DEV/info

This patch follow hch's recommendation to fix up the backend code for the struct se_subsystem_api->show_configfs_dev_params() caller and drops all legacy *_get_dev_info() cruft.

---
 drivers/target/target_core_file.c      |   33 ++++----------
 drivers/target/target_core_iblock.c    |   44 ++++++------------
 drivers/target/target_core_pscsi.c     |   55 +++++++++---------------
 drivers/target/target_core_rd.c        |   36 +++------------
 drivers/target/target_core_stgt.c      |   74 +++----------------------------
 drivers/target/target_core_transport.c |   58 -------------------------
 include/target/target_core_transport.h |    4 --
 7 files changed, 60 insertions(+), 244 deletions(-)
drivers/target/target_core_file.c +9 -24
index 34ab402..f9bcaa7 100644
@@ -56,8 +56,6 @@
 
 static struct se_subsystem_api fileio_template;
 
-static void __fd_get_dev_info(struct fd_dev *, char *, int *);
-
 /*	fd_attach_hba(): (Part of se_subsystem_api_t template)
  *
  *
@@ -735,18 +733,6 @@ static ssize_t fd_check_configfs_dev_params(struct se_hba *hba, struct se_subsys
 	return 0;
 }
 
-static ssize_t fd_show_configfs_dev_params(
-	struct se_hba *hba,
-	struct se_subsystem_dev *se_dev,
-	char *page)
-{
-	struct fd_dev *fd_dev = (struct fd_dev *) se_dev->se_dev_su_ptr;
-	int bl = 0;
-
-	__fd_get_dev_info(fd_dev, page, &bl);
-	return (ssize_t)bl;
-}
-
 static void fd_get_plugin_info(void *p, char *b, int *bl)
 {
 	*bl += sprintf(b + *bl, "TCM FILEIO Plugin %s\n", FD_VERSION);
@@ -761,20 +747,20 @@ static void fd_get_hba_info(struct se_hba *hba, char *b, int *bl)
 	*bl += sprintf(b + *bl, "        TCM FILEIO HBA\n");
 }
 
-static void fd_get_dev_info(struct se_device *dev, char *b, int *bl)
+static ssize_t fd_show_configfs_dev_params(
+	struct se_hba *hba,
+	struct se_subsystem_dev *se_dev,
+	char *b)
 {
-	struct fd_dev *fd_dev = dev->dev_ptr;
-
-	__fd_get_dev_info(fd_dev, b, bl);
-}
+	struct fd_dev *fd_dev = se_dev->se_dev_su_ptr;
+	ssize_t bl = 0;
 
-static void __fd_get_dev_info(struct fd_dev *fd_dev, char *b, int *bl)
-{
-	*bl += sprintf(b + *bl, "TCM FILEIO ID: %u", fd_dev->fd_dev_id);
-	*bl += sprintf(b + *bl, "        File: %s  Size: %llu  Mode: %s\n",
+	bl = sprintf(b + bl, "TCM FILEIO ID: %u", fd_dev->fd_dev_id);
+	bl += sprintf(b + bl, "        File: %s  Size: %llu  Mode: %s\n",
 		fd_dev->fd_dev_name, fd_dev->fd_dev_size,
 		(fd_dev->fbd_flags & FDBD_USE_BUFFERED_IO) ?
 		"Buffered" : "Synchronous");
+	return bl;
 }
 
 /*	fd_map_task_non_SG():
@@ -972,7 +958,6 @@ static struct se_subsystem_api fileio_template = {
 	.show_configfs_dev_params = fd_show_configfs_dev_params,
 	.get_plugin_info	= fd_get_plugin_info,
 	.get_hba_info		= fd_get_hba_info,
-	.get_dev_info		= fd_get_dev_info,
 	.check_lba		= fd_check_lba,
 	.check_for_SG		= fd_check_for_SG,
 	.get_cdb		= fd_get_cdb,
drivers/target/target_core_iblock.c +15 -29

84 lines not on this page · raw message

drivers/target/target_core_pscsi.c +20 -35

106 lines not on this page · raw message

drivers/target/target_core_rd.c +8 -28
index 226c8ca..9740e32 100644
@@ -47,8 +47,6 @@
 static struct se_subsystem_api rd_dr_template;
 static struct se_subsystem_api rd_mcp_template;
 
-static void __rd_get_dev_info(struct rd_dev *, char *, int *);
-
 /* #define DEBUG_RAMDISK_MCP */
 /* #define DEBUG_RAMDISK_DR */
 
@@ -1057,18 +1055,6 @@ static ssize_t rd_check_configfs_dev_params(struct se_hba *hba, struct se_subsys
 	return 0;
 }
 
-static ssize_t rd_show_configfs_dev_params(
-	struct se_hba *hba,
-	struct se_subsystem_dev *se_dev,
-	char *page)
-{
-	struct rd_dev *rd_dev = se_dev->se_dev_su_ptr;
-	int bl = 0;
-
-	 __rd_get_dev_info(rd_dev, page, &bl);
-	return (ssize_t)bl;
-}
-
 static void rd_dr_get_plugin_info(void *p, char *b, int *bl)
 {
 	*bl += sprintf(b + *bl, "TCM RAMDISK_DR Plugin %s\n", RD_DR_VERSION);
@@ -1088,23 +1074,19 @@ static void rd_get_hba_info(struct se_hba *hba, char *b, int *bl)
 	*bl += sprintf(b + *bl, "        TCM RamDisk HBA\n");
 }
 
-static void rd_get_dev_info(struct se_device *dev, char *b, int *bl)
-{
-	struct rd_dev *rd_dev = dev->dev_ptr;
-
-	__rd_get_dev_info(rd_dev, b, bl);
-}
-
-static void __rd_get_dev_info(struct rd_dev *rd_dev, char *b, int *bl)
+static ssize_t rd_show_configfs_dev_params(
+	struct se_hba *hba,
+	struct se_subsystem_dev *se_dev,
+	char *b)
 {
-	*bl += sprintf(b + *bl, "TCM RamDisk ID: %u  RamDisk Makeup: %s\n",
+	struct rd_dev *rd_dev = se_dev->se_dev_su_ptr;
+	ssize_t bl = sprintf(b, "TCM RamDisk ID: %u  RamDisk Makeup: %s\n",
 			rd_dev->rd_dev_id, (rd_dev->rd_direct) ?
 			"rd_direct" : "rd_mcp");
-	*bl += sprintf(b + *bl, "        PAGES/PAGE_SIZE: %u*%lu"
+	bl += sprintf(b + bl, "        PAGES/PAGE_SIZE: %u*%lu"
 			"  SG_table_count: %u\n", rd_dev->rd_page_count,
 			PAGE_SIZE, rd_dev->sg_table_count);
-
-	return;
+	return bl;
 }
 
 /*	rd_map_task_non_SG():
@@ -1300,7 +1282,6 @@ static struct se_subsystem_api rd_dr_template = {
 	.show_configfs_dev_params = rd_show_configfs_dev_params,
 	.get_plugin_info	= rd_dr_get_plugin_info,
 	.get_hba_info		= rd_get_hba_info,
-	.get_dev_info		= rd_get_dev_info,
 	.check_lba		= rd_DIRECT_check_lba,
 	.check_for_SG		= rd_check_for_SG,
 	.get_cdb		= rd_get_cdb,
@@ -1334,7 +1315,6 @@ static struct se_subsystem_api rd_mcp_template = {
 	.show_configfs_dev_params = rd_show_configfs_dev_params,
 	.get_plugin_info	= rd_mcp_get_plugin_info,
 	.get_hba_info		= rd_get_hba_info,
-	.get_dev_info		= rd_get_dev_info,
 	.check_lba		= rd_MEMCPY_check_lba,
 	.check_for_SG		= rd_check_for_SG,
 	.get_cdb		= rd_get_cdb,
drivers/target/target_core_stgt.c +8 -66

103 lines not on this page · raw message

drivers/target/target_core_transport.c +0 -58

64 lines not on this page · raw message

include/target/target_core_transport.h +0 -4
index a2e6ef9..dbf4f59 100644
@@ -475,10 +475,6 @@ struct se_subsystem_api {
 	 */
 	void (*get_hba_info)(struct se_hba *, char *, int *);
 	/*
-	 * get_dev_info():
-	 */
-	void (*get_dev_info)(struct se_device *, char *, int *);
-	/*
 	 * check_lba():
 	 */
 	int (*check_lba)(unsigned long long lba, struct se_device *);
Signature · 1 line
1.5.6.5