Lines Matching refs:bit

49  * ntfs_bit_set - set a bit in a field of bits
51 * @bit: bit to set
52 * @new_value: value to set bit to (0 or 1)
54 * Set the bit @bit in the @bitmap to @new_value. Ignore all errors.
56 void ntfs_bit_set(u8 *bitmap, const u64 bit, const u8 new_value)
61 bitmap[bit >> 3] &= ~(1 << (bit & 7));
63 bitmap[bit >> 3] |= (1 << (bit & 7));
67 * ntfs_bit_get - get value of a bit in a field of bits
69 * @bit: bit to get
71 * Get and return the value of the bit @bit in @bitmap (0 or 1).
74 char ntfs_bit_get(const u8 *bitmap, const u64 bit)
78 return (bitmap[bit >> 3] >> (bit & 7)) & 1;
82 * ntfs_bit_get_and_set - get value of a bit in a field of bits and set it
84 * @bit: bit to get/set
85 * @new_value: value to set bit to (0 or 1)
87 * Return the value of the bit @bit and set it to @new_value (0 or 1).
90 char ntfs_bit_get_and_set(u8 *bitmap, const u64 bit, const u8 new_value)
96 shift = bit & 7;
97 old_bit = (bitmap[bit >> 3] >> shift) & 1;
99 bitmap[bit >> 3] ^= 1 << shift;
106 * @start_bit: first bit to set
110 * Set @count bits starting at bit @start_bit in the bitmap described by the
120 int bit, firstbyte, lastbyte, lastbyte_pos, tmp, ret = -1;
129 bit = start_bit & 7;
130 if (bit)
136 bufsize = ((count - (bit ? 8 - bit : 0) + 7) >> 3) + firstbyte;
148 if (bit) {
157 while ((bit & 7) && count--) {
159 *buf |= 1 << bit++;
161 *buf &= ~(1 << bit++);
170 bit = count & 7;
173 if (count > 0 && bit) {
199 while (bit && count--) {
201 *lastbyte_buf |= 1 << --bit;
203 *lastbyte_buf &= ~(1 << --bit);
206 bit = 0;
260 * @start_bit: first bit to set
263 * Set @count bits starting at bit @start_bit in the bitmap described by the
272 ntfs_log_enter("Set from bit %lld, count %lld\n",
282 * @start_bit: first bit to clear
285 * Clear @count bits starting at bit @start_bit in the bitmap described by the
294 ntfs_log_enter("Clear from bit %lld, count %lld\n",