提交 52953d55 编写于 作者: S Seraphime Kirkovski 提交者: Ilya Dryomov

ceph: cleanup ACCESS_ONCE -> READ_ONCE

This removes the uses of ACCESS_ONCE in favor of READ_ONCE
Signed-off-by: NSeraphime Kirkovski <kirkseraph@gmail.com>
Signed-off-by: NYan, Zheng <zyan@redhat.com>
上级 ca6c8ae0
...@@ -771,7 +771,7 @@ static int ceph_writepages_start(struct address_space *mapping, ...@@ -771,7 +771,7 @@ static int ceph_writepages_start(struct address_space *mapping,
wbc->sync_mode == WB_SYNC_NONE ? "NONE" : wbc->sync_mode == WB_SYNC_NONE ? "NONE" :
(wbc->sync_mode == WB_SYNC_ALL ? "ALL" : "HOLD")); (wbc->sync_mode == WB_SYNC_ALL ? "ALL" : "HOLD"));
if (ACCESS_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { if (READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) {
if (ci->i_wrbuffer_ref > 0) { if (ci->i_wrbuffer_ref > 0) {
pr_warn_ratelimited( pr_warn_ratelimited(
"writepage_start %p %lld forced umount\n", "writepage_start %p %lld forced umount\n",
...@@ -1194,7 +1194,7 @@ static int ceph_update_writeable_page(struct file *file, ...@@ -1194,7 +1194,7 @@ static int ceph_update_writeable_page(struct file *file,
int r; int r;
struct ceph_snap_context *snapc, *oldest; struct ceph_snap_context *snapc, *oldest;
if (ACCESS_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { if (READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) {
dout(" page %p forced umount\n", page); dout(" page %p forced umount\n", page);
unlock_page(page); unlock_page(page);
return -EIO; return -EIO;
......
...@@ -2477,7 +2477,7 @@ static int try_get_cap_refs(struct ceph_inode_info *ci, int need, int want, ...@@ -2477,7 +2477,7 @@ static int try_get_cap_refs(struct ceph_inode_info *ci, int need, int want,
if (ci->i_ceph_flags & CEPH_I_CAP_DROPPED) { if (ci->i_ceph_flags & CEPH_I_CAP_DROPPED) {
int mds_wanted; int mds_wanted;
if (ACCESS_ONCE(mdsc->fsc->mount_state) == if (READ_ONCE(mdsc->fsc->mount_state) ==
CEPH_MOUNT_SHUTDOWN) { CEPH_MOUNT_SHUTDOWN) {
dout("get_cap_refs %p forced umount\n", inode); dout("get_cap_refs %p forced umount\n", inode);
*err = -EIO; *err = -EIO;
......
...@@ -1194,7 +1194,7 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags) ...@@ -1194,7 +1194,7 @@ static int ceph_d_revalidate(struct dentry *dentry, unsigned int flags)
struct inode *dir; struct inode *dir;
if (flags & LOOKUP_RCU) { if (flags & LOOKUP_RCU) {
parent = ACCESS_ONCE(dentry->d_parent); parent = READ_ONCE(dentry->d_parent);
dir = d_inode_rcu(parent); dir = d_inode_rcu(parent);
if (!dir) if (!dir)
return -ECHILD; return -ECHILD;
......
...@@ -1720,7 +1720,7 @@ static void ceph_invalidate_work(struct work_struct *work) ...@@ -1720,7 +1720,7 @@ static void ceph_invalidate_work(struct work_struct *work)
mutex_lock(&ci->i_truncate_mutex); mutex_lock(&ci->i_truncate_mutex);
if (ACCESS_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { if (READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) {
pr_warn_ratelimited("invalidate_pages %p %lld forced umount\n", pr_warn_ratelimited("invalidate_pages %p %lld forced umount\n",
inode, ceph_ino(inode)); inode, ceph_ino(inode));
mapping_set_error(inode->i_mapping, -EIO); mapping_set_error(inode->i_mapping, -EIO);
......
...@@ -1166,7 +1166,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap, ...@@ -1166,7 +1166,7 @@ static int remove_session_caps_cb(struct inode *inode, struct ceph_cap *cap,
ci->i_ceph_flags |= CEPH_I_CAP_DROPPED; ci->i_ceph_flags |= CEPH_I_CAP_DROPPED;
if (ci->i_wrbuffer_ref > 0 && if (ci->i_wrbuffer_ref > 0 &&
ACCESS_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) READ_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN)
invalidate = true; invalidate = true;
while (!list_empty(&ci->i_cap_flush_list)) { while (!list_empty(&ci->i_cap_flush_list)) {
...@@ -2126,12 +2126,12 @@ static int __do_request(struct ceph_mds_client *mdsc, ...@@ -2126,12 +2126,12 @@ static int __do_request(struct ceph_mds_client *mdsc,
err = -EIO; err = -EIO;
goto finish; goto finish;
} }
if (ACCESS_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) {
dout("do_request forced umount\n"); dout("do_request forced umount\n");
err = -EIO; err = -EIO;
goto finish; goto finish;
} }
if (ACCESS_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_MOUNTING) { if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_MOUNTING) {
if (mdsc->mdsmap_err) { if (mdsc->mdsmap_err) {
err = mdsc->mdsmap_err; err = mdsc->mdsmap_err;
dout("do_request mdsmap err %d\n", err); dout("do_request mdsmap err %d\n", err);
...@@ -3586,7 +3586,7 @@ void ceph_mdsc_sync(struct ceph_mds_client *mdsc) ...@@ -3586,7 +3586,7 @@ void ceph_mdsc_sync(struct ceph_mds_client *mdsc)
{ {
u64 want_tid, want_flush; u64 want_tid, want_flush;
if (ACCESS_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN)
return; return;
dout("sync\n"); dout("sync\n");
...@@ -3617,7 +3617,7 @@ void ceph_mdsc_sync(struct ceph_mds_client *mdsc) ...@@ -3617,7 +3617,7 @@ void ceph_mdsc_sync(struct ceph_mds_client *mdsc)
*/ */
static bool done_closing_sessions(struct ceph_mds_client *mdsc, int skipped) static bool done_closing_sessions(struct ceph_mds_client *mdsc, int skipped)
{ {
if (ACCESS_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) if (READ_ONCE(mdsc->fsc->mount_state) == CEPH_MOUNT_SHUTDOWN)
return true; return true;
return atomic_read(&mdsc->num_sessions) <= skipped; return atomic_read(&mdsc->num_sessions) <= skipped;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册