Lines Matching full:mid
303 * XXX should be the one closest to mid but mid is not yet computed.
378 int mid=0; /* midpoint for binary srch */ in xfs_dir2_block_addname() local
460 mid = (low + high) >> 1; in xfs_dir2_block_addname()
461 if ((hash = be32_to_cpu(blp[mid].hashval)) == args->hashval) in xfs_dir2_block_addname()
464 low = mid + 1; in xfs_dir2_block_addname()
466 high = mid - 1; in xfs_dir2_block_addname()
468 while (mid >= 0 && be32_to_cpu(blp[mid].hashval) >= args->hashval) { in xfs_dir2_block_addname()
469 mid--; in xfs_dir2_block_addname()
506 mid++; in xfs_dir2_block_addname()
507 if (mid) in xfs_dir2_block_addname()
508 memmove(blp, &blp[1], mid * sizeof(*blp)); in xfs_dir2_block_addname()
510 lfloghigh = mid; in xfs_dir2_block_addname()
516 for (lowstale = mid; in xfs_dir2_block_addname()
522 for (highstale = mid + 1; in xfs_dir2_block_addname()
526 (lowstale < 0 || mid - lowstale > highstale - mid); in xfs_dir2_block_addname()
534 mid - lowstale <= highstale - mid)) { in xfs_dir2_block_addname()
535 if (mid - lowstale) in xfs_dir2_block_addname()
537 (mid - lowstale) * sizeof(*blp)); in xfs_dir2_block_addname()
539 lfloghigh = max(mid, lfloghigh); in xfs_dir2_block_addname()
546 mid++; in xfs_dir2_block_addname()
547 if (highstale - mid) in xfs_dir2_block_addname()
548 memmove(&blp[mid + 1], &blp[mid], in xfs_dir2_block_addname()
549 (highstale - mid) * sizeof(*blp)); in xfs_dir2_block_addname()
550 lfloglow = min(mid, lfloglow); in xfs_dir2_block_addname()
562 blp[mid].hashval = cpu_to_be32(args->hashval); in xfs_dir2_block_addname()
563 blp[mid].address = cpu_to_be32(xfs_dir2_byte_to_dataptr( in xfs_dir2_block_addname()
698 int mid; /* binary search current idx */ in xfs_dir2_block_lookup_int() local
719 mid = (low + high) >> 1; in xfs_dir2_block_lookup_int()
720 if ((hash = be32_to_cpu(blp[mid].hashval)) == args->hashval) in xfs_dir2_block_lookup_int()
723 low = mid + 1; in xfs_dir2_block_lookup_int()
725 high = mid - 1; in xfs_dir2_block_lookup_int()
735 while (mid > 0 && be32_to_cpu(blp[mid - 1].hashval) == args->hashval) { in xfs_dir2_block_lookup_int()
736 mid--; in xfs_dir2_block_lookup_int()
743 if ((addr = be32_to_cpu(blp[mid].address)) == XFS_DIR2_NULL_DATAPTR) in xfs_dir2_block_lookup_int()
759 *entno = mid; in xfs_dir2_block_lookup_int()
763 } while (++mid < be32_to_cpu(btp->count) && in xfs_dir2_block_lookup_int()
764 be32_to_cpu(blp[mid].hashval) == hash); in xfs_dir2_block_lookup_int()