printk("got %d on inserting %Lu %u %Lu start %Lu end %Lu found %Lu %Lu keep was %d\n",ret,ins.objectid,ins.flags,ins.offset,start,end,key.offset,extent_end,keep);
printk("got %d on inserting %Lu %u %Lu start %Lu end %Lu found %Lu %Lu keep was %d\n",ret,ins.objectid,ins.type,ins.offset,start,end,key.offset,extent_end,keep);
}
}
BUG_ON(ret);
BUG_ON(ret);
extent=btrfs_item_ptr(
extent=btrfs_item_ptr(leaf,path->slots[0],
btrfs_buffer_leaf(path->nodes[0]),
path->slots[0],
structbtrfs_file_extent_item);
structbtrfs_file_extent_item);
btrfs_set_file_extent_disk_blocknr(extent,
write_extent_buffer(leaf,&old,
btrfs_file_extent_disk_blocknr(&old));
(unsignedlong)extent,sizeof(old));
btrfs_set_file_extent_disk_num_blocks(extent,
btrfs_file_extent_disk_num_blocks(&old));
btrfs_set_file_extent_offset(extent,
btrfs_set_file_extent_offset(leaf,extent,
btrfs_file_extent_offset(&old)+
le64_to_cpu(old.offset)+
((end-key.offset)>>inode->i_blkbits));
((end-key.offset)>>inode->i_blkbits));
WARN_ON(btrfs_file_extent_num_blocks(&old)<
WARN_ON(le64_to_cpu(old.num_blocks)<
(extent_end-end)>>inode->i_blkbits);
(extent_end-end)>>inode->i_blkbits);
btrfs_set_file_extent_num_blocks(extent,
btrfs_set_file_extent_num_blocks(leaf,extent,
(extent_end-end)>>inode->i_blkbits);
(extent_end-end)>>inode->i_blkbits);
btrfs_set_file_extent_type(extent,
btrfs_set_file_extent_type(leaf,extent,
BTRFS_FILE_EXTENT_REG);
BTRFS_FILE_EXTENT_REG);
btrfs_set_file_extent_generation(extent,
btrfs_file_extent_generation(&old));
btrfs_mark_buffer_dirty(path->nodes[0]);
btrfs_mark_buffer_dirty(path->nodes[0]);
if(btrfs_file_extent_disk_blocknr(&old)!=0){
if(le64_to_cpu(old.disk_blocknr)!=0){
inode->i_blocks+=
inode->i_blocks+=
btrfs_file_extent_num_blocks(extent)<<3;
btrfs_file_extent_num_blocks(leaf,
extent)<<3;
}
}
ret=0;
ret=0;
gotoout;
gotoout;
...
@@ -529,8 +534,8 @@ static int prepare_pages(struct btrfs_root *root,
...
@@ -529,8 +534,8 @@ static int prepare_pages(struct btrfs_root *root,