From patchwork Tue Apr 5 12:07:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 8750951 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 1C3FCC0553 for ; Tue, 5 Apr 2016 12:11:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1915120117 for ; Tue, 5 Apr 2016 12:11:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B47120204 for ; Tue, 5 Apr 2016 12:11:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758372AbcDEMIa (ORCPT ); Tue, 5 Apr 2016 08:08:30 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:36162 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758365AbcDEMI3 (ORCPT ); Tue, 5 Apr 2016 08:08:29 -0400 Received: by mail-pa0-f68.google.com with SMTP id 1so1136113pal.3; Tue, 05 Apr 2016 05:08:28 -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=+W2bApjUdTGMAl2yRNOPlqQoYT3KOB2QkxtGbWwZlMo=; b=THCRmEFEw1Jdjzr0kiyeDKnuTheq2ibVb0nPAIqKcI+KM865bU7uQ6WHI5TQ/1lz2Y WYpWZyDBnwGKa7ehkO9KPKVXrnhljF6h3UOKLH6SZq4tE2VKcgsGMp/Bmse1L49SoXDc 9xz6N7KeIB0MLWZQ8UCCrnFiCeXxhL95V/tjSmENFAXwXpDBYoilNEq6hFd342IR8IL5 TBACLPL6+Ijvt/7ZEvNlvuJuK7W8GtPj+M55802mtKV8Lcn4u6wCaxMIyu614ifAGRQT ba4DJp75atoWoGRhzIvIgxaXzUtu/a56AIv9mzVfqmog9pZIz1IYrtLJ6Bci5iKvqerc FsQA== 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=+W2bApjUdTGMAl2yRNOPlqQoYT3KOB2QkxtGbWwZlMo=; b=XtgB/igDn7PSig8+VRSyWRlau3FdaJFGIRn/lQ4dv5LIuRoR6/2fIRlMabTiKewxqJ /GzoHQn/m+x1IV7oER29JlDT12hHqhiTJ/DOdWFflBPlqgbTjbFTEuTuoaYq/dar/8Ci 7cqkuOzshuPzi92WJEm61rVlQceetd2tNtmQtFjz/s5E2w/+f9FZijReRzASBO5f/SIo 0er0siHAzq07btLLd1qN5ZsosZVWgc4s1lW2rOFVB001+T0enmGGytmzwkGzRM+4ePrZ u7XVp+SvHyRx+8l8MnGyUFpCvt8iOThTl9pqn6lFQw/zCsc5PQpikRNDU+shJNoBqP07 ZIEA== X-Gm-Message-State: AD7BkJJwddBWu8+MyYiv7By3riIx40n7LVB3H/4GgLJNYuqsZovPZYQLNQBJRusQKGKsiQ== X-Received: by 10.67.8.100 with SMTP id dj4mr61691541pad.88.1459858108595; Tue, 05 Apr 2016 05:08:28 -0700 (PDT) Received: from localhost (56.34.213.162.lcy-01.canonistack.canonical.com. [162.213.34.56]) by smtp.gmail.com with ESMTPSA id ko9sm7450426pab.37.2016.04.05.05.08.18 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 05 Apr 2016 05:08:27 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Boaz Harrosh , 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 17/27] dm: crypt: use bio_add_page() Date: Tue, 5 Apr 2016 20:07:32 +0800 Message-Id: <1459858062-21075-3-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1459858062-21075-1-git-send-email-tom.leiming@gmail.com> References: <1459858062-21075-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 Signed-off-by: Ming Lei Reviewed-by: Christoph Hellwig --- 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; }