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