From patchwork Sat Oct 29 08:08:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9403437 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 5E5E260587 for ; Sat, 29 Oct 2016 08:30:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4AC562A68A for ; Sat, 29 Oct 2016 08:30:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E1CD2A692; Sat, 29 Oct 2016 08:30:55 +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 vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B53822A68A for ; Sat, 29 Oct 2016 08:30:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933204AbcJ2IMq (ORCPT ); Sat, 29 Oct 2016 04:12:46 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35533 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933122AbcJ2IMm (ORCPT ); Sat, 29 Oct 2016 04:12:42 -0400 Received: by mail-pf0-f195.google.com with SMTP id s8so3377391pfj.2; Sat, 29 Oct 2016 01:12:42 -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=1sSleM8t3tGQlUaE7S+bbwSD8iodaFJ8o/0sQNJUi9o=; b=VaPEtvWr4jqi5+yJSWNwDMm8vqqBZT3OUIC7Zlgr4Wy6Au5mMIAUqASXgLw2HVvPmm TjclaxuMOjzDX7db1F9jqJaqnvUs1FY4pWXgIE0+nqrQ+I5ItNTXdPzxqoYIupTI1PPU 5nb2Wr6UpS03O3GAQJHxv6KvoidV0ThzIKP2vB4jEIB2ZQM8ogupd5o0xxSFMkrXgXQJ JoQ0AaBzI9An/6JdabNVS9qRoa0zpoxaVPuPkjnAFvgd7OJzhsazrZ9RL47ocfijyMpR 9yUCcFPbV+5tF/demp+E9xCfsMGbjbjNtFHbHsTtVSLxBecppbNxHVSz/7kTrCbYJt5C UpXA== 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=1sSleM8t3tGQlUaE7S+bbwSD8iodaFJ8o/0sQNJUi9o=; b=PIZG2XFc7OJE9/6IQWMqvTl5Ag2q2eAyBFUBDP9mh0tgQUaYMf1/4+X8xqZkNzuBp5 e5xqcb6aEgFeXuKf7+AphFDMru1vmhiWKtSJyDAFrqY7t71TBV1/gbW3jFCxPa/sUZW4 /17cTSFNbVTJzSOIsfwxtSq7CORtbTnRApVVL924pRx3xeUJyHgsSnX3+YpgojHJxZW9 ZQsB0DhVm7kEfwDOoDksUqIfOwcF/SXV+OBvQogz6r2oE7BuqnvZN1bJ9a2GXwPa/zya l+0YFKt36chUBAtV/WbSQV1Wc6rllQGnq/dCFYvA2vMlvPNnXdhXIOqdsT23AqrmtNw3 Tu1w== X-Gm-Message-State: ABUngvfxI/5e3sMJKxM4juq3Porp8G0nisiRpvrs4QI2bK6jCAprZPqDFvpBw1vzsAND5g== X-Received: by 10.98.61.85 with SMTP id k82mr31626140pfa.7.1477728761760; Sat, 29 Oct 2016 01:12:41 -0700 (PDT) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id r77sm22199040pfa.85.2016.10.29.01.12.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 29 Oct 2016 01:12:41 -0700 (PDT) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , "Kirill A . Shutemov" , Ming Lei , Joern Engel , Prasad Joshi , logfs@logfs.org (open list:LogFS) Subject: [PATCH 10/60] fs: logfs: convert to bio_add_page() in sync_request() Date: Sat, 29 Oct 2016 16:08:09 +0800 Message-Id: <1477728600-12938-11-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> References: <1477728600-12938-1-git-send-email-tom.leiming@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Always bio_add_page() is the standard and preferred way to do the task. Reviewed-by: Christoph Hellwig Signed-off-by: Ming Lei --- fs/logfs/dev_bdev.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c index 2bf53b0ffe83..696dcdd65fdd 100644 --- a/fs/logfs/dev_bdev.c +++ b/fs/logfs/dev_bdev.c @@ -20,15 +20,12 @@ static int sync_request(struct page *page, struct block_device *bdev, int op) struct bio_vec bio_vec; bio_init_with_vec_table(&bio, &bio_vec, 1); - bio_vec.bv_page = page; - bio_vec.bv_len = PAGE_SIZE; - bio_vec.bv_offset = 0; - bio.bi_vcnt = 1; bio.bi_bdev = bdev; bio.bi_iter.bi_sector = page->index * (PAGE_SIZE >> 9); - bio.bi_iter.bi_size = PAGE_SIZE; bio_set_op_attrs(&bio, op, 0); + bio_add_page(&bio, page, PAGE_SIZE, 0); + return submit_bio_wait(&bio); }