Lines Matching defs:nr
391 * check_zone_nr checks to see that *nr is a valid zone nr. If it
396 static int check_zone_nr2(uint32_t *nr, smallint *corrected)
399 if (!*nr)
401 if (*nr < FIRSTZONE)
403 else if (*nr >= ZONES)
406 return *nr;
407 printf("Zone nr %s in file '%s'. ", msg, current_name);
409 *nr = 0;
415 static int check_zone_nr(uint16_t *nr, smallint *corrected)
417 uint32_t nr32 = *nr;
419 *nr = (uint16_t)nr32;
424 * read-block reads block nr into the buffer at addr.
426 static void read_block(unsigned nr, char *addr)
428 if (!nr) {
432 if (BLOCK_SIZE * nr != lseek(dev_fd, BLOCK_SIZE * nr, SEEK_SET)) {
446 * write_block writes block nr to disk.
448 static void write_block(unsigned nr, char *addr)
450 if (!nr)
452 if (nr < FIRSTZONE || nr >= ZONES) {
458 if (BLOCK_SIZE * nr != lseek(dev_fd, BLOCK_SIZE * nr, SEEK_SET))
468 * map_block calculates the absolute block nr of a block in a file.
688 static struct minix1_inode *get_inode(unsigned nr)
692 if (!nr || nr > INODES)
695 inode = Inode1 + nr;
696 if (!inode_count[nr]) {
697 if (!inode_in_use(nr)) {
699 "for file '%s'\n", nr, current_name);
702 mark_inode(nr);
725 if (!++inode_count[nr]) {
727 inode_count[nr]--;
734 static struct minix2_inode *get_inode2(unsigned nr)
738 if (!nr || nr > INODES)
741 inode = Inode2 + nr;
742 if (!inode_count[nr]) {
743 if (!inode_in_use(nr)) {
745 "for file '%s'\n", nr, current_name);
748 mark_inode(nr);
770 if (!++inode_count[nr]) {
772 inode_count[nr]--;