Lines Matching refs:rec

327 	dn_filerec_t	rec;
389 if (recid == rec.rec_next[image])
391 recid = rec.rec_next[image];
406 if (recid == rec.rec_next[image])
408 recid = rec.rec_next[image];
429 if (read_rec(dhp->dh_fd, &rec, recid) == -1) {
437 if (rec.rec_prev[image] == DN_NOREC)
443 if (!record_match(&rec.rec_dn, targetp, query))
464 *recordp = rec.rec_dn;
570 dn_filerec_t rec, rec_next;
598 if (read_rec(fd, &rec, recid) == -1)
601 if (rec.rec_prev[image] != DN_NOREC)
605 * We're going to insert `rec' at the head of the `hash' hash
613 rec.rec_dn = *addp;
614 rec.rec_dn.dn_sig = gensig();
615 rec.rec_prev[!image] = DN_HASHHEAD;
616 rec.rec_next[!image] = recid_head;
622 if (rec.rec_next[!image] != DN_NOREC) {
623 if (read_rec(fd, &rec_next, rec.rec_next[!image]) == -1)
640 if (write_rec(fd, &rec, recid) == -1)
648 if (rec.rec_next[!image] != DN_NOREC) {
650 if (write_rec(fd, &rec_next, rec.rec_next[!image]) == -1)
668 rec.rec_prev[!image] = rec.rec_prev[image];
669 rec.rec_next[!image] = rec.rec_next[image];
670 if (write_rec(fd, &rec, recid) == -1)
673 if (rec.rec_next[!image] != DN_NOREC) {
675 if (write_rec(fd, &rec_next, rec.rec_next[!image]) == -1)
684 addp->dn_sig = rec.rec_dn.dn_sig;
695 dn_filerec_t rec, rec_prev, rec_next;
723 if (read_rec(fd, &rec, recid) == -1)
726 if (rec.rec_prev[image] == DN_NOREC)
729 hash = cidhash(rec.rec_dn.dn_cid, rec.rec_dn.dn_cid_len);
736 if (delp->dn_sig != 0 && rec.rec_dn.dn_sig != delp->dn_sig)
742 if (rec.rec_next[image] != DN_NOREC) {
743 if (read_rec(fd, &rec_next, rec.rec_next[image]) == -1)
747 if (rec.rec_prev[image] != DN_HASHHEAD) {
748 if (read_rec(fd, &rec_prev, rec.rec_prev[image]) == -1)
768 if (rec.rec_next[image] != DN_NOREC) {
769 rec_next.rec_prev[!image] = rec.rec_prev[image];
770 if (write_rec(fd, &rec_next, rec.rec_next[image]) == -1)
774 if (rec.rec_prev[image] != DN_HASHHEAD) {
775 rec_prev.rec_next[!image] = rec.rec_next[image];
776 if (write_rec(fd, &rec_prev, rec.rec_prev[image]) == -1)
779 if (write_hashhead(fd, rec.rec_next[image], hash, !image) == -1)
783 rec.rec_next[!image] = DN_NOREC;
784 rec.rec_prev[!image] = DN_NOREC;
785 if (write_rec(fd, &rec, recid) == -1)
800 if (rec.rec_next[!image] != DN_NOREC) {
801 rec_next.rec_prev[!image] = rec.rec_prev[!image];
802 if (write_rec(fd, &rec_next, rec.rec_next[!image]) == -1)
806 if (rec.rec_prev[!image] != DN_HASHHEAD) {
807 rec_prev.rec_next[!image] = rec.rec_next[!image];
808 if (write_rec(fd, &rec_prev, rec.rec_prev[!image]) == -1)
811 if (write_hashhead(fd, rec.rec_next[!image], hash, !image)
816 rec.rec_next[!image] = DN_NOREC;
817 rec.rec_prev[!image] = DN_NOREC;
818 if (write_rec(fd, &rec, recid) == -1)
830 dn_filerec_t rec, new_rec, rec_head, rec_next, rec_prev;
858 if (read_rec(fd, &rec, recid) == -1)
861 if (rec.rec_prev[image] == DN_NOREC)
864 if (rec.rec_dn.dn_sig != origp->dn_sig)
894 hash = cidhash(rec.rec_dn.dn_cid, rec.rec_dn.dn_cid_len);
898 new_rec.rec_prev[!image] = rec.rec_prev[image];
899 new_rec.rec_next[!image] = rec.rec_next[image];
934 if (rec.rec_next[image] != DN_NOREC) {
935 if (read_rec(fd, &rec_next, rec.rec_next[image]) == -1)
938 if (rec.rec_prev[image] != DN_HASHHEAD) {
939 if (read_rec(fd, &rec_prev, rec.rec_prev[image]) == -1)
944 rec_next.rec_prev[!image] = rec.rec_prev[!image];
945 rec_prev.rec_next[!image] = rec.rec_next[!image];
951 if (rec.rec_next[image] != DN_NOREC) {
952 if (write_rec(fd, &rec_next, rec.rec_next[image]) == -1)
955 if (rec.rec_prev[image] != DN_HASHHEAD) {
956 if (write_rec(fd, &rec_prev, rec.rec_prev[image]) == -1)
988 rec.rec_prev[!image] = DN_NOREC;
989 rec.rec_next[!image] = DN_NOREC;
990 if (write_rec(fd, &rec, recid) == -1)
1049 if (rec.rec_next[image] != DN_NOREC) {
1050 rec_next.rec_prev[!image] = rec.rec_prev[image];
1051 if (write_rec(fd, &rec_next, rec.rec_next[image]) == -1)
1054 if (rec.rec_prev[image] != DN_HASHHEAD) {
1055 rec_prev.rec_next[!image] = rec.rec_next[image];
1056 if (write_rec(fd, &rec_prev, rec.rec_prev[image]) == -1)
1059 if (write_hashhead(fd, rec.rec_next[image], hash,
1085 rec.rec_prev[!image] = DN_NOREC;
1086 rec.rec_next[!image] = DN_NOREC;
1087 if (write_rec(fd, &rec, recid) == -1)
1191 dn_filerec_t rec;
1245 if (read_rec(dhp->dh_fd, &rec, recid) == -1)
1252 if (rec.rec_next[image] != rec.rec_next[!image] ||
1253 rec.rec_prev[image] != rec.rec_prev[!image]) {
1256 rec.rec_prev[!image] = rec.rec_prev[image];
1257 rec.rec_next[!image] = rec.rec_next[image];
1259 if (write_rec(dhp->dh_fd, &rec, recid) == -1)
1311 * Convert the dn_filerec_t pointed to by `rec' from native (host) to
1316 nhconvert_rec(dn_filerec_t *rec)
1319 dn_rec_t *dnp = &rec->rec_dn;
1321 nhconvert(&rec->rec_prev[0], &rec->rec_prev[0], sizeof (dn_recid_t));
1322 nhconvert(&rec->rec_prev[1], &rec->rec_prev[1], sizeof (dn_recid_t));
1323 nhconvert(&rec->rec_next[0], &rec->rec_next[0], sizeof (dn_recid_t));
1324 nhconvert(&rec->rec_next[1], &rec->rec_next[1], sizeof (dn_recid_t));
1363 * into `rec'. Returns 0 on success, -1 on failure (errno is set).
1366 read_rec(int fd, dn_filerec_t *rec, dn_recid_t recid)
1368 if (pnread(fd, rec, sizeof (*rec), RECID2OFFSET(recid)) == -1)
1371 nhconvert_rec(rec);
1376 * Write the dn_filerec_t `rec' identified by `recid' into the open
1380 write_rec(int fd, dn_filerec_t *rec, dn_recid_t recid)
1384 nhconvert_rec(rec);
1385 retval = pnwrite(fd, rec, sizeof (*rec), RECID2OFFSET(recid));
1386 nhconvert_rec(rec);