mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 00:00:52 +07:00
drivers/scsi: Replace rcu_swap_protected() with rcu_replace_pointer()
This commit replaces the use of rcu_swap_protected() with the more intuitively appealing rcu_replace_pointer() as a step towards removing rcu_swap_protected(). Link: https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=Z7-GGtM6wcvtyytXZA1+BHqta4gg6Hw@mail.gmail.com/ Reported-by: Linus Torvalds <torvalds@linux-foundation.org> [ paulmck: From rcu_replace() to rcu_replace_pointer() per Ingo Molnar. ] Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Acked-by: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: "James E.J. Bottomley" <jejb@linux.ibm.com> Cc: <linux-scsi@vger.kernel.org> Cc: <linux-kernel@vger.kernel.org>
This commit is contained in:
parent
1feace5d6a
commit
c0eaf15cd5
@ -434,8 +434,8 @@ static void scsi_update_vpd_page(struct scsi_device *sdev, u8 page,
|
||||
return;
|
||||
|
||||
mutex_lock(&sdev->inquiry_mutex);
|
||||
rcu_swap_protected(*sdev_vpd_buf, vpd_buf,
|
||||
lockdep_is_held(&sdev->inquiry_mutex));
|
||||
vpd_buf = rcu_replace_pointer(*sdev_vpd_buf, vpd_buf,
|
||||
lockdep_is_held(&sdev->inquiry_mutex));
|
||||
mutex_unlock(&sdev->inquiry_mutex);
|
||||
|
||||
if (vpd_buf)
|
||||
|
@ -466,10 +466,10 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
|
||||
sdev->request_queue = NULL;
|
||||
|
||||
mutex_lock(&sdev->inquiry_mutex);
|
||||
rcu_swap_protected(sdev->vpd_pg80, vpd_pg80,
|
||||
lockdep_is_held(&sdev->inquiry_mutex));
|
||||
rcu_swap_protected(sdev->vpd_pg83, vpd_pg83,
|
||||
lockdep_is_held(&sdev->inquiry_mutex));
|
||||
vpd_pg80 = rcu_replace_pointer(sdev->vpd_pg80, vpd_pg80,
|
||||
lockdep_is_held(&sdev->inquiry_mutex));
|
||||
vpd_pg83 = rcu_replace_pointer(sdev->vpd_pg83, vpd_pg83,
|
||||
lockdep_is_held(&sdev->inquiry_mutex));
|
||||
mutex_unlock(&sdev->inquiry_mutex);
|
||||
|
||||
if (vpd_pg83)
|
||||
|
Loading…
Reference in New Issue
Block a user