Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-9119 lnet: remove debug ioctl
[fs/lustre-release.git]
/
libcfs
/
include
/
libcfs
/
bitmap.h
diff --git
a/libcfs/include/libcfs/bitmap.h
b/libcfs/include/libcfs/bitmap.h
index
e6f156e
..
2847260
100644
(file)
--- a/
libcfs/include/libcfs/bitmap.h
+++ b/
libcfs/include/libcfs/bitmap.h
@@
-15,11
+15,7
@@
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
*
* You should have received a copy of the GNU General Public License
* 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
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
*
* GPL HEADER END
*/
@@
-36,18
+32,19
@@
#ifndef _LIBCFS_BITMAP_H_
#define _LIBCFS_BITMAP_H_
#ifndef _LIBCFS_BITMAP_H_
#define _LIBCFS_BITMAP_H_
-
typedef struct
{
- unsigned int
size;
+
struct cfs_bitmap
{
+ unsigned int size;
unsigned long data[0];
unsigned long data[0];
-}
cfs_bitmap_t
;
+};
#define CFS_BITMAP_SIZE(nbits) \
#define CFS_BITMAP_SIZE(nbits) \
- (((nbits/BITS_PER_LONG)+1)*sizeof(long)+sizeof(cfs_bitmap_t))
+ (((nbits / BITS_PER_LONG) + 1) * sizeof(long) + \
+ sizeof(struct cfs_bitmap))
static inline
static inline
-
cfs_bitmap_t
*CFS_ALLOCATE_BITMAP(int size)
+
struct cfs_bitmap
*CFS_ALLOCATE_BITMAP(int size)
{
{
-
cfs_bitmap_t
*ptr;
+
struct cfs_bitmap
*ptr;
LIBCFS_ALLOC(ptr, CFS_BITMAP_SIZE(size));
if (ptr == NULL)
LIBCFS_ALLOC(ptr, CFS_BITMAP_SIZE(size));
if (ptr == NULL)
@@
-58,7
+55,7
@@
cfs_bitmap_t *CFS_ALLOCATE_BITMAP(int size)
RETURN(ptr);
}
RETURN(ptr);
}
-static inline void CFS_RESET_BITMAP(
cfs_bitmap_t
*bitmap)
+static inline void CFS_RESET_BITMAP(
struct cfs_bitmap
*bitmap)
{
if (bitmap->size > 0) {
int nbits = bitmap->size;
{
if (bitmap->size > 0) {
int nbits = bitmap->size;
@@
-71,38
+68,38
@@
static inline void CFS_RESET_BITMAP(cfs_bitmap_t *bitmap)
#define CFS_FREE_BITMAP(ptr) LIBCFS_FREE(ptr, CFS_BITMAP_SIZE(ptr->size))
static inline
#define CFS_FREE_BITMAP(ptr) LIBCFS_FREE(ptr, CFS_BITMAP_SIZE(ptr->size))
static inline
-void cfs_bitmap_set(
cfs_bitmap_t
*bitmap, int nbit)
+void cfs_bitmap_set(
struct cfs_bitmap
*bitmap, int nbit)
{
set_bit(nbit, bitmap->data);
}
static inline
{
set_bit(nbit, bitmap->data);
}
static inline
-void cfs_bitmap_clear(
cfs_bitmap_t
*bitmap, int nbit)
+void cfs_bitmap_clear(
struct cfs_bitmap
*bitmap, int nbit)
{
test_and_clear_bit(nbit, bitmap->data);
}
static inline
{
test_and_clear_bit(nbit, bitmap->data);
}
static inline
-int cfs_bitmap_check(
cfs_bitmap_t
*bitmap, int nbit)
+int cfs_bitmap_check(
struct cfs_bitmap
*bitmap, int nbit)
{
return test_bit(nbit, bitmap->data);
}
static inline
{
return test_bit(nbit, bitmap->data);
}
static inline
-int cfs_bitmap_test_and_clear(
cfs_bitmap_t
*bitmap, int nbit)
+int cfs_bitmap_test_and_clear(
struct cfs_bitmap
*bitmap, int nbit)
{
return test_and_clear_bit(nbit, bitmap->data);
}
/* return 0 is bitmap has none set bits */
static inline
{
return test_and_clear_bit(nbit, bitmap->data);
}
/* return 0 is bitmap has none set bits */
static inline
-int cfs_bitmap_check_empty(
cfs_bitmap_t
*bitmap)
+int cfs_bitmap_check_empty(
struct cfs_bitmap
*bitmap)
{
return find_first_bit(bitmap->data, bitmap->size) == bitmap->size;
}
static inline
{
return find_first_bit(bitmap->data, bitmap->size) == bitmap->size;
}
static inline
-void cfs_bitmap_copy(
cfs_bitmap_t *new, cfs_bitmap_t
*old)
+void cfs_bitmap_copy(
struct cfs_bitmap *new, struct cfs_bitmap
*old)
{
size_t newsize;
{
size_t newsize;