diff options
author | David Howells <dhowells@redhat.com> | 2021-03-29 14:53:50 +0200 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2021-08-27 14:34:03 +0200 |
commit | 20ec197bfa13c5b799fc9527790ea7b5374fc8f2 (patch) | |
tree | 77224ac38587572748156ae6bf02835a74585afb /fs/fscache/cache.c | |
parent | fscache: Fix fscache_cookie_put() to not deref after dec (diff) | |
download | linux-20ec197bfa13c5b799fc9527790ea7b5374fc8f2.tar.xz linux-20ec197bfa13c5b799fc9527790ea7b5374fc8f2.zip |
fscache: Use refcount_t for the cookie refcount instead of atomic_t
Use refcount_t for the fscache_cookie refcount instead of atomic_t and
rename the 'usage' member to 'ref' in such cases. The tracepoints that
reference it change from showing "u=%d" to "r=%d".
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/162431204358.2908479.8006938388213098079.stgit@warthog.procyon.org.uk/
Diffstat (limited to 'fs/fscache/cache.c')
-rw-r--r-- | fs/fscache/cache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fscache/cache.c b/fs/fscache/cache.c index e7a5d7ab4085..bd4f44c1cce0 100644 --- a/fs/fscache/cache.c +++ b/fs/fscache/cache.c @@ -269,7 +269,7 @@ int fscache_add_cache(struct fscache_cache *cache, hlist_add_head(&ifsdef->cookie_link, &fscache_fsdef_index.backing_objects); - atomic_inc(&fscache_fsdef_index.usage); + refcount_inc(&fscache_fsdef_index.ref); /* done */ spin_unlock(&fscache_fsdef_index.lock); |