26 #include <linux/types.h>
33 #define NILFS_BMAP_INVALID_PTR 0
35 #define nilfs_bmap_keydiff_abs(diff) ((diff) < 0 ? -(diff) : (diff))
74 struct buffer_head **,
87 #define NILFS_BMAP_SIZE (NILFS_INODE_BMAP_SIZE * sizeof(__le64))
88 #define NILFS_BMAP_KEY_BIT (sizeof(unsigned long) * 8 )
89 #define NILFS_BMAP_NEW_PTR_INIT \
90 (1UL << (sizeof(unsigned long) * 8 - 1))
92 static inline int nilfs_bmap_is_new_ptr(
unsigned long ptr)
126 #define NILFS_BMAP_PTR_P 0
127 #define NILFS_BMAP_PTR_VS 1
129 #define NILFS_BMAP_PTR_VM 2
131 #define NILFS_BMAP_PTR_U (-1)
133 #define NILFS_BMAP_USE_VBN(bmap) ((bmap)->b_ptr_type > 0)
136 #define NILFS_BMAP_DIRTY 0x00000001
184 static inline int nilfs_bmap_prepare_alloc_ptr(
struct nilfs_bmap *
bmap,
195 static inline void nilfs_bmap_commit_alloc_ptr(
struct nilfs_bmap *bmap,
203 static inline void nilfs_bmap_abort_alloc_ptr(
struct nilfs_bmap *bmap,
213 static inline int nilfs_bmap_prepare_end_ptr(
struct nilfs_bmap *bmap,
220 static inline void nilfs_bmap_commit_end_ptr(
struct nilfs_bmap *bmap,
229 static inline void nilfs_bmap_abort_end_ptr(
struct nilfs_bmap *bmap,
245 const struct buffer_head *);
252 static inline int nilfs_bmap_dirty(
const struct nilfs_bmap *bmap)
258 static inline void nilfs_bmap_set_dirty(
struct nilfs_bmap *bmap)
264 static inline void nilfs_bmap_clear_dirty(
struct nilfs_bmap *bmap)
270 #define NILFS_BMAP_LARGE 0x1
272 #define NILFS_BMAP_SMALL_LOW NILFS_DIRECT_KEY_MIN
273 #define NILFS_BMAP_SMALL_HIGH NILFS_DIRECT_KEY_MAX
274 #define NILFS_BMAP_LARGE_LOW NILFS_BTREE_ROOT_NCHILDREN_MAX
275 #define NILFS_BMAP_LARGE_HIGH NILFS_BTREE_KEY_MAX