mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-11 03:31:17 +00:00
btrfs-progs: add some missing extent buffer helpers
The following are some extent buffer helpers we have in the kernel but not in btrfs-progs. Sync these in to make syncing ctree.c easier. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
5780714b58
commit
216f442e5e
@ -617,6 +617,12 @@ void copy_extent_buffer(const struct extent_buffer *dst,
|
||||
memcpy((void *)dst->data + dst_offset, src->data + src_offset, len);
|
||||
}
|
||||
|
||||
void copy_extent_buffer_full(const struct extent_buffer *dst,
|
||||
const struct extent_buffer *src)
|
||||
{
|
||||
copy_extent_buffer(dst, src, 0, 0, src->len);
|
||||
}
|
||||
|
||||
void memmove_extent_buffer(const struct extent_buffer *dst, unsigned long dst_offset,
|
||||
unsigned long src_offset, unsigned long len)
|
||||
{
|
||||
@ -634,3 +640,8 @@ int extent_buffer_test_bit(const struct extent_buffer *eb, unsigned long start,
|
||||
{
|
||||
return le_test_bit(nr, (u8 *)eb->data + start);
|
||||
}
|
||||
|
||||
void write_extent_buffer_fsid(const struct extent_buffer *eb, const void *srcv)
|
||||
{
|
||||
write_extent_buffer(eb, srcv, btrfs_header_fsid(), BTRFS_FSID_SIZE);
|
||||
}
|
||||
|
@ -114,6 +114,8 @@ void copy_extent_buffer(const struct extent_buffer *dst,
|
||||
const struct extent_buffer *src,
|
||||
unsigned long dst_offset, unsigned long src_offset,
|
||||
unsigned long len);
|
||||
void copy_extent_buffer_full(const struct extent_buffer *dst,
|
||||
const struct extent_buffer *src);
|
||||
void memmove_extent_buffer(const struct extent_buffer *dst,
|
||||
const unsigned long dst_offset,
|
||||
unsigned long src_offset, unsigned long len);
|
||||
@ -133,5 +135,6 @@ void extent_buffer_bitmap_set(struct extent_buffer *eb, unsigned long start,
|
||||
unsigned long pos, unsigned long len);
|
||||
void extent_buffer_init_cache(struct btrfs_fs_info *fs_info);
|
||||
void extent_buffer_free_cache(struct btrfs_fs_info *fs_info);
|
||||
void write_extent_buffer_fsid(const struct extent_buffer *eb, const void *srcv);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user