Skip to content

Commit

Permalink
btrfs: return ptr error from compression workspace
Browse files Browse the repository at this point in the history
The btrfs compression wrappers translated errors from workspace
allocation to either -ENOMEM or -1.  The compression type workspace
allocators are already returning a ERR_PTR(-ENOMEM).  Just return that
and get rid of the magical -1.

This helps a future patch return errors from the compression wrappers.

Signed-off-by: Zach Brown <zab@redhat.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
Zach Brown authored and Chris Mason committed Jun 10, 2014
1 parent 60e1975 commit 774bcb3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/btrfs/compression.c
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ int btrfs_compress_pages(int type, struct address_space *mapping,

workspace = find_workspace(type);
if (IS_ERR(workspace))
return -1;
return PTR_ERR(workspace);

ret = btrfs_compress_op[type-1]->compress_pages(workspace, mapping,
start, len, pages,
Expand Down Expand Up @@ -923,7 +923,7 @@ static int btrfs_decompress_biovec(int type, struct page **pages_in,

workspace = find_workspace(type);
if (IS_ERR(workspace))
return -ENOMEM;
return PTR_ERR(workspace);

ret = btrfs_compress_op[type-1]->decompress_biovec(workspace, pages_in,
disk_start,
Expand All @@ -945,7 +945,7 @@ int btrfs_decompress(int type, unsigned char *data_in, struct page *dest_page,

workspace = find_workspace(type);
if (IS_ERR(workspace))
return -ENOMEM;
return PTR_ERR(workspace);

ret = btrfs_compress_op[type-1]->decompress(workspace, data_in,
dest_page, start_byte,
Expand Down

0 comments on commit 774bcb3

Please sign in to comment.