diff options
Diffstat (limited to 'fs/nfsd/nfs4idmap.c')
-rw-r--r-- | fs/nfsd/nfs4idmap.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index 75cfbb68b205..4b6aa60dfceb 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c | |||
@@ -96,12 +96,10 @@ ent_init(struct cache_head *cnew, struct cache_head *citm) | |||
96 | } | 96 | } |
97 | 97 | ||
98 | static void | 98 | static void |
99 | ent_put(struct cache_head *ch, struct cache_detail *cd) | 99 | ent_put(struct kref *ref) |
100 | { | 100 | { |
101 | if (cache_put(ch, cd)) { | 101 | struct ent *map = container_of(ref, struct ent, h.ref); |
102 | struct ent *map = container_of(ch, struct ent, h); | 102 | kfree(map); |
103 | kfree(map); | ||
104 | } | ||
105 | } | 103 | } |
106 | 104 | ||
107 | static struct cache_head * | 105 | static struct cache_head * |
@@ -270,7 +268,7 @@ idtoname_parse(struct cache_detail *cd, char *buf, int buflen) | |||
270 | if (res == NULL) | 268 | if (res == NULL) |
271 | goto out; | 269 | goto out; |
272 | 270 | ||
273 | ent_put(&res->h, &idtoname_cache); | 271 | cache_put(&res->h, &idtoname_cache); |
274 | 272 | ||
275 | error = 0; | 273 | error = 0; |
276 | out: | 274 | out: |
@@ -433,7 +431,7 @@ nametoid_parse(struct cache_detail *cd, char *buf, int buflen) | |||
433 | if (res == NULL) | 431 | if (res == NULL) |
434 | goto out; | 432 | goto out; |
435 | 433 | ||
436 | ent_put(&res->h, &nametoid_cache); | 434 | cache_put(&res->h, &nametoid_cache); |
437 | error = 0; | 435 | error = 0; |
438 | out: | 436 | out: |
439 | kfree(buf1); | 437 | kfree(buf1); |
@@ -562,7 +560,7 @@ do_idmap_lookup_nowait(struct ent *(*lookup_fn)(struct ent *), | |||
562 | goto out_put; | 560 | goto out_put; |
563 | return 0; | 561 | return 0; |
564 | out_put: | 562 | out_put: |
565 | ent_put(&(*item)->h, detail); | 563 | cache_put(&(*item)->h, detail); |
566 | out_err: | 564 | out_err: |
567 | *item = NULL; | 565 | *item = NULL; |
568 | return ret; | 566 | return ret; |
@@ -613,7 +611,7 @@ idmap_name_to_id(struct svc_rqst *rqstp, int type, const char *name, u32 namelen | |||
613 | if (ret) | 611 | if (ret) |
614 | return ret; | 612 | return ret; |
615 | *id = item->id; | 613 | *id = item->id; |
616 | ent_put(&item->h, &nametoid_cache); | 614 | cache_put(&item->h, &nametoid_cache); |
617 | return 0; | 615 | return 0; |
618 | } | 616 | } |
619 | 617 | ||
@@ -635,7 +633,7 @@ idmap_id_to_name(struct svc_rqst *rqstp, int type, uid_t id, char *name) | |||
635 | ret = strlen(item->name); | 633 | ret = strlen(item->name); |
636 | BUG_ON(ret > IDMAP_NAMESZ); | 634 | BUG_ON(ret > IDMAP_NAMESZ); |
637 | memcpy(name, item->name, ret); | 635 | memcpy(name, item->name, ret); |
638 | ent_put(&item->h, &idtoname_cache); | 636 | cache_put(&item->h, &idtoname_cache); |
639 | return ret; | 637 | return ret; |
640 | } | 638 | } |
641 | 639 | ||