"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "extent_io.c" between
btrfs-progs-v5.4.tar.xz and btrfs-progs-v5.4.1.tar.xz

About: btrfs-progs are the userspace utilities for the Linux Btrfs filesystem.

extent_io.c  (btrfs-progs-v5.4.tar.xz):extent_io.c  (btrfs-progs-v5.4.1.tar.xz)
skipping to change at line 768 skipping to change at line 768
return NULL; return NULL;
} }
list_add_tail(&eb->lru, &tree->lru); list_add_tail(&eb->lru, &tree->lru);
tree->cache_size += blocksize; tree->cache_size += blocksize;
if (tree->cache_size >= tree->max_cache_size) if (tree->cache_size >= tree->max_cache_size)
trim_extent_buffer_cache(tree); trim_extent_buffer_cache(tree);
} }
return eb; return eb;
} }
/*
* Allocate a dummy extent buffer which won't be inserted into extent buffer
* cache.
*
* This mostly allows super block read write using existing eb infrastructure
* without pulluting the eb cache.
*
* This is especially important to avoid injecting eb->start == SZ_64K, as
* fuzzed image could have invalid tree bytenr covers super block range,
* and cause ref count underflow.
*/
struct extent_buffer *alloc_dummy_extent_buffer(struct btrfs_fs_info *fs_info,
u64 bytenr, u32 blocksize)
{
struct extent_buffer *ret;
ret = __alloc_extent_buffer(fs_info, bytenr, blocksize);
if (!ret)
return NULL;
ret->tree = NULL;
ret->flags |= EXTENT_BUFFER_DUMMY;
return ret;
}
int read_extent_from_disk(struct extent_buffer *eb, int read_extent_from_disk(struct extent_buffer *eb,
unsigned long offset, unsigned long len) unsigned long offset, unsigned long len)
{ {
int ret; int ret;
ret = pread(eb->fd, eb->data + offset, len, eb->dev_bytenr); ret = pread(eb->fd, eb->data + offset, len, eb->dev_bytenr);
if (ret < 0) { if (ret < 0) {
ret = -errno; ret = -errno;
goto out; goto out;
} }
if (ret != len) { if (ret != len) {
 End of changes. 1 change blocks. 
0 lines changed or deleted 26 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)