Lines Matching refs:ent

63 struct ent {  struct
80 struct ent *new = container_of(cnew, struct ent, h); in ent_init() argument
81 struct ent *itm = container_of(citm, struct ent, h); in ent_init()
93 struct ent *map = container_of(ref, struct ent, h.ref); in ent_put()
100 struct ent *e = kmalloc(sizeof(*e), GFP_KERNEL); in ent_alloc()
112 idtoname_hash(struct ent *ent) in idtoname_hash() argument
116 hash = hash_str(ent->authname, ENT_HASHBITS); in idtoname_hash()
117 hash = hash_long(hash ^ ent->id, ENT_HASHBITS); in idtoname_hash()
120 if (ent->type == IDMAP_TYPE_GROUP) in idtoname_hash()
136 struct ent *ent = container_of(ch, struct ent, h); in idtoname_request() local
139 qword_add(bpp, blen, ent->authname); in idtoname_request()
140 snprintf(idstr, sizeof(idstr), "%u", ent->id); in idtoname_request()
141 qword_add(bpp, blen, ent->type == IDMAP_TYPE_GROUP ? "group" : "user"); in idtoname_request()
150 struct ent *a = container_of(ca, struct ent, h); in idtoname_match()
151 struct ent *b = container_of(cb, struct ent, h); in idtoname_match()
160 struct ent *ent; in idtoname_show() local
166 ent = container_of(h, struct ent, h); in idtoname_show()
167 seq_printf(m, "%s %s %u", ent->authname, in idtoname_show()
168 ent->type == IDMAP_TYPE_GROUP ? "group" : "user", in idtoname_show()
169 ent->id); in idtoname_show()
171 seq_printf(m, " %s", ent->name); in idtoname_show()
185 static struct ent *idtoname_lookup(struct cache_detail *, struct ent *);
186 static struct ent *idtoname_update(struct cache_detail *, struct ent *,
187 struct ent *);
208 struct ent ent, *res; in idtoname_parse() local
221 memset(&ent, 0, sizeof(ent)); in idtoname_parse()
227 memcpy(ent.authname, buf1, sizeof(ent.authname)); in idtoname_parse()
232 ent.type = strcmp(buf1, "user") == 0 ? in idtoname_parse()
238 ent.id = simple_strtoul(buf1, &bp, 10); in idtoname_parse()
243 error = get_expiry(&buf, &ent.h.expiry_time); in idtoname_parse()
248 res = idtoname_lookup(cd, &ent); in idtoname_parse()
258 set_bit(CACHE_NEGATIVE, &ent.h.flags); in idtoname_parse()
260 memcpy(ent.name, buf1, sizeof(ent.name)); in idtoname_parse()
262 res = idtoname_update(cd, &ent, res); in idtoname_parse()
273 static struct ent *
274 idtoname_lookup(struct cache_detail *cd, struct ent *item) in idtoname_lookup()
279 return container_of(ch, struct ent, h); in idtoname_lookup()
284 static struct ent *
285 idtoname_update(struct cache_detail *cd, struct ent *new, struct ent *old) in idtoname_update()
290 return container_of(ch, struct ent, h); in idtoname_update()
301 nametoid_hash(struct ent *ent) in nametoid_hash() argument
303 return hash_str(ent->name, ENT_HASHBITS); in nametoid_hash()
316 struct ent *ent = container_of(ch, struct ent, h); in nametoid_request() local
318 qword_add(bpp, blen, ent->authname); in nametoid_request()
319 qword_add(bpp, blen, ent->type == IDMAP_TYPE_GROUP ? "group" : "user"); in nametoid_request()
320 qword_add(bpp, blen, ent->name); in nametoid_request()
328 struct ent *a = container_of(ca, struct ent, h); in nametoid_match()
329 struct ent *b = container_of(cb, struct ent, h); in nametoid_match()
338 struct ent *ent; in nametoid_show() local
344 ent = container_of(h, struct ent, h); in nametoid_show()
345 seq_printf(m, "%s %s %s", ent->authname, in nametoid_show()
346 ent->type == IDMAP_TYPE_GROUP ? "group" : "user", in nametoid_show()
347 ent->name); in nametoid_show()
349 seq_printf(m, " %u", ent->id); in nametoid_show()
354 static struct ent *nametoid_lookup(struct cache_detail *, struct ent *);
355 static struct ent *nametoid_update(struct cache_detail *, struct ent *,
356 struct ent *);
378 struct ent ent, *res; in nametoid_parse() local
390 memset(&ent, 0, sizeof(ent)); in nametoid_parse()
396 memcpy(ent.authname, buf1, sizeof(ent.authname)); in nametoid_parse()
401 ent.type = strcmp(buf1, "user") == 0 ? in nametoid_parse()
408 memcpy(ent.name, buf1, sizeof(ent.name)); in nametoid_parse()
411 error = get_expiry(&buf, &ent.h.expiry_time); in nametoid_parse()
416 error = get_int(&buf, &ent.id); in nametoid_parse()
420 set_bit(CACHE_NEGATIVE, &ent.h.flags); in nametoid_parse()
423 res = nametoid_lookup(cd, &ent); in nametoid_parse()
426 res = nametoid_update(cd, &ent, res); in nametoid_parse()
438 static struct ent *
439 nametoid_lookup(struct cache_detail *cd, struct ent *item) in nametoid_lookup()
444 return container_of(ch, struct ent, h); in nametoid_lookup()
449 static struct ent *
450 nametoid_update(struct cache_detail *cd, struct ent *new, struct ent *old) in nametoid_update()
455 return container_of(ch, struct ent, h); in nametoid_update()
508 struct ent *(*lookup_fn)(struct cache_detail *, struct ent *), in idmap_lookup() argument
509 struct ent *key, struct cache_detail *detail, struct ent **item) in idmap_lookup()
520 struct ent *prev_item = *item; in idmap_lookup()
542 struct ent *item, key = { in idmap_name_to_id()
580 struct ent *item, key = { in idmap_id_to_name()