Lines Matching refs:ino
45 ext2_ino_t ino; member
265 icount->list[i].ino = hint->list[i].ino; in ext2fs_create_icount2()
289 ext2_ino_t ino, int pos) in insert_icount_el() argument
296 if (icount->last_lookup && icount->last_lookup->ino == ino) in insert_icount_el()
301 new_size = icount->list[(unsigned)icount->count-1].ino; in insert_icount_el()
329 el->ino = ino; in insert_icount_el()
340 ext2_ino_t ino, int create) in get_icount_el() argument
350 (ino > icount->list[(unsigned)icount->count-1].ino))) { in get_icount_el()
351 return insert_icount_el(icount, ino, (unsigned) icount->count); in get_icount_el()
358 if (ino == icount->list[icount->cursor].ino) in get_icount_el()
361 printf("Non-cursor get_icount_el: %u\n", ino); in get_icount_el()
373 lowval = icount->list[low].ino; in get_icount_el()
374 highval = icount->list[high].ino; in get_icount_el()
376 if (ino < lowval) in get_icount_el()
378 else if (ino > highval) in get_icount_el()
381 range = ((float) (ino - lowval)) / in get_icount_el()
391 if (ino == icount->list[mid].ino) { in get_icount_el()
395 if (ino < icount->list[mid].ino) in get_icount_el()
405 return insert_icount_el(icount, ino, low); in get_icount_el()
409 static errcode_t set_inode_count(ext2_icount_t icount, ext2_ino_t ino, in set_inode_count() argument
416 key.dptr = (unsigned char *) &ino; in set_inode_count()
432 el = get_icount_el(icount, ino, 1); in set_inode_count()
440 static errcode_t get_inode_count(ext2_icount_t icount, ext2_ino_t ino, in get_inode_count() argument
447 key.dptr = (unsigned char *) &ino; in get_inode_count()
460 el = get_icount_el(icount, ino, 0); in get_inode_count()
483 if (icount->list[i-1].ino >= icount->list[i].ino) { in ext2fs_icount_validate()
485 bad, i-1, icount->list[i-1].ino, in ext2fs_icount_validate()
486 i, icount->list[i].ino); in ext2fs_icount_validate()
493 errcode_t ext2fs_icount_fetch(ext2_icount_t icount, ext2_ino_t ino, __u16 *ret) in ext2fs_icount_fetch() argument
498 if (!ino || (ino > icount->num_inodes)) in ext2fs_icount_fetch()
501 if (ext2fs_test_inode_bitmap(icount->single, ino)) { in ext2fs_icount_fetch()
506 !ext2fs_test_inode_bitmap(icount->multiple, ino)) { in ext2fs_icount_fetch()
510 get_inode_count(icount, ino, &val); in ext2fs_icount_fetch()
515 errcode_t ext2fs_icount_increment(ext2_icount_t icount, ext2_ino_t ino, in ext2fs_icount_increment() argument
522 if (!ino || (ino > icount->num_inodes)) in ext2fs_icount_increment()
525 if (ext2fs_test_inode_bitmap(icount->single, ino)) { in ext2fs_icount_increment()
530 if (set_inode_count(icount, ino, 2)) in ext2fs_icount_increment()
533 ext2fs_unmark_inode_bitmap(icount->single, ino); in ext2fs_icount_increment()
540 if (ext2fs_test_inode_bitmap(icount->multiple, ino)) { in ext2fs_icount_increment()
541 get_inode_count(icount, ino, &curr_value); in ext2fs_icount_increment()
543 if (set_inode_count(icount, ino, curr_value)) in ext2fs_icount_increment()
550 ext2fs_mark_inode_bitmap(icount->single, ino); in ext2fs_icount_increment()
560 get_inode_count(icount, ino, &curr_value); in ext2fs_icount_increment()
562 if (set_inode_count(icount, ino, curr_value)) in ext2fs_icount_increment()
566 ext2fs_mark_inode_bitmap(icount->multiple, ino); in ext2fs_icount_increment()
572 errcode_t ext2fs_icount_decrement(ext2_icount_t icount, ext2_ino_t ino, in ext2fs_icount_decrement() argument
577 if (!ino || (ino > icount->num_inodes)) in ext2fs_icount_decrement()
582 if (ext2fs_test_inode_bitmap(icount->single, ino)) { in ext2fs_icount_decrement()
583 ext2fs_unmark_inode_bitmap(icount->single, ino); in ext2fs_icount_decrement()
585 ext2fs_unmark_inode_bitmap(icount->multiple, ino); in ext2fs_icount_decrement()
587 set_inode_count(icount, ino, 0); in ext2fs_icount_decrement()
595 !ext2fs_test_inode_bitmap(icount->multiple, ino)) in ext2fs_icount_decrement()
598 get_inode_count(icount, ino, &curr_value); in ext2fs_icount_decrement()
602 if (set_inode_count(icount, ino, curr_value)) in ext2fs_icount_decrement()
606 ext2fs_mark_inode_bitmap(icount->single, ino); in ext2fs_icount_decrement()
608 ext2fs_unmark_inode_bitmap(icount->multiple, ino); in ext2fs_icount_decrement()
615 errcode_t ext2fs_icount_store(ext2_icount_t icount, ext2_ino_t ino, in ext2fs_icount_store() argument
618 if (!ino || (ino > icount->num_inodes)) in ext2fs_icount_store()
624 ext2fs_mark_inode_bitmap(icount->single, ino); in ext2fs_icount_store()
626 ext2fs_unmark_inode_bitmap(icount->multiple, ino); in ext2fs_icount_store()
630 ext2fs_unmark_inode_bitmap(icount->single, ino); in ext2fs_icount_store()
636 ext2fs_unmark_inode_bitmap(icount->multiple, ino); in ext2fs_icount_store()
638 set_inode_count(icount, ino, 0); in ext2fs_icount_store()
642 if (set_inode_count(icount, ino, count)) in ext2fs_icount_store()
644 ext2fs_unmark_inode_bitmap(icount->single, ino); in ext2fs_icount_store()
646 ext2fs_mark_inode_bitmap(icount->multiple, ino); in ext2fs_icount_store()
671 ext2_ino_t ino; member
791 printf("icount_fetch(%u) = ", pc->ino); in run_test()
794 retval = ext2fs_icount_store(icount, pc->ino, pc->arg); in run_test()
800 printf("icount_store(%u, %u) = ", pc->ino, pc->arg); in run_test()
803 retval = ext2fs_icount_increment(icount, pc->ino, 0); in run_test()
809 printf("icount_increment(%u) = ", pc->ino); in run_test()
812 retval = ext2fs_icount_decrement(icount, pc->ino, 0); in run_test()
818 printf("icount_decrement(%u) = ", pc->ino); in run_test()
821 retval = ext2fs_icount_fetch(icount, pc->ino, &result); in run_test()