Whamcloud - gitweb
b=15534
[fs/lustre-release.git] / libcfs / include / libcfs / bitmap.h
index 58fd9a3..a593701 100644 (file)
@@ -16,8 +16,8 @@
  * in the LICENSE file that accompanied this code).
  *
  * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
  *
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
@@ -64,19 +64,25 @@ bitmap_t *ALLOCATE_BITMAP(int size)
 static inline
 void cfs_bitmap_set(bitmap_t *bitmap, int nbit)
 {
-       set_bit(nbit, bitmap->data);
+        set_bit(nbit, bitmap->data);
 }
 
 static inline
 void cfs_bitmap_clear(bitmap_t *bitmap, int nbit)
 {
-        clear_bit(nbit, bitmap->data);
+        test_and_clear_bit(nbit, bitmap->data);
 }
 
 static inline
 int cfs_bitmap_check(bitmap_t *bitmap, int nbit)
 {
-       return test_bit(nbit, bitmap->data);
+        return test_bit(nbit, bitmap->data);
+}
+
+static inline
+int cfs_bitmap_test_and_clear(bitmap_t *bitmap, int nbit)
+{
+        return test_and_clear_bit(nbit, bitmap->data);
 }
 
 /* return 0 is bitmap has none set bits */