From patchwork Fri Nov 11 12:05:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9426765 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2622F60471 for ; Mon, 14 Nov 2016 08:27:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 120DB28567 for ; Mon, 14 Nov 2016 08:27:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04998287E7; Mon, 14 Nov 2016 08:27:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 491C528567 for ; Mon, 14 Nov 2016 08:27:13 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id uAE8PpR5002758; Mon, 14 Nov 2016 03:25:52 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id uABC6rbd007503 for ; Fri, 11 Nov 2016 07:06:53 -0500 Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uABC6rvC000495 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 11 Nov 2016 07:06:53 -0500 Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 046758F4EC; Fri, 11 Nov 2016 12:06:52 +0000 (UTC) Received: by mail-pf0-f193.google.com with SMTP id 144so2418401pfv.0; Fri, 11 Nov 2016 04:06:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VwMTlMO28X0Ecr0jols8MJDIQ4JEG4gB++xsSlHMxKY=; b=fm5Vqtk1Yzg8wT0zsDUldqO2DP0+k/0GNWS5q+KZ9+5qljI4BODRdVby8g7HY2uwU6 59cy+SVugMbzFMbd/PYO/kjiW+352OgWFwyZ3sLUDSDqs87GlzoOKShQEthTBD8+5HLK 4+jgCMR/CUwopBX9pBCBFg84PwlMU77fbo65Ju0X+ZI/GwLHNKgyKGxOYWNPftVXwMZT Q/y3vy0tGCYrISiyqlv0phCFolyjfFI/OPl4bDl7CWLpzhhGJ48sQkJ1tLVkhVGZRH23 Tf/Zb/ZsT6C3h4aoo93rJt08efYzMU7AHisp3HNyAN6UEEZGlEh5m91gNaf4x0laz5BT ZJ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VwMTlMO28X0Ecr0jols8MJDIQ4JEG4gB++xsSlHMxKY=; b=OchuJY7G5O8J7ZB6Aq5W0x5x3c8kfGeZw3KLQBvALg1kjGyFTWMMuVErcir3DhUpnE syf1JgDM7T0Gz74qnw1YoYw6GQ9Ny7q6zRy42WwO5YxFPAYuDmuyy0yAlmcyrnn3e82A 7T4k+ZlE8Bo+i0+Cukro20zFwTrW4Ob1tFxxGz3sIyBiBkahBwQkdqEma1cL2dAC51m+ q2QRDbygc58MzADFoHr7UsUYI7BobAyvSgyJtsUlnMx1McQRfd6Rx52dww2WgZbmutmC ujb+8yjKOB7Nq3Wp2vpX4QnpSZko3pJmGs+trpjenCmfHHGrilIOOT9tL/etOlLrr7Hc +p5Q== X-Gm-Message-State: ABUngvea7SlzykktJTZIUTaISl/3zKz0kyc96SjCRwl8n5P9DAxRZhfuSx7u/ci7TUrlng== X-Received: by 10.98.150.88 with SMTP id c85mr6384331pfe.68.1478866011486; Fri, 11 Nov 2016 04:06:51 -0800 (PST) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id v6sm14757899paz.45.2016.11.11.04.06.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Nov 2016 04:06:50 -0800 (PST) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Date: Fri, 11 Nov 2016 20:05:34 +0800 Message-Id: <1478865957-25252-7-git-send-email-tom.leiming@gmail.com> In-Reply-To: <1478865957-25252-1-git-send-email-tom.leiming@gmail.com> References: <1478865957-25252-1-git-send-email-tom.leiming@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 11 Nov 2016 12:06:52 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 11 Nov 2016 12:06:52 +0000 (UTC) for IP:'209.85.192.193' DOMAIN:'mail-pf0-f193.google.com' HELO:'mail-pf0-f193.google.com' FROM:'tom.leiming@gmail.com' RCPT:'' X-RedHat-Spam-Score: -2.209 (BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.192.193 mail-pf0-f193.google.com 209.85.192.193 mail-pf0-f193.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Mon, 14 Nov 2016 03:25:50 -0500 Cc: Christoph Hellwig , Mike Snitzer , Ming Lei , linux-block@vger.kernel.org, "maintainer:DEVICE-MAPPER LVM, Shaohua Li , linux-raid@vger.kernel.org open list:SOFTWARE RAID Multiple DisksSUPPORT" , linux-fsdevel@vger.kernel.org, Alasdair Kergon Subject: [dm-devel] [PATCH 06/12] dm: crypt: use bio_add_page() X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Virus-Scanned: ClamAV using ClamSMTP We have the standard interface to add page to bio, so don't do that in hacking way. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- drivers/md/dm-crypt.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c index 68a9eb4f3f36..e4f86bead9d3 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -994,7 +994,6 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned size) gfp_t gfp_mask = GFP_NOWAIT | __GFP_HIGHMEM; unsigned i, len, remaining_size; struct page *page; - struct bio_vec *bvec; retry: if (unlikely(gfp_mask & __GFP_DIRECT_RECLAIM)) @@ -1019,12 +1018,7 @@ static struct bio *crypt_alloc_buffer(struct dm_crypt_io *io, unsigned size) len = (remaining_size > PAGE_SIZE) ? PAGE_SIZE : remaining_size; - bvec = &clone->bi_io_vec[clone->bi_vcnt++]; - bvec->bv_page = page; - bvec->bv_len = len; - bvec->bv_offset = 0; - - clone->bi_iter.bi_size += len; + bio_add_page(clone, page, len, 0); remaining_size -= len; }