From patchwork Tue Dec 27 16:04:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9489463 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 2C3A162AAD for ; Tue, 27 Dec 2016 16:05:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DD47201BC for ; Tue, 27 Dec 2016 16:05:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11CED223B2; Tue, 27 Dec 2016 16:05:32 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4F5A201BC for ; Tue, 27 Dec 2016 16:05:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754600AbcL0QFa (ORCPT ); Tue, 27 Dec 2016 11:05:30 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:35500 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753224AbcL0QFa (ORCPT ); Tue, 27 Dec 2016 11:05:30 -0500 Received: by mail-pg0-f67.google.com with SMTP id i5so12800735pgh.2; Tue, 27 Dec 2016 08:05:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6YFKGh3HS6T9G3jYtN4mbhasuG3l4C0aINy86NPzPos=; b=uXUlInt+npbvhTaU4GKgFTWUx1FCh2dhhb6PA8b7k2EWcZSjrimsiWwg7+dkzix5Lk B7UhPtVV3toaZbit7KQsKD0D13iMYwHY8nF7LOz7bIcGrj75WQIitSlZloSHYd2KrDYO zXs7n031aXVY0Z7v/PboesjStNVL+OBFgaxw7Rv3KZHLlQ+Fa8cvCDilkIho+fDx/xkf yo3GtxWterSaWbhONTs3mZYtVW1Xkm7uvxrv44yu77IkPldtBeUc4HAOKZhWr4MRZF0Y W1qkBAmr6q9yNnZ8DXUSa9H5R1XVeuqQAqggwZcp0Ba5POgrLwHnnn92s2uVX5/5gMxt lq2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6YFKGh3HS6T9G3jYtN4mbhasuG3l4C0aINy86NPzPos=; b=KgEc5e0gX9scDkcz52xwxo+nZDQUn/RyhvCgYlqgZKQCxCgY+2YpSxddzprnmQljX+ vJXZ9tH09qLGqPU0zk5liDQWjtVJFkKO9/nKcOrmMryDwGjo1QMmBBwTDxrKh04DHlCZ 93it/o/U+pD6tSHvk+tGajxaSlbN3HD5cQRr+49J1xVEyMIvuFgLi/GkZY3uW7Ytfdm8 TPjEPUDin4tTdyfRWLcta7r6e9J494aJ1MljSRnybtVRrfYvOawkxQXZ/OxiSAJM1ddn AjImLXuRXwnvpgRdzjivSMTpU8w/sfQ735oG2VUTr+Ysv7oH9p+mMeuI0sJyjg65PO/U r+vQ== X-Gm-Message-State: AIkVDXIbEhmATsgghyA5rYRqnX7JmpNNcA745NrjkHFo2lOqY2BovRpH8NnVk8Qzp4JbkQ== X-Received: by 10.84.218.197 with SMTP id g5mr68267827plm.173.1482854729366; Tue, 27 Dec 2016 08:05:29 -0800 (PST) Received: from localhost ([45.35.47.137]) by smtp.gmail.com with ESMTPSA id o89sm34827262pfi.26.2016.12.27.08.05.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 08:05:27 -0800 (PST) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, Christoph Hellwig , Ming Lei , Johannes Berg Subject: [PATCH v1 32/54] block: introduce bvec_get_last_sp() Date: Wed, 28 Dec 2016 00:04:41 +0800 Message-Id: <1482854706-14128-1-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP BTRFS need to get the last singlepage bvec, so introduce this helper to make it happy. Signed-off-by: Ming Lei --- include/linux/bvec.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/bvec.h b/include/linux/bvec.h index baf379d56106..e9a623067c52 100644 --- a/include/linux/bvec.h +++ b/include/linux/bvec.h @@ -206,4 +206,14 @@ static inline void bvec_iter_advance_mp(const struct bio_vec *bv, #define bvec_for_each_sp_bvec(sp_bvl, mp_bvec, iter) \ __bvec_for_each_sp_bvec(sp_bvl, mp_bvec, iter, BVEC_ITER_ALL_INIT) +/* get the last singlepage bvec from the multipage bvec */ +static inline void bvec_get_last_sp(struct bio_vec *mp_bv, + struct bio_vec *sp_bv) +{ + struct bvec_iter iter; + + bvec_for_each_sp_bvec(*sp_bv, mp_bv, iter) + ; +} + #endif /* __LINUX_BVEC_ITER_H */