From: Jerome Marchand <jmarchan@redhat.com>
To: karam.lee@lge.com, minchan@kernel.org, ngupta@vflare.org,
linux-kernel@vger.kernel.org
Cc: matthew.r.wilcox@intel.com, seungho1.park@lge.com
Subject: Re: [PATCH v3 1/3] zram: remove bio parameter from zram_bvec_rw().
Date: Tue, 21 Oct 2014 16:08:16 +0200 [thread overview]
Message-ID: <544668D0.30302@redhat.com> (raw)
In-Reply-To: <1413876458-19279-2-git-send-email-karam.lee@lge.com>
[-- Attachment #1: Type: text/plain, Size: 2845 bytes --]
On 10/21/2014 09:27 AM, karam.lee@lge.com wrote:
> From: "karam.lee" <karam.lee@lge.com>
>
> This patch removes an unnecessary parameter(bio)
> from zram_bvec_rw() and zram_bvec_read().
> zram_bvec_read() doesn't use a bio parameter, so remove it.
> zram_bvec_rw() calls a read/write operation not using bio, so a rw parameter
> replaces a bio parameter.
>
> Signed-off-by: karam.lee <karam.lee@lge.com>
Acked-by: Jerome Marchand <jmarchan@redhat.com>
> ---
> drivers/block/zram/zram_drv.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index 48eccb3..54da18a 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -368,7 +368,7 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index)
> }
>
> static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
> - u32 index, int offset, struct bio *bio)
> + u32 index, int offset)
> {
> int ret;
> struct page *page;
> @@ -535,14 +535,13 @@ out:
> }
>
> static int zram_bvec_rw(struct zram *zram, struct bio_vec *bvec, u32 index,
> - int offset, struct bio *bio)
> + int offset, int rw)
> {
> int ret;
> - int rw = bio_data_dir(bio);
>
> if (rw == READ) {
> atomic64_inc(&zram->stats.num_reads);
> - ret = zram_bvec_read(zram, bvec, index, offset, bio);
> + ret = zram_bvec_read(zram, bvec, index, offset);
> } else {
> atomic64_inc(&zram->stats.num_writes);
> ret = zram_bvec_write(zram, bvec, index, offset);
> @@ -718,7 +717,7 @@ out:
>
> static void __zram_make_request(struct zram *zram, struct bio *bio)
> {
> - int offset;
> + int offset, rw;
> u32 index;
> struct bio_vec bvec;
> struct bvec_iter iter;
> @@ -733,6 +732,7 @@ static void __zram_make_request(struct zram *zram, struct bio *bio)
> return;
> }
>
> + rw = bio_data_dir(bio);
> bio_for_each_segment(bvec, bio, iter) {
> int max_transfer_size = PAGE_SIZE - offset;
>
> @@ -747,15 +747,15 @@ static void __zram_make_request(struct zram *zram, struct bio *bio)
> bv.bv_len = max_transfer_size;
> bv.bv_offset = bvec.bv_offset;
>
> - if (zram_bvec_rw(zram, &bv, index, offset, bio) < 0)
> + if (zram_bvec_rw(zram, &bv, index, offset, rw) < 0)
> goto out;
>
> bv.bv_len = bvec.bv_len - max_transfer_size;
> bv.bv_offset += max_transfer_size;
> - if (zram_bvec_rw(zram, &bv, index + 1, 0, bio) < 0)
> + if (zram_bvec_rw(zram, &bv, index + 1, 0, rw) < 0)
> goto out;
> } else
> - if (zram_bvec_rw(zram, &bvec, index, offset, bio) < 0)
> + if (zram_bvec_rw(zram, &bvec, index, offset, rw) < 0)
> goto out;
>
> update_position(&index, &offset, &bvec);
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2014-10-21 15:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-21 7:27 [PATCH v3 0/3] zram: add rw_page implementation for zram and clean up unnecessary parameter karam.lee
2014-10-21 7:27 ` [PATCH v3 1/3] zram: remove bio parameter from zram_bvec_rw() karam.lee
2014-10-21 14:08 ` Jerome Marchand [this message]
2014-10-21 7:27 ` [PATCH v3 2/3] zram: change parameter from vaild_io_request() karam.lee
2014-10-21 14:09 ` Jerome Marchand
2014-10-21 7:27 ` [PATCH v3 3/3] zram: implement rw_page operation of zram karam.lee
2014-10-21 13:57 ` Jerome Marchand
2014-10-22 1:28 ` karam.lee
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=544668D0.30302@redhat.com \
--to=jmarchan@redhat.com \
--cc=karam.lee@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew.r.wilcox@intel.com \
--cc=minchan@kernel.org \
--cc=ngupta@vflare.org \
--cc=seungho1.park@lge.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.