Skip to content

Commit ed63891

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: Rename .slave_alloc() and .slave_destroy()
Rename .slave_alloc() into .sdev_init() and .slave_destroy() into .sdev_destroy(). The new names make it clear that these are actions on SCSI devices. Make this change in the SCSI core, SCSI drivers and also in the ATA drivers. No functionality has been changed. This patch has been created as follows: * Change the text "slave_alloc" into "sdev_init" in all source files except those in drivers/net/ and Documentation/. * Change the text "slave_destroy" into "sdev_destroy" in all source files except those in drivers/net/ and Documentation/. * Rename lpfc_no_slave() into lpfc_no_sdev(). * Manually adjust whitespace where necessary to restore vertical alignment (dc395x driver and include/linux/libata.h). Acked-by: Damien Le Moal <[email protected]> Signed-off-by: Bart Van Assche <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 40384c8 commit ed63891

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+217
-217
lines changed

drivers/ata/libata-scsi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct queue_limits *lim,
11331133
}
11341134

11351135
/**
1136-
* ata_scsi_slave_alloc - Early setup of SCSI device
1136+
* ata_scsi_sdev_init - Early setup of SCSI device
11371137
* @sdev: SCSI device to examine
11381138
*
11391139
* This is called from scsi_alloc_sdev() when the scsi device
@@ -1143,7 +1143,7 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct queue_limits *lim,
11431143
* Defined by SCSI layer. We don't really care.
11441144
*/
11451145

1146-
int ata_scsi_slave_alloc(struct scsi_device *sdev)
1146+
int ata_scsi_sdev_init(struct scsi_device *sdev)
11471147
{
11481148
struct ata_port *ap = ata_shost_to_port(sdev->host);
11491149
struct device_link *link;
@@ -1166,7 +1166,7 @@ int ata_scsi_slave_alloc(struct scsi_device *sdev)
11661166

11671167
return 0;
11681168
}
1169-
EXPORT_SYMBOL_GPL(ata_scsi_slave_alloc);
1169+
EXPORT_SYMBOL_GPL(ata_scsi_sdev_init);
11701170

11711171
/**
11721172
* ata_scsi_device_configure - Set SCSI device attributes
@@ -1195,7 +1195,7 @@ int ata_scsi_device_configure(struct scsi_device *sdev,
11951195
EXPORT_SYMBOL_GPL(ata_scsi_device_configure);
11961196

11971197
/**
1198-
* ata_scsi_slave_destroy - SCSI device is about to be destroyed
1198+
* ata_scsi_sdev_destroy - SCSI device is about to be destroyed
11991199
* @sdev: SCSI device to be destroyed
12001200
*
12011201
* @sdev is about to be destroyed for hot/warm unplugging. If
@@ -1208,7 +1208,7 @@ EXPORT_SYMBOL_GPL(ata_scsi_device_configure);
12081208
* LOCKING:
12091209
* Defined by SCSI layer. We don't really care.
12101210
*/
1211-
void ata_scsi_slave_destroy(struct scsi_device *sdev)
1211+
void ata_scsi_sdev_destroy(struct scsi_device *sdev)
12121212
{
12131213
struct ata_port *ap = ata_shost_to_port(sdev->host);
12141214
unsigned long flags;
@@ -1228,7 +1228,7 @@ void ata_scsi_slave_destroy(struct scsi_device *sdev)
12281228

12291229
kfree(sdev->dma_drain_buf);
12301230
}
1231-
EXPORT_SYMBOL_GPL(ata_scsi_slave_destroy);
1231+
EXPORT_SYMBOL_GPL(ata_scsi_sdev_destroy);
12321232

12331233
/**
12341234
* ata_scsi_start_stop_xlat - Translate SCSI START STOP UNIT command

drivers/firewire/sbp2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,7 +1490,7 @@ static int sbp2_scsi_queuecommand(struct Scsi_Host *shost,
14901490
return retval;
14911491
}
14921492

1493-
static int sbp2_scsi_slave_alloc(struct scsi_device *sdev)
1493+
static int sbp2_scsi_sdev_init(struct scsi_device *sdev)
14941494
{
14951495
struct sbp2_logical_unit *lu = sdev->hostdata;
14961496

@@ -1590,7 +1590,7 @@ static const struct scsi_host_template scsi_driver_template = {
15901590
.name = "SBP-2 IEEE-1394",
15911591
.proc_name = "sbp2",
15921592
.queuecommand = sbp2_scsi_queuecommand,
1593-
.slave_alloc = sbp2_scsi_slave_alloc,
1593+
.sdev_init = sbp2_scsi_sdev_init,
15941594
.device_configure = sbp2_scsi_device_configure,
15951595
.eh_abort_handler = sbp2_scsi_abort,
15961596
.this_id = -1,

drivers/message/fusion/mptfc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static u8 mptfcTaskCtx = MPT_MAX_PROTOCOL_DRIVERS;
9696
static u8 mptfcInternalCtx = MPT_MAX_PROTOCOL_DRIVERS;
9797

9898
static int mptfc_target_alloc(struct scsi_target *starget);
99-
static int mptfc_slave_alloc(struct scsi_device *sdev);
99+
static int mptfc_sdev_init(struct scsi_device *sdev);
100100
static int mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt);
101101
static void mptfc_target_destroy(struct scsi_target *starget);
102102
static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout);
@@ -113,10 +113,10 @@ static const struct scsi_host_template mptfc_driver_template = {
113113
.info = mptscsih_info,
114114
.queuecommand = mptfc_qcmd,
115115
.target_alloc = mptfc_target_alloc,
116-
.slave_alloc = mptfc_slave_alloc,
116+
.sdev_init = mptfc_sdev_init,
117117
.slave_configure = mptscsih_slave_configure,
118118
.target_destroy = mptfc_target_destroy,
119-
.slave_destroy = mptscsih_slave_destroy,
119+
.sdev_destroy = mptscsih_sdev_destroy,
120120
.change_queue_depth = mptscsih_change_queue_depth,
121121
.eh_timed_out = fc_eh_timed_out,
122122
.eh_abort_handler = mptfc_abort,
@@ -503,7 +503,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
503503
/*
504504
* if already mapped, remap here. If not mapped,
505505
* target_alloc will allocate vtarget and map,
506-
* slave_alloc will fill in vdevice from vtarget.
506+
* sdev_init will fill in vdevice from vtarget.
507507
*/
508508
if (ri->starget) {
509509
vtarget = ri->starget->hostdata;
@@ -631,7 +631,7 @@ mptfc_dump_lun_info(MPT_ADAPTER *ioc, struct fc_rport *rport, struct scsi_device
631631
* Init memory once per LUN.
632632
*/
633633
static int
634-
mptfc_slave_alloc(struct scsi_device *sdev)
634+
mptfc_sdev_init(struct scsi_device *sdev)
635635
{
636636
MPT_SCSI_HOST *hd;
637637
VirtTarget *vtarget;
@@ -651,7 +651,7 @@ mptfc_slave_alloc(struct scsi_device *sdev)
651651

652652
vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
653653
if (!vdevice) {
654-
printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n",
654+
printk(MYIOC_s_ERR_FMT "sdev_init kmalloc(%zd) FAILED!\n",
655655
ioc->name, sizeof(VirtDevice));
656656
return -ENOMEM;
657657
}

drivers/message/fusion/mptsas.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,7 +1867,7 @@ mptsas_target_destroy(struct scsi_target *starget)
18671867

18681868

18691869
static int
1870-
mptsas_slave_alloc(struct scsi_device *sdev)
1870+
mptsas_sdev_init(struct scsi_device *sdev)
18711871
{
18721872
struct Scsi_Host *host = sdev->host;
18731873
MPT_SCSI_HOST *hd = shost_priv(host);
@@ -1880,7 +1880,7 @@ mptsas_slave_alloc(struct scsi_device *sdev)
18801880

18811881
vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
18821882
if (!vdevice) {
1883-
printk(MYIOC_s_ERR_FMT "slave_alloc kzalloc(%zd) FAILED!\n",
1883+
printk(MYIOC_s_ERR_FMT "sdev_init kzalloc(%zd) FAILED!\n",
18841884
ioc->name, sizeof(VirtDevice));
18851885
return -ENOMEM;
18861886
}
@@ -2005,10 +2005,10 @@ static const struct scsi_host_template mptsas_driver_template = {
20052005
.info = mptscsih_info,
20062006
.queuecommand = mptsas_qcmd,
20072007
.target_alloc = mptsas_target_alloc,
2008-
.slave_alloc = mptsas_slave_alloc,
2008+
.sdev_init = mptsas_sdev_init,
20092009
.slave_configure = mptsas_slave_configure,
20102010
.target_destroy = mptsas_target_destroy,
2011-
.slave_destroy = mptscsih_slave_destroy,
2011+
.sdev_destroy = mptscsih_sdev_destroy,
20122012
.change_queue_depth = mptscsih_change_queue_depth,
20132013
.eh_timed_out = mptsas_eh_timed_out,
20142014
.eh_abort_handler = mptscsih_abort,

drivers/message/fusion/mptscsih.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ EXPORT_SYMBOL(mptscsih_flush_running_cmds);
10711071
*
10721072
* Returns: None.
10731073
*
1074-
* Called from slave_destroy.
1074+
* Called from sdev_destroy.
10751075
*/
10761076
static void
10771077
mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice)
@@ -2331,7 +2331,7 @@ EXPORT_SYMBOL(mptscsih_raid_id_to_num);
23312331
* Called if no device present or device being unloaded
23322332
*/
23332333
void
2334-
mptscsih_slave_destroy(struct scsi_device *sdev)
2334+
mptscsih_sdev_destroy(struct scsi_device *sdev)
23352335
{
23362336
struct Scsi_Host *host = sdev->host;
23372337
MPT_SCSI_HOST *hd = shost_priv(host);
@@ -3302,7 +3302,7 @@ EXPORT_SYMBOL(mptscsih_resume);
33023302
EXPORT_SYMBOL(mptscsih_show_info);
33033303
EXPORT_SYMBOL(mptscsih_info);
33043304
EXPORT_SYMBOL(mptscsih_qcmd);
3305-
EXPORT_SYMBOL(mptscsih_slave_destroy);
3305+
EXPORT_SYMBOL(mptscsih_sdev_destroy);
33063306
EXPORT_SYMBOL(mptscsih_slave_configure);
33073307
EXPORT_SYMBOL(mptscsih_abort);
33083308
EXPORT_SYMBOL(mptscsih_dev_reset);

drivers/message/fusion/mptscsih.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ extern const char * mptscsih_info(struct Scsi_Host *SChost);
116116
extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt);
117117
extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel,
118118
u8 id, u64 lun, int ctx2abort, ulong timeout);
119-
extern void mptscsih_slave_destroy(struct scsi_device *device);
119+
extern void mptscsih_sdev_destroy(struct scsi_device *device);
120120
extern int mptscsih_slave_configure(struct scsi_device *device);
121121
extern int mptscsih_abort(struct scsi_cmnd * SCpnt);
122122
extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt);

drivers/message/fusion/mptspi.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ static void mptspi_dv_device(struct _MPT_SCSI_HOST *hd,
713713
mptspi_read_parameters(sdev->sdev_target);
714714
}
715715

716-
static int mptspi_slave_alloc(struct scsi_device *sdev)
716+
static int mptspi_sdev_init(struct scsi_device *sdev)
717717
{
718718
MPT_SCSI_HOST *hd = shost_priv(sdev->host);
719719
VirtTarget *vtarget;
@@ -727,7 +727,7 @@ static int mptspi_slave_alloc(struct scsi_device *sdev)
727727

728728
vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
729729
if (!vdevice) {
730-
printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n",
730+
printk(MYIOC_s_ERR_FMT "sdev_init kmalloc(%zd) FAILED!\n",
731731
ioc->name, sizeof(VirtDevice));
732732
return -ENOMEM;
733733
}
@@ -799,7 +799,7 @@ mptspi_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt)
799799
return mptscsih_qcmd(SCpnt);
800800
}
801801

802-
static void mptspi_slave_destroy(struct scsi_device *sdev)
802+
static void mptspi_sdev_destroy(struct scsi_device *sdev)
803803
{
804804
struct scsi_target *starget = scsi_target(sdev);
805805
VirtTarget *vtarget = starget->hostdata;
@@ -817,7 +817,7 @@ static void mptspi_slave_destroy(struct scsi_device *sdev)
817817
mptspi_write_spi_device_pg1(starget, &pg1);
818818
}
819819

820-
mptscsih_slave_destroy(sdev);
820+
mptscsih_sdev_destroy(sdev);
821821
}
822822

823823
static const struct scsi_host_template mptspi_driver_template = {
@@ -828,10 +828,10 @@ static const struct scsi_host_template mptspi_driver_template = {
828828
.info = mptscsih_info,
829829
.queuecommand = mptspi_qcmd,
830830
.target_alloc = mptspi_target_alloc,
831-
.slave_alloc = mptspi_slave_alloc,
831+
.sdev_init = mptspi_sdev_init,
832832
.slave_configure = mptspi_slave_configure,
833833
.target_destroy = mptspi_target_destroy,
834-
.slave_destroy = mptspi_slave_destroy,
834+
.sdev_destroy = mptspi_sdev_destroy,
835835
.change_queue_depth = mptscsih_change_queue_depth,
836836
.eh_abort_handler = mptscsih_abort,
837837
.eh_device_reset_handler = mptscsih_dev_reset,

drivers/s390/scsi/zfcp_scsi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ static bool allow_lun_scan = true;
3737
module_param(allow_lun_scan, bool, 0600);
3838
MODULE_PARM_DESC(allow_lun_scan, "For NPIV, scan and attach all storage LUNs");
3939

40-
static void zfcp_scsi_slave_destroy(struct scsi_device *sdev)
40+
static void zfcp_scsi_sdev_destroy(struct scsi_device *sdev)
4141
{
4242
struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
4343

44-
/* if previous slave_alloc returned early, there is nothing to do */
44+
/* if previous sdev_init returned early, there is nothing to do */
4545
if (!zfcp_sdev->port)
4646
return;
4747

@@ -110,7 +110,7 @@ int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt)
110110
return ret;
111111
}
112112

113-
static int zfcp_scsi_slave_alloc(struct scsi_device *sdev)
113+
static int zfcp_scsi_sdev_init(struct scsi_device *sdev)
114114
{
115115
struct fc_rport *rport = starget_to_rport(scsi_target(sdev));
116116
struct zfcp_adapter *adapter =
@@ -427,9 +427,9 @@ static const struct scsi_host_template zfcp_scsi_host_template = {
427427
.eh_device_reset_handler = zfcp_scsi_eh_device_reset_handler,
428428
.eh_target_reset_handler = zfcp_scsi_eh_target_reset_handler,
429429
.eh_host_reset_handler = zfcp_scsi_eh_host_reset_handler,
430-
.slave_alloc = zfcp_scsi_slave_alloc,
430+
.sdev_init = zfcp_scsi_sdev_init,
431431
.slave_configure = zfcp_scsi_slave_configure,
432-
.slave_destroy = zfcp_scsi_slave_destroy,
432+
.sdev_destroy = zfcp_scsi_sdev_destroy,
433433
.change_queue_depth = scsi_change_queue_depth,
434434
.host_reset = zfcp_scsi_sysfs_host_reset,
435435
.proc_name = "zfcp",

drivers/s390/scsi/zfcp_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static bool zfcp_sysfs_port_in_use(struct zfcp_port *const port)
284284
goto unlock_host_lock;
285285
}
286286

287-
/* port is about to be removed, so no more unit_add or slave_alloc */
287+
/* port is about to be removed, so no more unit_add or sdev_init */
288288
zfcp_sysfs_port_set_removing(port);
289289
in_use = false;
290290

drivers/s390/scsi/zfcp_unit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun)
170170
write_unlock_irq(&port->unit_list_lock);
171171
/*
172172
* lock order: shost->scan_mutex before zfcp_sysfs_port_units_mutex
173-
* due to zfcp_unit_scsi_scan() => zfcp_scsi_slave_alloc()
173+
* due to zfcp_unit_scsi_scan() => zfcp_scsi_sdev_init()
174174
*/
175175
mutex_unlock(&zfcp_sysfs_port_units_mutex);
176176

0 commit comments

Comments
 (0)