]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/nilfs2/bmap.h
Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/ickle...
[mirror_ubuntu-artful-kernel.git] / fs / nilfs2 / bmap.h
index 9980d7dbab9122c352b500bf813264a061f45b51..a20569b19929bfc706dc063cfe277b060575c96e 100644 (file)
 
 #define NILFS_BMAP_INVALID_PTR 0
 
-#define nilfs_bmap_dkey_to_key(dkey)   le64_to_cpu(dkey)
-#define nilfs_bmap_key_to_dkey(key)    cpu_to_le64(key)
-#define nilfs_bmap_dptr_to_ptr(dptr)   le64_to_cpu(dptr)
-#define nilfs_bmap_ptr_to_dptr(ptr)    cpu_to_le64(ptr)
-
 #define nilfs_bmap_keydiff_abs(diff)   ((diff) < 0 ? -(diff) : (diff))
 
 
@@ -71,7 +66,7 @@ struct nilfs_bmap_operations {
        int (*bop_delete)(struct nilfs_bmap *, __u64);
        void (*bop_clear)(struct nilfs_bmap *);
 
-       int (*bop_propagate)(const struct nilfs_bmap *, struct buffer_head *);
+       int (*bop_propagate)(struct nilfs_bmap *, struct buffer_head *);
        void (*bop_lookup_dirty_buffers)(struct nilfs_bmap *,
                                         struct list_head *);
 
@@ -110,6 +105,7 @@ static inline int nilfs_bmap_is_new_ptr(unsigned long ptr)
  * @b_last_allocated_ptr: last allocated ptr for data block
  * @b_ptr_type: pointer type
  * @b_state: state
+ * @b_nchildren_per_block: maximum number of child nodes for non-root nodes
  */
 struct nilfs_bmap {
        union {
@@ -123,6 +119,7 @@ struct nilfs_bmap {
        __u64 b_last_allocated_ptr;
        int b_ptr_type;
        int b_state;
+       __u16 b_nchildren_per_block;
 };
 
 /* pointer type */
@@ -224,6 +221,13 @@ static inline void nilfs_bmap_abort_end_ptr(struct nilfs_bmap *bmap,
                nilfs_dat_abort_end(dat, &req->bpr_req);
 }
 
+static inline void nilfs_bmap_set_target_v(struct nilfs_bmap *bmap, __u64 key,
+                                          __u64 ptr)
+{
+       bmap->b_last_allocated_key = key;
+       bmap->b_last_allocated_ptr = ptr;
+}
+
 __u64 nilfs_bmap_data_get_key(const struct nilfs_bmap *,
                              const struct buffer_head *);