Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 243176
b: refs/heads/master
c: dac97e5
h: refs/heads/master
v: v3
  • Loading branch information
Yoshinori Sano authored and root committed Mar 28, 2011
1 parent 5bf2545 commit ad48202
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c622ae6085d0c6ad834213bbf1477eb311359078
refs/heads/master: dac97e516c617f9c797f64b0224050b70aea30c7
6 changes: 6 additions & 0 deletions trunk/fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,

WARN_ON(start & ((u64)PAGE_CACHE_SIZE - 1));
cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS);
if (!cb)
return -ENOMEM;
atomic_set(&cb->pending_bios, 0);
cb->errors = 0;
cb->inode = inode;
Expand All @@ -354,6 +356,10 @@ int btrfs_submit_compressed_write(struct inode *inode, u64 start,
bdev = BTRFS_I(inode)->root->fs_info->fs_devices->latest_bdev;

bio = compressed_bio_alloc(bdev, first_byte, GFP_NOFS);
if(!bio) {
kfree(cb);
return -ENOMEM;
}
bio->bi_private = cb;
bio->bi_end_io = end_compressed_bio_write;
atomic_inc(&cb->pending_bios);
Expand Down
4 changes: 4 additions & 0 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -6978,6 +6978,10 @@ static noinline int get_new_locations(struct inode *reloc_inode,
struct disk_extent *old = exts;
max *= 2;
exts = kzalloc(sizeof(*exts) * max, GFP_NOFS);
if (!exts) {
ret = -ENOMEM;
goto out;
}
memcpy(exts, old, sizeof(*exts) * nr);
if (old != *extents)
kfree(old);
Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ static noinline int add_async_extent(struct async_cow *cow,
struct async_extent *async_extent;

async_extent = kmalloc(sizeof(*async_extent), GFP_NOFS);
BUG_ON(!async_extent);
async_extent->start = start;
async_extent->ram_size = ram_size;
async_extent->compressed_size = compressed_size;
Expand Down Expand Up @@ -388,6 +389,7 @@ static noinline int compress_file_range(struct inode *inode,
(BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS))) {
WARN_ON(pages);
pages = kzalloc(sizeof(struct page *) * nr_pages, GFP_NOFS);
BUG_ON(!pages);

if (BTRFS_I(inode)->force_compress)
compress_type = BTRFS_I(inode)->force_compress;
Expand Down

0 comments on commit ad48202

Please sign in to comment.