From patchwork Wed Jun 14 04:01:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9785287 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 05AFA6038E for ; Wed, 14 Jun 2017 04:02:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EE6D283BD for ; Wed, 14 Jun 2017 04:02:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03EF82858D; Wed, 14 Jun 2017 04:02:19 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable 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 70E4A28589 for ; Wed, 14 Jun 2017 04:02:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750771AbdFNECR (ORCPT ); Wed, 14 Jun 2017 00:02:17 -0400 Received: from mail-pg0-f42.google.com ([74.125.83.42]:32998 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbdFNECM (ORCPT ); Wed, 14 Jun 2017 00:02:12 -0400 Received: by mail-pg0-f42.google.com with SMTP id f185so69555507pgc.0 for ; Tue, 13 Jun 2017 21:02:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JQhJWGPSm2FP7lx+NOQpR6xX9KLnsMOy5g+6gxcho3o=; b=ELPOEOz1+v7R2oPdPzwcGVYjp3Ui5lYiwpWnC6pJsBBvrn0xmBaACXv8NPXIoHP/FR yPOlfloSDZxur9oPafKkzB34WDMBUjPeKuRsa8x426i3DpkgfDxvE53tWgVGtC2xuIqF 5VWaLwLUcWrYQGuzwJEMOYJjGNxLGPWRV8EkTVzamqZuU/d6lzUc1P2DYzwqYQdQjZpn T0ixRniuFgiVHFWFMyl1VY7ePR7wup72B5vtCJXd9wj4JHwZrUh6M/fXhsny8wwJX3Hv i2j5heWAtWKiYV6M0xUOdy1rNAQfEcmFvok5poQ0II4TGDbQqiJPlaK1T4JR+VrN6cxK 3kvg== 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:in-reply-to :references; bh=JQhJWGPSm2FP7lx+NOQpR6xX9KLnsMOy5g+6gxcho3o=; b=pChy6duCxnt4e+jcFh2OTZthcoIxxy/PMc3Ol3DQDST+k8UW8+t+t/4AZmOTQnUhKa GU7AftEQKzlheLSJLT4/zEBWE7HSXkCpZLsMzs+JB4JQqnX5b9yV0FL5EkHng5E7BCfg yf3dm0v+yqTvn4zP1gNGzmSeZQhN7nxtfvkUzAtF/lvBqu/q0OjHwZpUOAoWZkeFq/SD kOZHYGUDfzZ+/gQJi898NKP+YV1W7vZhlLpzR0FVy2B2ejhbaxdzdY6rb37OpmC1VEHJ /dIhbRfDwshWv/pIq+m9lFp7o5SZ1CtK13grO9zVKsq882Zyg6USGcnsvfWTlhN6tDTu eq2w== X-Gm-Message-State: AKS2vOw2zIm7UcyngzxzqmEhzY5prmxGPNzRZ0kOJAwhkMTFKtV+vGI6 Eta/BKCsEg4A6jTK X-Received: by 10.98.19.145 with SMTP id 17mr2247365pft.208.1497412932040; Tue, 13 Jun 2017 21:02:12 -0700 (PDT) Received: from localhost.localdomain (66.29.164.166.static.utbb.net. [66.29.164.166]) by smtp.gmail.com with ESMTPSA id f8sm30914083pfc.14.2017.06.13.21.02.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Jun 2017 21:02:11 -0700 (PDT) From: Jens Axboe To: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org Cc: adilger@dilger.ca, Jens Axboe Subject: [PATCH 06/10] fs: add support for buffered writeback to pass down stream information Date: Tue, 13 Jun 2017 22:01:55 -0600 Message-Id: <1497412919-19400-7-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497412919-19400-1-git-send-email-axboe@kernel.dk> References: <1497412919-19400-1-git-send-email-axboe@kernel.dk> 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 Reviewed-by: Andreas Dilger Signed-off-by: Jens Axboe --- fs/buffer.c | 14 +++++++++----- fs/mpage.c | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 161be58c5cb0..8324c24751ca 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -49,7 +49,7 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, - struct writeback_control *wbc); + unsigned int stream, struct writeback_control *wbc); #define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers) @@ -1829,7 +1829,8 @@ int __block_write_full_page(struct inode *inode, struct page *page, do { struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { - submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc); + submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, + inode_streamid(inode), wbc); nr_underway++; } bh = next; @@ -1883,7 +1884,8 @@ int __block_write_full_page(struct inode *inode, struct page *page, struct buffer_head *next = bh->b_this_page; if (buffer_async_write(bh)) { clear_buffer_dirty(bh); - submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc); + submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, + inode_streamid(inode), wbc); nr_underway++; } bh = next; @@ -3091,7 +3093,7 @@ void guard_bio_eod(int op, struct bio *bio) } static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, - struct writeback_control *wbc) + unsigned int stream, struct writeback_control *wbc) { struct bio *bio; @@ -3130,6 +3132,8 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, /* Take care of bh's that straddle the end of the device */ guard_bio_eod(op, bio); + bio_set_streamid(bio, stream); + if (buffer_meta(bh)) op_flags |= REQ_META; if (buffer_prio(bh)) @@ -3142,7 +3146,7 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh, int submit_bh(int op, int op_flags, struct buffer_head *bh) { - return submit_bh_wbc(op, op_flags, bh, NULL); + return submit_bh_wbc(op, op_flags, bh, 0, NULL); } EXPORT_SYMBOL(submit_bh); diff --git a/fs/mpage.c b/fs/mpage.c index baff8f820c29..a9d40c0c053e 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -614,6 +614,7 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc, goto confused; wbc_init_bio(wbc, bio); + bio_set_streamid(bio, inode_streamid(inode)); } /*