Home | History | Annotate | Download | only in sgivol

Lines Matching refs:voldir

269  * Compare the name in `slot' of voldir to `b'. Be careful, as the
270 * name in voldir need not be nul-terminated and `b' may be longer
284 cmp = strncmp(volhdr->voldir[slot].name, b,
285 sizeof(volhdr->voldir[slot].name));
287 return cmp == 0 && strlen(b) <= sizeof(volhdr->voldir[slot].name);
313 if (volhdr->voldir[i].name[0])
316 volhdr->voldir[i].name,
317 be32toh(volhdr->voldir[i].block),
318 be32toh(volhdr->voldir[i].bytes),
319 (be32toh(volhdr->voldir[i].bytes) + 511) / 512);
398 if (strncmp(vfilename, volhdr->voldir[i].name,
399 strlen(volhdr->voldir[i].name)) == 0)
405 lseek(fd, be32toh(volhdr->voldir[i].block) * 512, SEEK_SET);
409 i = be32toh(volhdr->voldir[i].bytes);
439 if (volhdr->voldir[i].name[0] == '\0' && slot < 0)
449 if (be32toh(volhdr->voldir[slot].block) > 0) {
453 volhdr->voldir[slot].name[0] = 0;
454 volhdr->voldir[slot].block = volhdr->voldir[slot].bytes = 0;
470 if (namelen > sizeof(volhdr->voldir[slot].name)) {
473 namelen = sizeof(volhdr->voldir[slot].name);
478 memset(volhdr->voldir[slot].name, 0,
479 sizeof(volhdr->voldir[slot].name));
481 memcpy(volhdr->voldir[slot].name, vfilename, namelen);
483 volhdr->voldir[slot].block = htobe32(block);
484 volhdr->voldir[slot].bytes = htobe32(st.st_size);
521 volhdr->voldir[i].name[0] = '\0';
522 volhdr->voldir[i].block = volhdr->voldir[i].bytes = 0;
529 char dstfile[sizeof(volhdr->voldir[0].name) + 1];
538 if (namelen > sizeof(volhdr->voldir[0].name)) {
541 namelen = sizeof(volhdr->voldir[0].name);
565 memcpy(volhdr->voldir[slot].name, dstfile,
566 sizeof(volhdr->voldir[slot].name));
621 if (volhdr->voldir[n].name[0]) {
622 if (first < (be32toh(volhdr->voldir[n].block) +
623 (be32toh(volhdr->voldir[n].bytes) + 511) / 512) &&
624 (first + blocks) > be32toh(volhdr->voldir[n].block)) {
625 first = be32toh(volhdr->voldir[n].block) +
626 (be32toh(volhdr->voldir[n].bytes) + 511) / 512;
629 printf("%s %d %d\n", volhdr->voldir[n].name, volhdr->voldir[n].block, volhdr->voldir[n].bytes);
630 printf("first=%d block=%d last=%d end=%d\n", first, volhdr->voldir[n].block,
631 first + blocks - 1, volhdr->voldir[n].block + (volhdr->voldir[n].bytes + 511) / 512);