Lines Matching full:mid

296  * XXX should be the one closest to mid but mid is not yet computed.
371 int mid=0; /* midpoint for binary srch */ in xfs_dir2_block_addname() local
453 mid = (low + high) >> 1; in xfs_dir2_block_addname()
454 if ((hash = be32_to_cpu(blp[mid].hashval)) == args->hashval) in xfs_dir2_block_addname()
457 low = mid + 1; in xfs_dir2_block_addname()
459 high = mid - 1; in xfs_dir2_block_addname()
461 while (mid >= 0 && be32_to_cpu(blp[mid].hashval) >= args->hashval) { in xfs_dir2_block_addname()
462 mid--; in xfs_dir2_block_addname()
499 mid++; in xfs_dir2_block_addname()
500 if (mid) in xfs_dir2_block_addname()
501 memmove(blp, &blp[1], mid * sizeof(*blp)); in xfs_dir2_block_addname()
503 lfloghigh = mid; in xfs_dir2_block_addname()
509 for (lowstale = mid; in xfs_dir2_block_addname()
515 for (highstale = mid + 1; in xfs_dir2_block_addname()
519 (lowstale < 0 || mid - lowstale > highstale - mid); in xfs_dir2_block_addname()
527 mid - lowstale <= highstale - mid)) { in xfs_dir2_block_addname()
528 if (mid - lowstale) in xfs_dir2_block_addname()
530 (mid - lowstale) * sizeof(*blp)); in xfs_dir2_block_addname()
532 lfloghigh = max(mid, lfloghigh); in xfs_dir2_block_addname()
539 mid++; in xfs_dir2_block_addname()
540 if (highstale - mid) in xfs_dir2_block_addname()
541 memmove(&blp[mid + 1], &blp[mid], in xfs_dir2_block_addname()
542 (highstale - mid) * sizeof(*blp)); in xfs_dir2_block_addname()
543 lfloglow = min(mid, lfloglow); in xfs_dir2_block_addname()
555 blp[mid].hashval = cpu_to_be32(args->hashval); in xfs_dir2_block_addname()
556 blp[mid].address = cpu_to_be32(xfs_dir2_byte_to_dataptr( in xfs_dir2_block_addname()
691 int mid; /* binary search current idx */ in xfs_dir2_block_lookup_int() local
712 mid = (low + high) >> 1; in xfs_dir2_block_lookup_int()
713 if ((hash = be32_to_cpu(blp[mid].hashval)) == args->hashval) in xfs_dir2_block_lookup_int()
716 low = mid + 1; in xfs_dir2_block_lookup_int()
718 high = mid - 1; in xfs_dir2_block_lookup_int()
728 while (mid > 0 && be32_to_cpu(blp[mid - 1].hashval) == args->hashval) { in xfs_dir2_block_lookup_int()
729 mid--; in xfs_dir2_block_lookup_int()
736 if ((addr = be32_to_cpu(blp[mid].address)) == XFS_DIR2_NULL_DATAPTR) in xfs_dir2_block_lookup_int()
752 *entno = mid; in xfs_dir2_block_lookup_int()
756 } while (++mid < be32_to_cpu(btp->count) && in xfs_dir2_block_lookup_int()
757 be32_to_cpu(blp[mid].hashval) == hash); in xfs_dir2_block_lookup_int()