early work to file_write in big extents

master
Chris Mason 2007-04-16 09:23:09 -04:00 committed by David Woodhouse
parent 3eaaf935e5
commit 23218726a2
2 changed files with 18 additions and 0 deletions

12
ctree.h
View File

@ -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);

View 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);