bitops.h (282513) | bitops.h (283675) |
---|---|
1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 151 unchanged lines hidden (view full) --- 160 pos = offset / BITS_PER_LONG; 161 offs = offset % BITS_PER_LONG; 162 bit = BITS_PER_LONG * pos; 163 addr += pos; 164 if (offs) { 165 mask = (*addr) & ~BIT_MASK(offs); 166 if (mask) 167 return (bit + __ffsl(mask)); | 1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 151 unchanged lines hidden (view full) --- 160 pos = offset / BITS_PER_LONG; 161 offs = offset % BITS_PER_LONG; 162 bit = BITS_PER_LONG * pos; 163 addr += pos; 164 if (offs) { 165 mask = (*addr) & ~BIT_MASK(offs); 166 if (mask) 167 return (bit + __ffsl(mask)); |
168 if (size - bit <= BITS_PER_LONG) 169 return (size); |
|
168 bit += BITS_PER_LONG; 169 addr++; 170 } 171 for (size -= bit; size >= BITS_PER_LONG; 172 size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { 173 if (*addr == 0) 174 continue; 175 return (bit + __ffsl(*addr)); --- 22 unchanged lines hidden (view full) --- 198 pos = offset / BITS_PER_LONG; 199 offs = offset % BITS_PER_LONG; 200 bit = BITS_PER_LONG * pos; 201 addr += pos; 202 if (offs) { 203 mask = ~(*addr) & ~BIT_MASK(offs); 204 if (mask) 205 return (bit + __ffsl(mask)); | 170 bit += BITS_PER_LONG; 171 addr++; 172 } 173 for (size -= bit; size >= BITS_PER_LONG; 174 size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { 175 if (*addr == 0) 176 continue; 177 return (bit + __ffsl(*addr)); --- 22 unchanged lines hidden (view full) --- 200 pos = offset / BITS_PER_LONG; 201 offs = offset % BITS_PER_LONG; 202 bit = BITS_PER_LONG * pos; 203 addr += pos; 204 if (offs) { 205 mask = ~(*addr) & ~BIT_MASK(offs); 206 if (mask) 207 return (bit + __ffsl(mask)); |
208 if (size - bit <= BITS_PER_LONG) 209 return (size); |
|
206 bit += BITS_PER_LONG; 207 addr++; 208 } 209 for (size -= bit; size >= BITS_PER_LONG; 210 size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { 211 if (~(*addr) == 0) 212 continue; 213 return (bit + __ffsl(~(*addr))); --- 305 unchanged lines hidden --- | 210 bit += BITS_PER_LONG; 211 addr++; 212 } 213 for (size -= bit; size >= BITS_PER_LONG; 214 size -= BITS_PER_LONG, bit += BITS_PER_LONG, addr++) { 215 if (~(*addr) == 0) 216 continue; 217 return (bit + __ffsl(~(*addr))); --- 305 unchanged lines hidden --- |