From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: [PATCH 1/3 v2] btrfs: btrfs_decompress_bio() could accept compressed_bio instead
Date: Fri, 26 May 2017 15:44:58 +0800 [thread overview]
Message-ID: <20170526074500.20342-2-anand.jain@oracle.com> (raw)
In-Reply-To: <20170526074500.20342-1-anand.jain@oracle.com>
Instead of sending each argument of struct compressed_bio, send
the compressed_bio itself.
Also by having struct compressed_bio in btrfs_decompress_bio()
it would help tracing.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v2: no changes
fs/btrfs/compression.c | 23 +++++++++--------------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 10e6b282d09d..ee934e612f15 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -81,9 +81,7 @@ struct compressed_bio {
u32 sums;
};
-static int btrfs_decompress_bio(int type, struct page **pages_in,
- u64 disk_start, struct bio *orig_bio,
- size_t srclen);
+static int btrfs_decompress_bio(struct compressed_bio *cb);
static inline int compressed_bio_size(struct btrfs_fs_info *fs_info,
unsigned long disk_size)
@@ -173,11 +171,8 @@ static void end_compressed_bio_read(struct bio *bio)
/* ok, we're the last bio for this extent, lets start
* the decompression.
*/
- ret = btrfs_decompress_bio(cb->compress_type,
- cb->compressed_pages,
- cb->start,
- cb->orig_bio,
- cb->compressed_len);
+ ret = btrfs_decompress_bio(cb);
+
csum_failed:
if (ret)
cb->errors = 1;
@@ -961,18 +956,18 @@ int btrfs_compress_pages(int type, struct address_space *mapping,
* be contiguous. They all correspond to the range of bytes covered by
* the compressed extent.
*/
-static int btrfs_decompress_bio(int type, struct page **pages_in,
- u64 disk_start, struct bio *orig_bio,
- size_t srclen)
+static int btrfs_decompress_bio(struct compressed_bio *cb)
{
struct list_head *workspace;
int ret;
+ int type = cb->compress_type;
workspace = find_workspace(type);
- ret = btrfs_compress_op[type-1]->decompress_bio(workspace, pages_in,
- disk_start, orig_bio,
- srclen);
+ ret = btrfs_compress_op[type-1]->decompress_bio(workspace,
+ cb->compressed_pages, cb->start, cb->orig_bio,
+ cb->compressed_len);
+
free_workspace(type, workspace);
return ret;
}
--
2.10.0
next prev parent reply other threads:[~2017-05-26 7:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-26 7:44 [PATCH 0/3 v2] compression ops args clean up and trace point Anand Jain
2017-05-26 7:44 ` Anand Jain [this message]
2017-05-26 7:42 ` [PATCH 1/3 v2] btrfs: btrfs_decompress_bio() could accept compressed_bio instead Nikolay Borisov
2017-05-26 17:54 ` David Sterba
2017-05-26 7:44 ` [PATCH 2/3 v2] btrfs: reduce arguments for decompress_bio ops Anand Jain
2017-05-26 7:43 ` Nikolay Borisov
2017-05-26 8:34 ` Anand Jain
2017-05-26 14:07 ` kbuild test robot
2017-05-26 22:39 ` Anand Jain
2017-05-26 22:36 ` [PATCH] fixup: " Anand Jain
2017-05-29 13:52 ` David Sterba
2017-05-26 7:45 ` [PATCH 3/3 v2] btrfs: add compression trace points Anand Jain
2017-05-26 18:08 ` David Sterba
2017-05-26 23:37 ` Anand Jain
2017-05-26 18:09 ` [PATCH 0/3 v2] compression ops args clean up and trace point David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170526074500.20342-2-anand.jain@oracle.com \
--to=anand.jain@oracle.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).