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: 8868431 X-Patchwork-Delegate: snitzer@redhat.com Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 916839F443 for ; Mon, 18 Apr 2016 07:27:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C4D3C200F2 for ; Mon, 18 Apr 2016 07:27:40 +0000 (UTC) Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com [209.132.183.37]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5FD9620254 for ; Mon, 18 Apr 2016 07:27:39 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3I7O4ja063924; Mon, 18 Apr 2016 03:24:04 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u3EC3cgJ026765 for ; Thu, 14 Apr 2016 08:03:38 -0400 Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3EC3cQ3022633 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 14 Apr 2016 08:03:38 -0400 Received: from mail-oi0-f65.google.com (mail-oi0-f65.google.com [209.85.218.65]) (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 23B5C3B707; Thu, 14 Apr 2016 12:03:38 +0000 (UTC) Received: by mail-oi0-f65.google.com with SMTP id v126so9552140oia.3; 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=GwmOb9zzC6HRHlMOGUSuznIXoQnxa/EJHwPoRuUvz2zUD29wnMF6YOSQ7HCujAGDX/ Qoz8S3+pp1mTHkIzdy0fMEw82he1RYLRksmwWGTRRYj/rYREL482nY+jWlavfXCNgeI6 /b/ag+BBKiVJ3WVA74eaG6CnOxCnElR6Hvnmxo3ClW0WCrUdL2HNZ9JhbfAaYQzDD7MC pImA2+akhl2cQxwwetATzLqz9E93Hu7D0Bu4ocIFy2HIGI4+x4LyIwXOTrA2/hDH9zrK 6jeLyYGab+zs5BaI/gqhtW80cpIyps5jHqGnlFqTKU7FZRY7h1AKOm2jhmxI9YBhWmii ANGw== X-Gm-Message-State: AOPr4FVPJ/T4sCukVLIql7WXa9lIVT+7eh1YeCSSJY30ym9qAU2PGzD6xAxNvoY2ZxHOOQ== 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 Date: Thu, 14 Apr 2016 20:02:35 +0800 Message-Id: <1460635375-28282-18-git-send-email-tom.leiming@gmail.com> In-Reply-To: <1460635375-28282-1-git-send-email-tom.leiming@gmail.com> References: <1460635375-28282-1-git-send-email-tom.leiming@gmail.com> X-RedHat-Spam-Score: -0.821 (BAYES_20, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_PASS) 209.85.218.65 mail-oi0-f65.google.com 209.85.218.65 mail-oi0-f65.google.com X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Mon, 18 Apr 2016 03:22:14 -0400 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" , Alasdair Kergon Subject: [dm-devel] [PATCH v1 17/27] 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-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable 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; }