Lines Matching +full:bit +full:- +full:manipulation
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
11 * XFS bit manipulation routines, used in non-realtime code.
17 * Returns 1 for empty, 0 for non-empty.
33 * Count the number of contiguous bits set in the bitmap starting with bit
46 size -= start_bit & ~(NBWORD - 1); in xfs_contig_bits()
47 start_bit &= (NBWORD - 1); in xfs_contig_bits()
51 tmp |= (~0U >> (NBWORD-start_bit)); in xfs_contig_bits()
55 size -= NBWORD; in xfs_contig_bits()
61 size -= NBWORD; in xfs_contig_bits()
63 return result - start_bit; in xfs_contig_bits()
65 return result + ffz(tmp) - start_bit; in xfs_contig_bits()
69 * This takes the bit number to start looking from and
70 * returns the next set bit from there. It returns -1
71 * if there are no more bits set or the start bit is
79 uint result = start_bit & ~(NBWORD - 1); in xfs_next_bit()
85 return -1; in xfs_next_bit()
86 size -= result; in xfs_next_bit()
87 start_bit &= (NBWORD - 1); in xfs_next_bit()
95 size -= NBWORD; in xfs_next_bit()
101 size -= NBWORD; in xfs_next_bit()
103 return -1; in xfs_next_bit()
105 return result + ffs(tmp) - 1; in xfs_next_bit()