Lines Matching defs:bit

32  * - Operations are 8-bit only to ensure the functions work both on little
33 * and big endian machines! So don't make them 32-bit ops!
34 * - bitmap starts at bit = 0 and ends at bit = bitmap size - 1.
35 * - _Caller_ has to make sure that the bit to operate on is less than the
40 * ntfs_bit_set - set a bit in a field of bits
42 * @bit: bit to set
43 * @new_value: value to set bit to (0 or 1)
45 * Set the bit @bit in the @bitmap to @new_value. Ignore all errors.
47 static __inline__ void ntfs_bit_set(u8 *bitmap, const u64 bit,
53 bitmap[bit >> 3] &= ~(1 << (bit & 7));
55 bitmap[bit >> 3] |= (1 << (bit & 7));
59 * ntfs_bit_get - get value of a bit in a field of bits
61 * @bit: bit to get
63 * Get and return the value of the bit @bit in @bitmap (0 or 1).
66 static __inline__ char ntfs_bit_get(const u8 *bitmap, const u64 bit)
70 return (bitmap[bit >> 3] >> (bit & 7)) & 1;
73 static __inline__ void ntfs_bit_change(u8 *bitmap, const u64 bit)
77 bitmap[bit >> 3] ^= 1 << (bit & 7);
81 * ntfs_bit_get_and_set - get value of a bit in a field of bits and set it
83 * @bit: bit to get/set
84 * @new_value: value to set bit to (0 or 1)
86 * Return the value of the bit @bit and set it to @new_value (0 or 1).
89 static __inline__ char ntfs_bit_get_and_set(u8 *bitmap, const u64 bit,
96 shift = bit & 7;
97 old_bit = (bitmap[bit >> 3] >> shift) & 1;
99 bitmap[bit >> 3] ^= 1 << shift;
107 * ntfs_bitmap_set_bit - set a bit in a bitmap
109 * @bit: bit to set
111 * Set the @bit in the bitmap described by the attribute @na.
115 static __inline__ int ntfs_bitmap_set_bit(ntfs_attr *na, s64 bit)
117 return ntfs_bitmap_set_run(na, bit, 1);
121 * ntfs_bitmap_clear_bit - clear a bit in a bitmap
123 * @bit: bit to clear
125 * Clear @bit in the bitmap described by the attribute @na.
129 static __inline__ int ntfs_bitmap_clear_bit(ntfs_attr *na, s64 bit)
131 return ntfs_bitmap_clear_run(na, bit, 1);