Thread (2 messages) 2 messages, 2 authors, 2026-08-18

Re: [PATCH v4] scsi: core: Drop Scsi_Host.default_lock

flat view

From: Hannes Reinecke <hare@suse.de>
Date: 2026-08-18 10:33:22
Also in: linux-ide, linux-s390, linux-scsi, linux-usb, lkml

On 8/17/26 9:53 AM, John Garry wrote:
From: John Garry <redacted>

Back in the 2.6.xx days, it was possible to for low-level drivers to set
the shost lock pointer. That is why there is a default lock and a pointer
to the shost lock.

However, support for this has long been removed, so drop
Scsi_Host.default_lock and make Scsi_Host.host_lock as the actual lock.

Getting the address of embedded host_lock structure just requires adding
a fixed offset value to the shost pointer. However, getting the value of
the host_lock pointer requires loading from a fixed offset to the shost
pointer. The latter should be very slightly slower, which is relevant as
this lock is used a lot throughout the core code and drivers.

Signed-off-by: John Garry <john.g.garry@oracle.com>
Acked-by: Damien Le Moal <dlemoal@kernel.org> # ata parts
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
---
Difference to v3:
- Rebase and update some annotations

Differences to v2:
- Add tags from Bart and Damien (Thanks!)
- Update Documentation reference to default_lock (Bart)
Reviewed-by: Hannes Reinecke <hare@kernel.org>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help