Lines Matching refs:dataset
86 struct dataset in cache_addpw() struct
91 } *dataset; in cache_addpw() local
93 assert (offsetof (struct dataset, resp) == offsetof (struct datahead, data)); in cache_addpw()
131 else if ((dataset = mempool_alloc (db, (sizeof (struct dataset) in cache_addpw()
134 timeout = datahead_init_neg (&dataset->head, in cache_addpw()
135 (sizeof (struct dataset) in cache_addpw()
140 memcpy (&dataset->resp, ¬found, total); in cache_addpw()
143 char *key_copy = memcpy (dataset->strdata, key, req->key_len); in cache_addpw()
149 uintptr_t pval = (uintptr_t) dataset & ~pagesize_m1; in cache_addpw()
151 ((uintptr_t) dataset & pagesize_m1) in cache_addpw()
152 + sizeof (struct dataset) + req->key_len, MS_ASYNC); in cache_addpw()
156 &dataset->head, true, db, owner, he == NULL); in cache_addpw()
185 total = (offsetof (struct dataset, strdata) in cache_addpw()
194 dataset = NULL; in cache_addpw()
202 dataset = (struct dataset *) mempool_alloc (db, total + n, 1); in cache_addpw()
205 if (dataset == NULL) in cache_addpw()
213 dataset = (struct dataset *) alloca (total + n); in cache_addpw()
219 timeout = datahead_init_pos (&dataset->head, total + n, in cache_addpw()
220 total - offsetof (struct dataset, resp), in cache_addpw()
224 dataset->resp.version = NSCD_VERSION; in cache_addpw()
225 dataset->resp.found = 1; in cache_addpw()
226 dataset->resp.pw_name_len = pw_name_len; in cache_addpw()
227 dataset->resp.pw_passwd_len = pw_passwd_len; in cache_addpw()
228 dataset->resp.pw_uid = pwd->pw_uid; in cache_addpw()
229 dataset->resp.pw_gid = pwd->pw_gid; in cache_addpw()
230 dataset->resp.pw_gecos_len = pw_gecos_len; in cache_addpw()
231 dataset->resp.pw_dir_len = pw_dir_len; in cache_addpw()
232 dataset->resp.pw_shell_len = pw_shell_len; in cache_addpw()
234 cp = dataset->strdata; in cache_addpw()
248 assert (cp == dataset->strdata + total - offsetof (struct dataset, in cache_addpw()
257 if (dataset->head.allocsize == dh->allocsize in cache_addpw()
258 && dataset->head.recsize == dh->recsize in cache_addpw()
259 && memcmp (&dataset->resp, dh->data, in cache_addpw()
260 dh->allocsize - offsetof (struct dataset, resp)) == 0) in cache_addpw()
265 dh->timeout = dataset->head.timeout; in cache_addpw()
272 struct dataset *newp in cache_addpw()
273 = (struct dataset *) mempool_alloc (db, total + n, 1); in cache_addpw()
277 cp = (char *) newp + (cp - (char *) dataset); in cache_addpw()
278 key_copy = (char *) newp + (key_copy - (char *) dataset); in cache_addpw()
280 dataset = memcpy (newp, dataset, total + n); in cache_addpw()
295 if (writeall (fd, &dataset->resp, dataset->head.recsize) in cache_addpw()
296 != dataset->head.recsize) in cache_addpw()
309 uintptr_t pval = (uintptr_t) dataset & ~pagesize_m1; in cache_addpw()
311 ((uintptr_t) dataset & pagesize_m1) + total + n, in cache_addpw()
324 if (cache_add (GETPWBYUID, cp, key_offset, &dataset->head, true, in cache_addpw()
331 else if (strcmp (key_copy, dataset->strdata) != 0) in cache_addpw()
334 &dataset->head, true, db, owner, he == NULL) < 0) in cache_addpw()
342 && __builtin_expect (cache_add (GETPWBYNAME, dataset->strdata, in cache_addpw()
343 pw_name_len, &dataset->head, in cache_addpw()
348 (void) cache_add (GETPWBYUID, cp, key_offset, &dataset->head, in cache_addpw()