diff --git a/scst/include/backport.h b/scst/include/backport.h index 98b21fd60..560396f99 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -69,12 +69,12 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q) #endif #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) && !defined(READ_ONCE) /* - * See also patch "Move ACCESS_ONCE() to " (commit ID - * 9c3cdc1f83a6e07092392ff4aba6466517dbd1d0). + * See also patch "kernel: Provide READ_ONCE and ASSIGN_ONCE" (commit ID + * 230fa253df6352af12ad0a16128760b5cb3f92df). */ -#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) +#define READ_ONCE(x) (*(volatile typeof(x) *)&(x)) #endif /* */ diff --git a/scst/include/scst.h b/scst/include/scst.h index e0aa9bdb9..38438714c 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -2793,7 +2793,7 @@ struct scst_device { ** Dev's control mode page related values. Updates serialized ** by device blocking. Since device blocking protects only ** commands on the execution stage, in all other read cases - ** use ACCESS_ONCE(), if necessary. Modified independently + ** use READ_ONCE(), if necessary. Modified independently ** to the above fields, hence the alignment. *************************************************************/ diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index 33a2cc7ed..aef91f8b0 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -3495,7 +3495,7 @@ static int dev_user_register_dev(struct file *file, } /* * Assumption here is that the private_data reading is atomic, - * hence could be lockless and without ACCESS_ONCE(). + * hence could be lockless and without READ_ONCE(). */ file->private_data = dev; spin_unlock(&dev_list_lock); diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 9d7e5dfd8..b6dd0b69a 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -148,7 +148,7 @@ struct scst_vdisk_dev { /* * Not protected, because assignments to aligned 64-bit integers are - * atomic. At worst, accesses to it should be covered by ACCESS_ONCE(), + * atomic. At worst, accesses to it should be covered by READ_ONCE(), * but not sure if that is really needed, so would prefer to keep it * away from the fast path. */ @@ -8789,7 +8789,7 @@ static ssize_t vdev_size_show(struct kobject *kobj, struct kobj_attribute *attr, dev = container_of(kobj, struct scst_device, dev_kobj); virt_dev = dev->dh_priv; - size = ACCESS_ONCE(virt_dev->file_size); + size = READ_ONCE(virt_dev->file_size); if (virt_dev->nullio && size == VDISK_NULLIO_SIZE) key = false; diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 3131b01ee..6ad4cdb29 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -13525,7 +13525,7 @@ static void scst_process_qerr(struct scst_cmd *cmd) /* dev->qerr can be changed behind our back */ q = dev->qerr; - qerr = ACCESS_ONCE(q); /* ACCESS_ONCE doesn't work for bit fields */ + qerr = READ_ONCE(q); /* READ_ONCE() doesn't work for bit fields */ TRACE_DBG("Processing QErr %d for cmd %p", qerr, cmd); diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 7c6fdf46e..687d32405 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -3483,8 +3483,8 @@ static ssize_t scst_dev_block_show(struct kobject *kobj, dev = container_of(kobj, struct scst_device, dev_kobj); - pos = sprintf(buf, "%d %d\n", ACCESS_ONCE(dev->ext_blocks_cnt), - dev->ext_blocking_pending); + pos = sprintf(buf, "%d %d\n", READ_ONCE(dev->ext_blocks_cnt), + dev->ext_blocking_pending); TRACE_EXIT_RES(pos); return pos; diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 455d37ebf..cdcc21542 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -3669,7 +3669,7 @@ static inline bool scst_check_alua(struct scst_cmd *cmd, int *out_res) int (*alua_filter)(struct scst_cmd *cmd); bool res = false; - alua_filter = ACCESS_ONCE(cmd->tgt_dev->alua_filter); + alua_filter = READ_ONCE(cmd->tgt_dev->alua_filter); if (unlikely(alua_filter)) { int ac = alua_filter(cmd); @@ -3806,7 +3806,7 @@ static int scst_exec_check_sn(struct scst_cmd **active_cmd) EXTRACHECKS_BUG_ON(!cmd->sn_set); - expected_sn = ACCESS_ONCE(order_data->expected_sn); + expected_sn = READ_ONCE(order_data->expected_sn); /* Optimized for lockless fast path */ if ((cmd->sn != expected_sn) || (order_data->hq_cmd_count > 0)) { spin_lock_irq(&order_data->sn_lock);