mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
knfsd: Lockless lookup of NFSv4 identities.
Enable RCU protected lookups of the NFSv4 idmap. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
6d1616b26c
commit
9d5afd9491
@ -65,6 +65,7 @@ struct ent {
|
||||
u32 id;
|
||||
char name[IDMAP_NAMESZ];
|
||||
char authname[IDMAP_NAMESZ];
|
||||
struct rcu_head rcu_head;
|
||||
};
|
||||
|
||||
/* Common entry handling */
|
||||
@ -89,7 +90,7 @@ static void
|
||||
ent_put(struct kref *ref)
|
||||
{
|
||||
struct ent *map = container_of(ref, struct ent, h.ref);
|
||||
kfree(map);
|
||||
kfree_rcu(map, rcu_head);
|
||||
}
|
||||
|
||||
static struct cache_head *
|
||||
@ -264,8 +265,8 @@ idtoname_parse(struct cache_detail *cd, char *buf, int buflen)
|
||||
static struct ent *
|
||||
idtoname_lookup(struct cache_detail *cd, struct ent *item)
|
||||
{
|
||||
struct cache_head *ch = sunrpc_cache_lookup(cd, &item->h,
|
||||
idtoname_hash(item));
|
||||
struct cache_head *ch = sunrpc_cache_lookup_rcu(cd, &item->h,
|
||||
idtoname_hash(item));
|
||||
if (ch)
|
||||
return container_of(ch, struct ent, h);
|
||||
else
|
||||
@ -422,8 +423,8 @@ nametoid_parse(struct cache_detail *cd, char *buf, int buflen)
|
||||
static struct ent *
|
||||
nametoid_lookup(struct cache_detail *cd, struct ent *item)
|
||||
{
|
||||
struct cache_head *ch = sunrpc_cache_lookup(cd, &item->h,
|
||||
nametoid_hash(item));
|
||||
struct cache_head *ch = sunrpc_cache_lookup_rcu(cd, &item->h,
|
||||
nametoid_hash(item));
|
||||
if (ch)
|
||||
return container_of(ch, struct ent, h);
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user