From patchwork Fri Nov 11 12:05:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 9422885 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 218A260233 for ; Fri, 11 Nov 2016 12:08:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 144A8299EE for ; Fri, 11 Nov 2016 12:08:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 096BF29A14; Fri, 11 Nov 2016 12:08:06 +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 A733E299EE for ; Fri, 11 Nov 2016 12:08:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933532AbcKKMHG (ORCPT ); Fri, 11 Nov 2016 07:07:06 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35253 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933254AbcKKMHE (ORCPT ); Fri, 11 Nov 2016 07:07:04 -0500 Received: by mail-pf0-f193.google.com with SMTP id i88so2404794pfk.2; Fri, 11 Nov 2016 04:07:04 -0800 (PST) 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=TYMozGFDPPTdpBzVOVpm0YLoh4gNj5qc5KSWmFJAbBA=; b=msZjjYw2/3EI7ZkFxXCTWh4h8RJOXThmHp5gyFMHoFRiW2tlN/ybr/9Lp9cfS+ddAP yGswBqZf446JPj+xHFqFmLa5HMGrxvO7ePvv1M2xNuMKXvRQwZW3MxWn/1kugX6dc5uy P1n/6NA6PmWkguMBC78oTuuzH16/6cd/QNUV01CYSG6lK4nlKrK/I4QSd/HyBX4QGPdQ xMcQ9RtLHqiJJUCzB+Owpfa8rqa6dY5NMFH66V+qX7h9onPUtMrGxRyidML0nZhcociK 19BTOnD3+CXgys3UHeO47LfjIk+aHo+5HIDtFdpLwit8GODPeOm0MO/MALkb6BOP+JCZ L9bw== 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=TYMozGFDPPTdpBzVOVpm0YLoh4gNj5qc5KSWmFJAbBA=; b=JAsrlX9B+Ni3siHECXOxseaIKdB2sJdiYgp9sz8Q5V7GzioYaLmaWQvbMQcGtFhpqW DYKo0Q6FRDEEJ32ovgl/HmC6XsSVNfXHSwLPsmzrBzoEU9jpboHgela8GneJ6nPcicNU SXxvN5cb3QQ7b3lrA3a7cuJJdGD3A6St8gKgxMqittA9fgI9Qu8uycjF/CqqT1GOH8tD Y/NNIX5duPT5obTfvJZwbfXyD2RqsXFmT/lZaFFTwCUt9rFl8cgOPFlS12pEG5zGTmOO mOo6vUdBxl9UFMOGMo5CTOiztWPQqjurnpz35COW6XtDXO11+X/vEV2TyVU2sJW0RUP+ Z0DQ== X-Gm-Message-State: ABUngvdUN8i6er8vowZlI1j1RYBdvooXEd6iwnJHhU/ZhUwbaqnRlz22UYeRaSQZP9uxYg== X-Received: by 10.99.198.6 with SMTP id w6mr44300766pgg.35.1478866024012; Fri, 11 Nov 2016 04:07:04 -0800 (PST) Received: from localhost ([45.34.23.101]) by smtp.gmail.com with ESMTPSA id w125sm14799690pfb.8.2016.11.11.04.07.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Nov 2016 04:07:03 -0800 (PST) From: Ming Lei To: Jens Axboe , linux-kernel@vger.kernel.org Cc: linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Christoph Hellwig , Ming Lei , Joern Engel , Prasad Joshi , logfs@logfs.org (open list:LogFS) Subject: [PATCH 09/12] fs: logfs: convert to bio_add_page() in sync_request() Date: Fri, 11 Nov 2016 20:05:37 +0800 Message-Id: <1478865957-25252-10-git-send-email-tom.leiming@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478865957-25252-1-git-send-email-tom.leiming@gmail.com> References: <1478865957-25252-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 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c index dc8cafeee038..e01075790600 100644 --- a/fs/logfs/dev_bdev.c +++ b/fs/logfs/dev_bdev.c @@ -20,13 +20,9 @@ static int sync_request(struct page *page, struct block_device *bdev, int op) struct bio_vec bio_vec; bio_init(&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_add_page(&bio, page, PAGE_SIZE, 0); bio.bi_iter.bi_sector = page->index * (PAGE_SIZE >> 9); - bio.bi_iter.bi_size = PAGE_SIZE; bio_set_op_attrs(&bio, op, 0); return submit_bio_wait(&bio);