early work to file_write in big extents
authorChris Mason <chris.mason@oracle.com>
Mon, 16 Apr 2007 13:23:09 +0000 (09:23 -0400)
committerDavid Woodhouse <dwmw2@hera.kernel.org>
Mon, 16 Apr 2007 13:23:09 +0000 (09:23 -0400)
ctree.h
print-tree.c

diff --git a/ctree.h b/ctree.h
index fb1f5d5..5cf28be 100644 (file)
--- a/ctree.h
+++ b/ctree.h
@@ -223,6 +223,7 @@ struct btrfs_file_extent_item {
 } __attribute__ ((__packed__));
 
 struct btrfs_csum_item {
+       __le64 extent_offset;
        u8 csum[BTRFS_CSUM_SIZE];
 } __attribute__ ((__packed__));
 
@@ -911,6 +912,17 @@ static inline void btrfs_set_file_extent_num_blocks(struct
        e->num_blocks = cpu_to_le64(val);
 }
 
+static inline u64 btrfs_csum_extent_offset(struct btrfs_csum_item *c)
+{
+       return le64_to_cpu(c->extent_offset);
+}
+
+static inline void btrfs_set_csum_extent_offset(struct btrfs_csum_item *c,
+                                               u64 val)
+{
+       c->extent_offset = cpu_to_le64(val);
+}
+
 static inline u16 btrfs_device_pathlen(struct btrfs_device_item *d)
 {
        return le16_to_cpu(d->pathlen);
index 0250d33..2fac77e 100644 (file)
@@ -16,6 +16,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
        struct btrfs_device_item *devi;
        struct btrfs_inode_item *ii;
        struct btrfs_file_extent_item *fi;
+       struct btrfs_csum_item *ci;
        char *p;
        u32 type;
 
@@ -76,6 +77,11 @@ void btrfs_print_leaf(struct btrfs_root *root, struct btrfs_leaf *l)
                        printf("\t\textent data refs %u\n",
                                btrfs_extent_refs(ei));
                        break;
+               case BTRFS_CSUM_ITEM_KEY:
+                       ci = btrfs_item_ptr(l, i,
+                                           struct btrfs_csum_item);
+                       printf("\t\tcsum item\n");
+                       break;
                case BTRFS_EXTENT_DATA_KEY:
                        fi = btrfs_item_ptr(l, i,
                                            struct btrfs_file_extent_item);