fscache: Maintain a catalogue of allocated cookies
authorDavid Howells <dhowells@redhat.com>
Wed, 4 Apr 2018 12:41:28 +0000 (13:41 +0100)
committerDavid Howells <dhowells@redhat.com>
Fri, 6 Apr 2018 13:05:14 +0000 (14:05 +0100)
commitec0328e46d6e5d0f17372eb90ab8e333c2ac7ca9
tree0ff7cf689f4259baa44a5de789f72cdc015a1e30
parentee1235a9a06813429c201bf186397a6feeea07bf
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>
fs/fscache/cookie.c
fs/fscache/internal.h
fs/fscache/netfs.c
include/linux/fscache.h
include/trace/events/fscache.h