Skip to content
Snippets Groups Projects
Commit 8f16bbf7 authored by Alexey Lyashkov's avatar Alexey Lyashkov
Browse files

use userland bitops from libcfs.

b=14390
i=green
i=deen
parent b538eb38
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -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);
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment