Jeff Layton has uploaded this change for review.

View Change

rados_recov: convert rados_recov_oid to be RCU-managed gsh_refstr

In the big scheme of things, the rados_recov_oid changes very
infrequently, and only in response to a different server requesting a
grace period.

Change the rados_recov_oid to be managed with an atomic refcount and
RCU. The general pattern is to take the rcu_read_lock and atomically
bump the refcount and then release it. Once we are finished with the
string we drop the refcount.

When we need to change the string, we swap the old object with the new
with an xchg operation, and then call synchronize_rcu to wait for any
users of the old pointer to complete.

This allows us to fetch and update the thing locklessly but safely.

Change-Id: I6df9ce3f0f562b8d760d4c02311528bbe635d17b
Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
M src/SAL/recovery/recovery_rados.h
M src/SAL/recovery/recovery_rados_cluster.c
M src/SAL/recovery/recovery_rados_kv.c
M src/SAL/recovery/recovery_rados_ng.c
4 files changed, 126 insertions(+), 31 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/26/432326/1

To view, visit change 432326. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6df9ce3f0f562b8d760d4c02311528bbe635d17b
Gerrit-Change-Number: 432326
Gerrit-PatchSet: 1
Gerrit-Owner: Jeff Layton <jlayton@redhat.com>