struct xfs_healthmon *hm;
rcu_read_lock();
- hm = mp->m_healthmon;
+ hm = rcu_dereference(mp->m_healthmon);
if (hm && !refcount_inc_not_zero(&hm->ref))
hm = NULL;
rcu_read_unlock();
struct xfs_healthmon *hm)
{
spin_lock(&xfs_healthmon_lock);
- if (mp->m_healthmon != NULL) {
+ if (rcu_access_pointer(mp->m_healthmon) != NULL) {
spin_unlock(&xfs_healthmon_lock);
return -EEXIST;
}
refcount_inc(&hm->ref);
- mp->m_healthmon = hm;
+ rcu_assign_pointer(mp->m_healthmon, hm);
hm->mount_cookie = (uintptr_t)mp->m_super;
spin_unlock(&xfs_healthmon_lock);
xfs_healthmon_detach(
struct xfs_healthmon *hm)
{
+ struct xfs_mount *mp;
+
spin_lock(&xfs_healthmon_lock);
if (hm->mount_cookie == DETACHED_MOUNT_COOKIE) {
spin_unlock(&xfs_healthmon_lock);
return;
}
- XFS_M((struct super_block *)hm->mount_cookie)->m_healthmon = NULL;
+ mp = XFS_M((struct super_block *)hm->mount_cookie);
+ rcu_assign_pointer(mp->m_healthmon, NULL);
hm->mount_cookie = DETACHED_MOUNT_COOKIE;
spin_unlock(&xfs_healthmon_lock);
struct xfs_hooks m_dir_update_hooks;
/* Private data referring to a health monitor object. */
- struct xfs_healthmon *m_healthmon;
+ struct xfs_healthmon __rcu *m_healthmon;
} xfs_mount_t;
#define M_IGEO(mp) (&(mp)->m_ino_geo)