Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ceph: cleanup ACCESS_ONCE -> READ_ONCE

This removes the uses of ACCESS_ONCE in favor of READ_ONCE

Signed-off-by: Seraphime Kirkovski <kirkseraph@gmail.com>
Signed-off-by: Yan, Zheng <zyan@redhat.com>

authored by

Seraphime Kirkovski and committed by
Ilya Dryomov
52953d55 ca6c8ae0

+10 -10
+2 -2
fs/ceph/addr.c
··· 771 771 wbc->sync_mode == WB_SYNC_NONE ? "NONE" : 772 772 (wbc->sync_mode == WB_SYNC_ALL ? "ALL" : "HOLD")); 773 773 774 - if (ACCESS_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { 774 + if (READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { 775 775 if (ci->i_wrbuffer_ref > 0) { 776 776 pr_warn_ratelimited( 777 777 "writepage_start %p %lld forced umount\n", ··· 1194 1194 int r; 1195 1195 struct ceph_snap_context *snapc, *oldest; 1196 1196 1197 - if (ACCESS_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { 1197 + if (READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { 1198 1198 dout(" page %p forced umount\n", page); 1199 1199 unlock_page(page); 1200 1200 return -EIO;
+1 -1
fs/ceph/caps.c
··· 2477 2477 2478 2478 if (ci->i_ceph_flags & CEPH_I_CAP_DROPPED) { 2479 2479 int mds_wanted; 2480 - if (ACCESS_ONCE(mdsc->fsc->mount_state) == 2480 + if (READ_ONCE(mdsc->fsc->mount_state) == 2481 2481 CEPH_MOUNT_SHUTDOWN) { 2482 2482 dout("get_cap_refs %p forced umount\n", inode); 2483 2483 *err = -EIO;
+1 -1
fs/ceph/dir.c
··· 1194 1194 struct inode *dir; 1195 1195 1196 1196 if (flags & LOOKUP_RCU) { 1197 - parent = ACCESS_ONCE(dentry->d_parent); 1197 + parent = READ_ONCE(dentry->d_parent); 1198 1198 dir = d_inode_rcu(parent); 1199 1199 if (!dir) 1200 1200 return -ECHILD;
+1 -1
fs/ceph/inode.c
··· 1720 1720 1721 1721 mutex_lock(&ci->i_truncate_mutex); 1722 1722 1723 - if (ACCESS_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { 1723 + if (READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { 1724 1724 pr_warn_ratelimited("invalidate_pages %p %lld forced umount\n", 1725 1725 inode, ceph_ino(inode)); 1726 1726 mapping_set_error(inode->i_mapping, -EIO);
+5 -5
fs/ceph/mds_client.c
··· 1166 1166 ci->i_ceph_flags |= CEPH_I_CAP_DROPPED; 1167 1167 1168 1168 if (ci->i_wrbuffer_ref > 0 && 1169 - ACCESS_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) 1169 + READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) 1170 1170 invalidate = true; 1171 1171 1172 1172 while (!list_empty(&ci->i_cap_flush_list)) { ··· 2126 2126 err = -EIO; 2127 2127 goto finish; 2128 2128 } 2129 - if (ACCESS_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { 2129 + if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { 2130 2130 dout("do_request forced umount\n"); 2131 2131 err = -EIO; 2132 2132 goto finish; 2133 2133 } 2134 - if (ACCESS_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_MOUNTING) { 2134 + if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_MOUNTING) { 2135 2135 if (mdsc->mdsmap_err) { 2136 2136 err = mdsc->mdsmap_err; 2137 2137 dout("do_request mdsmap err %d\n", err); ··· 3586 3586 { 3587 3587 u64 want_tid, want_flush; 3588 3588 3589 - if (ACCESS_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) 3589 + if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) 3590 3590 return; 3591 3591 3592 3592 dout("sync\n"); ··· 3617 3617 */ 3618 3618 static bool done_closing_sessions(struct ceph_mds_client *mdsc, int skipped) 3619 3619 { 3620 - if (ACCESS_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) 3620 + if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) 3621 3621 return true; 3622 3622 return atomic_read(&mdsc->num_sessions) <= skipped; 3623 3623 }