From patchwork Thu Apr 14 12:02:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8835151 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 67699C0553 for ; Thu, 14 Apr 2016 12:08:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 95BFC20131 for ; Thu, 14 Apr 2016 12:08:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BEFBB20122 for ; Thu, 14 Apr 2016 12:08:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755076AbcDNMIY (ORCPT ); Thu, 14 Apr 2016 08:08:24 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:33324 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754978AbcDNMDi (ORCPT ); Thu, 14 Apr 2016 08:03:38 -0400 Received: by mail-oi0-f68.google.com with SMTP id v67so9555274oie.0; Thu, 14 Apr 2016 05:03:38 -0700 (PDT) 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=KpVoaEdcqyME/4n/P3w9Wd9vnyAvSyfR6XAe2hW9HYI=; b=aAbnQVv43pGLP4elSfsrgWLeSrOoqIssdNbWp6xs1gJdzeVyRhVUk39nDV971AtpNp W0JdgBtfL/G5xYkorZJC05a6uQ0b2hGP1G6OKiRJhM9dVIK6CiYmfBg6fqRo7K/xYLIw dJUApyYwfV4UaWquu7n1oVe7tJLbhTu0d8d9mZ09zyEqGNZgZcPID6begmvfba8FWiLM /7/qx1gXMF4faaWaN13/Z5mFdti+7Sk8501EH/ZL6CVdXJyW5/GrthoRUpKvmxlBPrgL 0CMCNjbIUQidYEnNCaEO167i8RyHqV4yGlBdsNu4+Qp11GThIr1geTf1MsUCbiUjcsNd 7deQ== 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=KpVoaEdcqyME/4n/P3w9Wd9vnyAvSyfR6XAe2hW9HYI=; b=KMe3ONIOSA61Jw35YQ9I6nQ7jP7qKrf4pEkwjFiuRgWfvDLZOvK/xm4i4O8e5o1ZY6 T6QTpNu+DbL3rANY/3uwGE36Fuu3/gduFBgsyWwPxv4BnJJrYqqZG2rL4Ng3UUzd0aiZ a4Sr+5P5bwRveXM80JdndAsKp7rfMbOgILBJbBgBeQo45wMQgK9VMs2AU82zPmDgJsQ0 ZbUvIUrd1Hp5qbPJ+Sb4Jz9FFAvw1o+7fhg2nmtDXmNqJI+goZ4XWFfr+RZ2ggJ4cF2H s9yyx9mBdSrAEEBYisj9Ae2Wa/JEMbe9nRBHngkw/Cm4jIVHybe2vcZPA8xmBtmwG7+2 cjgQ== X-Gm-Message-State: AOPr4FUwhWwP/KWbMC24+hEpCiQHuBkkaswwsAO6HQ8gGdT6ay0/K+v2NGNzsfzxEB+IPg== X-Received: by 10.157.38.227 with SMTP id i32mr6964607otd.68.1460635417582; Thu, 14 Apr 2016 05:03:37 -0700 (PDT) Received: from localhost ([12.228.154.70]) by smtp.gmail.com with ESMTPSA id r10sm13259498oih.15.2016.04.14.05.03.36 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 14 Apr 2016 05:03:37 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com (maintainer:DEVICE-MAPPER (LVM)), Shaohua Li , linux-raid@vger.kernel.org (open list:SOFTWARE RAID (Multiple Disks) SUPPORT) Subject: [PATCH v1 17/27] dm: crypt: use bio_add_page() Date: Thu, 14 Apr 2016 20:02:35 +0800 Message-Id: <1460635375-28282-18-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460635375-28282-1-git-send-email-tom.leiming@gmail.com> References: <1460635375-28282-1-git-send-email-tom.leiming@gmail.com> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 4f3cb35..a2805c1 100644 --- a/drivers/md/dm-crypt.c +++ b/drivers/md/dm-crypt.c @@ -995,7 +995,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)) @@ -1020,12 +1019,7 @@ retry: 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; }