diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2013-10-15 15:18:08 +0100 |
---|---|---|
committer | Maciej Wereski <m.wereski@partner.samsung.com> | 2015-03-18 09:47:13 +0100 |
commit | bd25783f5de4a4810ffdcd62bfa6eacef0677e88 (patch) | |
tree | 1fbc02578d4a1f4baadb9eb396c7b90db2192bf2 /lib | |
parent | 8dbee4c3560e80a8501a85bac4048a2ede38fee1 (diff) | |
download | linux-3.10-bd25783f5de4a4810ffdcd62bfa6eacef0677e88.tar.gz linux-3.10-bd25783f5de4a4810ffdcd62bfa6eacef0677e88.tar.bz2 linux-3.10-bd25783f5de4a4810ffdcd62bfa6eacef0677e88.zip |
GFS2: Use lockref for glocks
Currently glocks have an atomic reference count and also a spinlock
which covers various internal fields, such as the state. This intent of
this patch is to replace the spinlock and the atomic reference count
with a lockref structure. This contains a spinlock which we can continue
to use as before, and a reference counter which is used in conjuction
with the spinlock to replace the previous atomic counter.
As a result of this there are some new rules for reference counting on
glocks. We need to distinguish between reference count changes under
gl_spin (which are now just increment or decrement of the new counter,
provided the count cannot hit zero) and those which are outside of
gl_spin, but which now take gl_spin internally.
The conversion is relatively straight forward. There is probably some
further clean up which can be done, but the priority at this stage is to
make the change in as simple a manner as possible.
A consequence of this change is that the reference count is being
decoupled from the lru list processing. This should allow future
adoption of the lru_list code with glocks in due course.
The reason for using the "dead" state and not just relying on 0 being
the "invalid state" is so that in due course 0 ref counts can be
allowable. The intent is to eventually be able to remove the ref count
changes which are currently hidden away in state_change().
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lockref.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/lockref.c b/lib/lockref.c index 82deca5d7ed..caf79fdadd9 100644 --- a/lib/lockref.c +++ b/lib/lockref.c @@ -153,6 +153,7 @@ void lockref_mark_dead(struct lockref *lockref) assert_spin_locked(&lockref->lock); lockref->count = -128; } +EXPORT_SYMBOL(lockref_mark_dead); /** * lockref_get_not_dead - Increments count unless the ref is dead |