2 * bmap64.h --- 64-bit bitmap structure
4 * Copyright (C) 2007, 2008 Theodore Ts'o.
7 * This file may be redistributed under the terms of the GNU Public
12 struct ext2fs_struct_generic_bitmap
{
15 struct ext2_bitmap_ops
*bitmap_ops
;
22 errcode_t base_error_code
;
25 #define EXT2FS_IS_32_BITMAP(bmap) \
26 (((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP) || \
27 ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP) || \
28 ((bmap)->magic == EXT2_ET_MAGIC_INODE_BITMAP))
30 #define EXT2FS_IS_64_BITMAP(bmap) \
31 (((bmap)->magic == EXT2_ET_MAGIC_GENERIC_BITMAP64) || \
32 ((bmap)->magic == EXT2_ET_MAGIC_BLOCK_BITMAP64) || \
33 ((bmap)->magic == EXT2_ET_MAGIC_INODE_BITMAP64))
35 struct ext2_bitmap_ops
{
37 /* Generic bmap operators */
38 errcode_t (*new_bmap
)(ext2_filsys fs
, ext2fs_generic_bitmap bmap
);
39 void (*free_bmap
)(ext2fs_generic_bitmap bitmap
);
40 errcode_t (*copy_bmap
)(ext2fs_generic_bitmap src
,
41 ext2fs_generic_bitmap dest
);
42 errcode_t (*resize_bmap
)(ext2fs_generic_bitmap bitmap
,
45 /* bit set/test operators */
46 int (*mark_bmap
)(ext2fs_generic_bitmap bitmap
, __u64 arg
);
47 int (*unmark_bmap
)(ext2fs_generic_bitmap bitmap
, __u64 arg
);
48 int (*test_bmap
)(ext2fs_generic_bitmap bitmap
, __u64 arg
);
49 void (*mark_bmap_extent
)(ext2fs_generic_bitmap bitmap
, __u64 arg
,
51 void (*unmark_bmap_extent
)(ext2fs_generic_bitmap bitmap
, __u64 arg
,
53 int (*test_clear_bmap_extent
)(ext2fs_generic_bitmap bitmap
,
54 __u64 arg
, unsigned int num
);
55 errcode_t (*set_bmap_range
)(ext2fs_generic_bitmap bitmap
,
56 __u64 start
, size_t num
, void *in
);
57 errcode_t (*get_bmap_range
)(ext2fs_generic_bitmap bitmap
,
58 __u64 start
, size_t num
, void *out
);
59 void (*clear_bmap
)(ext2fs_generic_bitmap bitmap
);
62 extern struct ext2_bitmap_ops ext2fs_blkmap64_bitarray
;