Lines Matching refs:ent

62 struct ent {  struct
78 struct ent *new = container_of(cnew, struct ent, h); in ent_init() argument
79 struct ent *itm = container_of(citm, struct ent, h); in ent_init()
91 struct ent *map = container_of(ref, struct ent, h.ref); in ent_put()
98 struct ent *e = kmalloc(sizeof(*e), GFP_KERNEL); in ent_alloc()
110 idtoname_hash(struct ent *ent) in idtoname_hash() argument
114 hash = hash_str(ent->authname, ENT_HASHBITS); in idtoname_hash()
115 hash = hash_long(hash ^ ent->id, ENT_HASHBITS); in idtoname_hash()
118 if (ent->type == IDMAP_TYPE_GROUP) in idtoname_hash()
128 struct ent *ent = container_of(ch, struct ent, h); in idtoname_request() local
131 qword_add(bpp, blen, ent->authname); in idtoname_request()
132 snprintf(idstr, sizeof(idstr), "%u", ent->id); in idtoname_request()
133 qword_add(bpp, blen, ent->type == IDMAP_TYPE_GROUP ? "group" : "user"); in idtoname_request()
142 struct ent *a = container_of(ca, struct ent, h); in idtoname_match()
143 struct ent *b = container_of(cb, struct ent, h); in idtoname_match()
152 struct ent *ent; in idtoname_show() local
158 ent = container_of(h, struct ent, h); in idtoname_show()
159 seq_printf(m, "%s %s %u", ent->authname, in idtoname_show()
160 ent->type == IDMAP_TYPE_GROUP ? "group" : "user", in idtoname_show()
161 ent->id); in idtoname_show()
163 seq_printf(m, " %s", ent->name); in idtoname_show()
177 static struct ent *idtoname_lookup(struct cache_detail *, struct ent *);
178 static struct ent *idtoname_update(struct cache_detail *, struct ent *,
179 struct ent *);
199 struct ent ent, *res; in idtoname_parse() local
212 memset(&ent, 0, sizeof(ent)); in idtoname_parse()
218 memcpy(ent.authname, buf1, sizeof(ent.authname)); in idtoname_parse()
223 ent.type = strcmp(buf1, "user") == 0 ? in idtoname_parse()
229 ent.id = simple_strtoul(buf1, &bp, 10); in idtoname_parse()
234 ent.h.expiry_time = get_expiry(&buf); in idtoname_parse()
235 if (ent.h.expiry_time == 0) in idtoname_parse()
239 res = idtoname_lookup(cd, &ent); in idtoname_parse()
249 set_bit(CACHE_NEGATIVE, &ent.h.flags); in idtoname_parse()
251 memcpy(ent.name, buf1, sizeof(ent.name)); in idtoname_parse()
253 res = idtoname_update(cd, &ent, res); in idtoname_parse()
264 static struct ent *
265 idtoname_lookup(struct cache_detail *cd, struct ent *item) in idtoname_lookup()
270 return container_of(ch, struct ent, h); in idtoname_lookup()
275 static struct ent *
276 idtoname_update(struct cache_detail *cd, struct ent *new, struct ent *old) in idtoname_update()
281 return container_of(ch, struct ent, h); in idtoname_update()
292 nametoid_hash(struct ent *ent) in nametoid_hash() argument
294 return hash_str(ent->name, ENT_HASHBITS); in nametoid_hash()
301 struct ent *ent = container_of(ch, struct ent, h); in nametoid_request() local
303 qword_add(bpp, blen, ent->authname); in nametoid_request()
304 qword_add(bpp, blen, ent->type == IDMAP_TYPE_GROUP ? "group" : "user"); in nametoid_request()
305 qword_add(bpp, blen, ent->name); in nametoid_request()
313 struct ent *a = container_of(ca, struct ent, h); in nametoid_match()
314 struct ent *b = container_of(cb, struct ent, h); in nametoid_match()
323 struct ent *ent; in nametoid_show() local
329 ent = container_of(h, struct ent, h); in nametoid_show()
330 seq_printf(m, "%s %s %s", ent->authname, in nametoid_show()
331 ent->type == IDMAP_TYPE_GROUP ? "group" : "user", in nametoid_show()
332 ent->name); in nametoid_show()
334 seq_printf(m, " %u", ent->id); in nametoid_show()
339 static struct ent *nametoid_lookup(struct cache_detail *, struct ent *);
340 static struct ent *nametoid_update(struct cache_detail *, struct ent *,
341 struct ent *);
362 struct ent ent, *res; in nametoid_parse() local
374 memset(&ent, 0, sizeof(ent)); in nametoid_parse()
380 memcpy(ent.authname, buf1, sizeof(ent.authname)); in nametoid_parse()
385 ent.type = strcmp(buf1, "user") == 0 ? in nametoid_parse()
392 memcpy(ent.name, buf1, sizeof(ent.name)); in nametoid_parse()
395 ent.h.expiry_time = get_expiry(&buf); in nametoid_parse()
396 if (ent.h.expiry_time == 0) in nametoid_parse()
400 error = get_int(&buf, &ent.id); in nametoid_parse()
404 set_bit(CACHE_NEGATIVE, &ent.h.flags); in nametoid_parse()
407 res = nametoid_lookup(cd, &ent); in nametoid_parse()
410 res = nametoid_update(cd, &ent, res); in nametoid_parse()
422 static struct ent *
423 nametoid_lookup(struct cache_detail *cd, struct ent *item) in nametoid_lookup()
428 return container_of(ch, struct ent, h); in nametoid_lookup()
433 static struct ent *
434 nametoid_update(struct cache_detail *cd, struct ent *new, struct ent *old) in nametoid_update()
439 return container_of(ch, struct ent, h); in nametoid_update()
492 struct ent *(*lookup_fn)(struct cache_detail *, struct ent *), in idmap_lookup() argument
493 struct ent *key, struct cache_detail *detail, struct ent **item) in idmap_lookup()
504 struct ent *prev_item = *item; in idmap_lookup()
526 struct ent *item, key = { in idmap_name_to_id()
564 struct ent *item, key = { in idmap_id_to_name()