diff --git a/lnet/include/libcfs/user-bitops.h b/lnet/include/libcfs/user-bitops.h index 272bcf2fa1fcd1b043b02ab461942b438e20844d..43fc2f1bf899988742d31f769f3e9c08796bab87 100644 --- a/lnet/include/libcfs/user-bitops.h +++ b/lnet/include/libcfs/user-bitops.h @@ -50,7 +50,7 @@ static __inline__ int clear_bit(int nr, long * addr) return nr; } -static __inline__ int test_bit(int nr, long * addr) +static __inline__ int test_bit(int nr, const long * addr) { return ((1UL << (nr & (BITS_PER_LONG - 1))) & ((addr)[nr / BITS_PER_LONG])) != 0; } diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index 0fbd5bdd32d6349754ea52d9d85a89bb80b2912a..2fb2eec140a97438fb6354b380586cae5e36284f 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -65,9 +65,9 @@ #include <assert.h> #include <libcfs/list.h> -#include <libcfs/user-bitops.h> #include <lnet/lnet.h> #include <libcfs/kp30.h> +#include <libcfs/user-bitops.h> /* definitions for liblustre */ @@ -189,35 +189,6 @@ typedef int (write_proc_t)(struct file *file, const char *buffer, * to allow the compiler to adjust the bit shifting accordingly */ -/* test if bit nr is set in bitmap addr; returns previous value of bit nr */ -static __inline__ int set_bit(int nr, long * addr) -{ - long mask; - - addr += nr / BITS_PER_LONG; - mask = 1UL << (nr & (BITS_PER_LONG - 1)); - nr = (mask & *addr) != 0; - *addr |= mask; - return nr; -} - -/* clear bit nr in bitmap addr; returns previous value of bit nr*/ -static __inline__ int clear_bit(int nr, long * addr) -{ - long mask; - - addr += nr / BITS_PER_LONG; - mask = 1UL << (nr & (BITS_PER_LONG - 1)); - nr = (mask & *addr) != 0; - *addr &= ~mask; - return nr; -} - -static __inline__ int test_bit(int nr, const long * addr) -{ - return ((1UL << (nr & (BITS_PER_LONG - 1))) & ((addr)[nr / BITS_PER_LONG])) != 0; -} - static __inline__ int ext2_set_bit(int nr, void *addr) { return set_bit(nr, (long*)addr); diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index ee98565aea79ae66d79c13d5ee192658230f810a..3c58c2c0471e0390bacd0b909557023403afd6af 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -171,7 +171,7 @@ void mds_lov_update_objids(struct obd_device *obd, struct lov_mds_md *lmm) " old %llu\n", i, id, data[idx]); if (id > data[idx]) { data[idx] = id; - bitmap_set(mds->mds_lov_page_dirty, page); + cfs_bitmap_set(mds->mds_lov_page_dirty, page); } } EXIT; @@ -237,12 +237,12 @@ int mds_lov_write_objids(struct obd_device *obd) int i, rc = 0; ENTRY; - if (bitmap_check_empty(mds->mds_lov_page_dirty)) + if (cfs_bitmap_check_empty(mds->mds_lov_page_dirty)) RETURN(0); mds_lov_dump_objids("write", obd); - foreach_bit(mds->mds_lov_page_dirty, i) { + cfs_foreach_bit(mds->mds_lov_page_dirty, i) { obd_id *data = mds->mds_lov_page_array[i]; unsigned int size = OBJID_PER_PAGE()*sizeof(obd_id); loff_t off = i * size; @@ -257,7 +257,7 @@ int mds_lov_write_objids(struct obd_device *obd) size, &off, 0); if (rc < 0) break; - bitmap_clear(mds->mds_lov_page_dirty, i); + cfs_bitmap_clear(mds->mds_lov_page_dirty, i); } if (rc >= 0) rc = 0; @@ -304,7 +304,7 @@ static int mds_lov_get_objid(struct obd_device * obd, struct obd_export *export, mds->mds_lov_objid_lastpage = page; mds->mds_lov_objid_lastidx = off; } - bitmap_set(mds->mds_lov_page_dirty, page); + cfs_bitmap_set(mds->mds_lov_page_dirty, page); } out: RETURN(rc);