diff options
author | David Howells <dhowells@redhat.com> | 2018-04-04 13:41:28 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-04-06 14:05:14 +0100 |
commit | ec0328e46d6e5d0f17372eb90ab8e333c2ac7ca9 (patch) | |
tree | 0ff7cf689f4259baa44a5de789f72cdc015a1e30 /fs/fscache/internal.h | |
parent | ee1235a9a06813429c201bf186397a6feeea07bf (diff) |
fscache: Maintain a catalogue of allocated cookies
Maintain a catalogue of allocated cookies so that cookie collisions can be
handled properly. For the moment, this just involves printing a warning
and returning a NULL cookie to the caller of fscache_acquire_cookie(), but
in future it might make sense to wait for the old cookie to finish being
cleaned up.
This requires the cookie key to be stored attached to the cookie so that we
still have the key available if the netfs relinquishes the cookie. This is
done by an earlier patch.
The catalogue also renders redundant fscache_netfs_list (used for checking
for duplicates), so that can be removed.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Anna Schumaker <anna.schumaker@netapp.com>
Tested-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'fs/fscache/internal.h')
-rw-r--r-- | fs/fscache/internal.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fscache/internal.h b/fs/fscache/internal.h index 5f905a499306..500650f938fe 100644 --- a/fs/fscache/internal.h +++ b/fs/fscache/internal.h @@ -49,7 +49,14 @@ extern struct fscache_cache *fscache_select_cache_for_object( */ extern struct kmem_cache *fscache_cookie_jar; +extern void fscache_free_cookie(struct fscache_cookie *); extern void fscache_cookie_init_once(void *); +extern struct fscache_cookie *fscache_alloc_cookie(struct fscache_cookie *, + const struct fscache_cookie_def *, + const void *, size_t, + const void *, size_t, + void *, loff_t); +extern struct fscache_cookie *fscache_hash_cookie(struct fscache_cookie *); extern void fscache_cookie_put(struct fscache_cookie *, enum fscache_cookie_trace); |