Lines Matching refs:ent

65 struct ent {  struct
81 struct ent *new = container_of(cnew, struct ent, h); in ent_init() argument
82 struct ent *itm = container_of(citm, struct ent, h); in ent_init()
94 struct ent *map = container_of(ref, struct ent, h.ref); in ent_put()
101 struct ent *e = kmalloc(sizeof(*e), GFP_KERNEL); in ent_alloc()
113 idtoname_hash(struct ent *ent) in idtoname_hash() argument
117 hash = hash_str(ent->authname, ENT_HASHBITS); in idtoname_hash()
118 hash = hash_long(hash ^ ent->id, ENT_HASHBITS); in idtoname_hash()
121 if (ent->type == IDMAP_TYPE_GROUP) in idtoname_hash()
131 struct ent *ent = container_of(ch, struct ent, h); in idtoname_request() local
134 qword_add(bpp, blen, ent->authname); in idtoname_request()
135 snprintf(idstr, sizeof(idstr), "%u", ent->id); in idtoname_request()
136 qword_add(bpp, blen, ent->type == IDMAP_TYPE_GROUP ? "group" : "user"); in idtoname_request()
145 struct ent *a = container_of(ca, struct ent, h); in idtoname_match()
146 struct ent *b = container_of(cb, struct ent, h); in idtoname_match()
155 struct ent *ent; in idtoname_show() local
161 ent = container_of(h, struct ent, h); in idtoname_show()
162 seq_printf(m, "%s %s %u", ent->authname, in idtoname_show()
163 ent->type == IDMAP_TYPE_GROUP ? "group" : "user", in idtoname_show()
164 ent->id); in idtoname_show()
166 seq_printf(m, " %s", ent->name); in idtoname_show()
180 static struct ent *idtoname_lookup(struct cache_detail *, struct ent *);
181 static struct ent *idtoname_update(struct cache_detail *, struct ent *,
182 struct ent *);
202 struct ent ent, *res; in idtoname_parse() local
215 memset(&ent, 0, sizeof(ent)); in idtoname_parse()
221 memcpy(ent.authname, buf1, sizeof(ent.authname)); in idtoname_parse()
226 ent.type = strcmp(buf1, "user") == 0 ? in idtoname_parse()
232 ent.id = simple_strtoul(buf1, &bp, 10); in idtoname_parse()
237 ent.h.expiry_time = get_expiry(&buf); in idtoname_parse()
238 if (ent.h.expiry_time == 0) in idtoname_parse()
242 res = idtoname_lookup(cd, &ent); in idtoname_parse()
252 set_bit(CACHE_NEGATIVE, &ent.h.flags); in idtoname_parse()
254 memcpy(ent.name, buf1, sizeof(ent.name)); in idtoname_parse()
256 res = idtoname_update(cd, &ent, res); in idtoname_parse()
267 static struct ent *
268 idtoname_lookup(struct cache_detail *cd, struct ent *item) in idtoname_lookup()
273 return container_of(ch, struct ent, h); in idtoname_lookup()
278 static struct ent *
279 idtoname_update(struct cache_detail *cd, struct ent *new, struct ent *old) in idtoname_update()
284 return container_of(ch, struct ent, h); in idtoname_update()
295 nametoid_hash(struct ent *ent) in nametoid_hash() argument
297 return hash_str(ent->name, ENT_HASHBITS); in nametoid_hash()
304 struct ent *ent = container_of(ch, struct ent, h); in nametoid_request() local
306 qword_add(bpp, blen, ent->authname); in nametoid_request()
307 qword_add(bpp, blen, ent->type == IDMAP_TYPE_GROUP ? "group" : "user"); in nametoid_request()
308 qword_add(bpp, blen, ent->name); in nametoid_request()
316 struct ent *a = container_of(ca, struct ent, h); in nametoid_match()
317 struct ent *b = container_of(cb, struct ent, h); in nametoid_match()
326 struct ent *ent; in nametoid_show() local
332 ent = container_of(h, struct ent, h); in nametoid_show()
333 seq_printf(m, "%s %s %s", ent->authname, in nametoid_show()
334 ent->type == IDMAP_TYPE_GROUP ? "group" : "user", in nametoid_show()
335 ent->name); in nametoid_show()
337 seq_printf(m, " %u", ent->id); in nametoid_show()
342 static struct ent *nametoid_lookup(struct cache_detail *, struct ent *);
343 static struct ent *nametoid_update(struct cache_detail *, struct ent *,
344 struct ent *);
365 struct ent ent, *res; in nametoid_parse() local
377 memset(&ent, 0, sizeof(ent)); in nametoid_parse()
383 memcpy(ent.authname, buf1, sizeof(ent.authname)); in nametoid_parse()
388 ent.type = strcmp(buf1, "user") == 0 ? in nametoid_parse()
395 memcpy(ent.name, buf1, sizeof(ent.name)); in nametoid_parse()
398 ent.h.expiry_time = get_expiry(&buf); in nametoid_parse()
399 if (ent.h.expiry_time == 0) in nametoid_parse()
403 error = get_int(&buf, &ent.id); in nametoid_parse()
407 set_bit(CACHE_NEGATIVE, &ent.h.flags); in nametoid_parse()
410 res = nametoid_lookup(cd, &ent); in nametoid_parse()
413 res = nametoid_update(cd, &ent, res); in nametoid_parse()
425 static struct ent *
426 nametoid_lookup(struct cache_detail *cd, struct ent *item) in nametoid_lookup()
431 return container_of(ch, struct ent, h); in nametoid_lookup()
436 static struct ent *
437 nametoid_update(struct cache_detail *cd, struct ent *new, struct ent *old) in nametoid_update()
442 return container_of(ch, struct ent, h); in nametoid_update()
495 struct ent *(*lookup_fn)(struct cache_detail *, struct ent *), in idmap_lookup() argument
496 struct ent *key, struct cache_detail *detail, struct ent **item) in idmap_lookup()
507 struct ent *prev_item = *item; in idmap_lookup()
529 struct ent *item, key = { in idmap_name_to_id()
567 struct ent *item, key = { in idmap_id_to_name()