Lines Matching full:ent

62 struct ent {  struct
79 struct ent *new = container_of(cnew, struct ent, h); in ent_init() argument
80 struct ent *itm = container_of(citm, struct ent, h); in ent_init()
92 struct ent *map = container_of(ref, struct ent, h.ref); in ent_put()
99 struct ent *e = kmalloc(sizeof(*e), GFP_KERNEL); in ent_alloc()
111 idtoname_hash(struct ent *ent) in idtoname_hash() argument
115 hash = hash_str(ent->authname, ENT_HASHBITS); in idtoname_hash()
116 hash = hash_long(hash ^ ent->id, ENT_HASHBITS); in idtoname_hash()
119 if (ent->type == IDMAP_TYPE_GROUP) in idtoname_hash()
135 struct ent *ent = container_of(ch, struct ent, h); in idtoname_request() local
138 qword_add(bpp, blen, ent->authname); in idtoname_request()
139 snprintf(idstr, sizeof(idstr), "%u", ent->id); in idtoname_request()
140 qword_add(bpp, blen, ent->type == IDMAP_TYPE_GROUP ? "group" : "user"); in idtoname_request()
149 struct ent *a = container_of(ca, struct ent, h); in idtoname_match()
150 struct ent *b = container_of(cb, struct ent, h); in idtoname_match()
159 struct ent *ent; in idtoname_show() local
165 ent = container_of(h, struct ent, h); in idtoname_show()
166 seq_printf(m, "%s %s %u", ent->authname, in idtoname_show()
167 ent->type == IDMAP_TYPE_GROUP ? "group" : "user", in idtoname_show()
168 ent->id); in idtoname_show()
170 seq_printf(m, " %s", ent->name); in idtoname_show()
184 static struct ent *idtoname_lookup(struct cache_detail *, struct ent *);
185 static struct ent *idtoname_update(struct cache_detail *, struct ent *,
186 struct ent *);
207 struct ent ent, *res; in idtoname_parse() local
220 memset(&ent, 0, sizeof(ent)); in idtoname_parse()
226 memcpy(ent.authname, buf1, sizeof(ent.authname)); in idtoname_parse()
231 ent.type = strcmp(buf1, "user") == 0 ? in idtoname_parse()
237 ent.id = simple_strtoul(buf1, &bp, 10); in idtoname_parse()
242 ent.h.expiry_time = get_expiry(&buf); in idtoname_parse()
243 if (ent.h.expiry_time == 0) in idtoname_parse()
247 res = idtoname_lookup(cd, &ent); in idtoname_parse()
257 set_bit(CACHE_NEGATIVE, &ent.h.flags); in idtoname_parse()
259 memcpy(ent.name, buf1, sizeof(ent.name)); in idtoname_parse()
261 res = idtoname_update(cd, &ent, res); in idtoname_parse()
272 static struct ent *
273 idtoname_lookup(struct cache_detail *cd, struct ent *item) in idtoname_lookup()
278 return container_of(ch, struct ent, h); in idtoname_lookup()
283 static struct ent *
284 idtoname_update(struct cache_detail *cd, struct ent *new, struct ent *old) in idtoname_update()
289 return container_of(ch, struct ent, h); in idtoname_update()
300 nametoid_hash(struct ent *ent) in nametoid_hash() argument
302 return hash_str(ent->name, ENT_HASHBITS); in nametoid_hash()
315 struct ent *ent = container_of(ch, struct ent, h); in nametoid_request() local
317 qword_add(bpp, blen, ent->authname); in nametoid_request()
318 qword_add(bpp, blen, ent->type == IDMAP_TYPE_GROUP ? "group" : "user"); in nametoid_request()
319 qword_add(bpp, blen, ent->name); in nametoid_request()
327 struct ent *a = container_of(ca, struct ent, h); in nametoid_match()
328 struct ent *b = container_of(cb, struct ent, h); in nametoid_match()
337 struct ent *ent; in nametoid_show() local
343 ent = container_of(h, struct ent, h); in nametoid_show()
344 seq_printf(m, "%s %s %s", ent->authname, in nametoid_show()
345 ent->type == IDMAP_TYPE_GROUP ? "group" : "user", in nametoid_show()
346 ent->name); in nametoid_show()
348 seq_printf(m, " %u", ent->id); in nametoid_show()
353 static struct ent *nametoid_lookup(struct cache_detail *, struct ent *);
354 static struct ent *nametoid_update(struct cache_detail *, struct ent *,
355 struct ent *);
377 struct ent ent, *res; in nametoid_parse() local
389 memset(&ent, 0, sizeof(ent)); in nametoid_parse()
395 memcpy(ent.authname, buf1, sizeof(ent.authname)); in nametoid_parse()
400 ent.type = strcmp(buf1, "user") == 0 ? in nametoid_parse()
407 memcpy(ent.name, buf1, sizeof(ent.name)); in nametoid_parse()
410 ent.h.expiry_time = get_expiry(&buf); in nametoid_parse()
411 if (ent.h.expiry_time == 0) in nametoid_parse()
415 error = get_int(&buf, &ent.id); in nametoid_parse()
419 set_bit(CACHE_NEGATIVE, &ent.h.flags); in nametoid_parse()
422 res = nametoid_lookup(cd, &ent); in nametoid_parse()
425 res = nametoid_update(cd, &ent, res); in nametoid_parse()
437 static struct ent *
438 nametoid_lookup(struct cache_detail *cd, struct ent *item) in nametoid_lookup()
443 return container_of(ch, struct ent, h); in nametoid_lookup()
448 static struct ent *
449 nametoid_update(struct cache_detail *cd, struct ent *new, struct ent *old) in nametoid_update()
454 return container_of(ch, struct ent, h); in nametoid_update()
507 struct ent *(*lookup_fn)(struct cache_detail *, struct ent *), in idmap_lookup() argument
508 struct ent *key, struct cache_detail *detail, struct ent **item) in idmap_lookup()
519 struct ent *prev_item = *item; in idmap_lookup()
541 struct ent *item, key = { in idmap_name_to_id()
579 struct ent *item, key = { in idmap_id_to_name()