From patchwork Wed Jun 21 00:22:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9800465 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 D64A760871 for ; Wed, 21 Jun 2017 00:22:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7C362846B for ; Wed, 21 Jun 2017 00:22:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCCFE28488; Wed, 21 Jun 2017 00:22:28 +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 6E4D92846B for ; Wed, 21 Jun 2017 00:22:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752830AbdFUAWW (ORCPT ); Tue, 20 Jun 2017 20:22:22 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:34830 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752844AbdFUAWS (ORCPT ); Tue, 20 Jun 2017 20:22:18 -0400 Received: by mail-pf0-f170.google.com with SMTP id c73so16661702pfk.2 for ; Tue, 20 Jun 2017 17:22:18 -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=tvQWm8733FSwyFVbjwkLKOJTWYaM7ZynL64PWMwvt9w=; b=P4hMldwbgGqh+37QP4QTIvqx48vwtu4oA1l2bLiZYDhsbq1GCp2RNI/hkbg76Ke+lO XUCHQJVYdRRrZfo7lTHYjj3/oLkZeCwpxhGLWIVEydCBuscUx0A4r5IKl0Q83CTy/Hvg 7Lb+UXwW3vziOSYOoys/OpAza2kqxFBpGiIu8x/NUmzj2T4MPmlLJergkIwFh4tOm1J9 MUZ3jObk2eYZDAs+5Dm2leqc9dC4WBCafqewMQueuWiG6uZ3TAjvJ7ZpeeHAm9qwwVdN of5T4oAqPagARZoHO9k1QybiNEHMMX3S7oZlI54nBAOtR2ONirOn/8tNCfbozPI4o9Sf wbAg== 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=tvQWm8733FSwyFVbjwkLKOJTWYaM7ZynL64PWMwvt9w=; b=h31HsZLI8xhg+k0SkEzdyacVz5oys2kIa2VBAJ3T5ki29FsZPj0bwiWhVkuQ5PclrT eP653U/IstnFvu7I9rnRVIIk9H3a9/z+KZ1ylYzbVRUX19wbkBtImlBEMhzEBr5JtC4/ dilycVBMPeT+WLUIBIwf3n5qdCgkibKG+imGTMEHxr50u2jhs9W2O4fulM8OnusUjhP5 o4Z23kt3/zaBrGaW0luYzglp3Wot1c89pAeQ7rCOs9pvmvWZX6mxl6Mlsz9vgnShhyy4 u7Ufkysf7M+0v0chOD+yu0u6g3YM3OQGRXOdJbji6B4XFkuHegndknfpcXFRs3IUpitQ RsKA== X-Gm-Message-State: AKS2vOySMHCrCOR0sgzU3SGeF6V0Ta6DerxNG9GMC0qQiShJnblLpfm9 OjjqJReaRAy5bAC2 X-Received: by 10.84.232.7 with SMTP id h7mr11146818plk.193.1498004537951; Tue, 20 Jun 2017 17:22:17 -0700 (PDT) Received: from localhost.localdomain (66.29.164.166.static.utbb.net. [66.29.164.166]) by smtp.gmail.com with ESMTPSA id f10sm13447835pfd.69.2017.06.20.17.22.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 17:22:17 -0700 (PDT) From: Jens Axboe To: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org Cc: adilger@dilger.ca, hch@infradead.org, martin.petersen@oracle.com, linux-nvme@lists.infradead.org, Jens Axboe Subject: [PATCH 6/9] ext4: add support for passing in write hints for buffered writes Date: Tue, 20 Jun 2017 18:22:03 -0600 Message-Id: <1498004526-4543-7-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498004526-4543-1-git-send-email-axboe@kernel.dk> References: <1498004526-4543-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/ext4/page-io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 930ca0fc9a0f..92834b702728 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -350,6 +350,7 @@ void ext4_io_submit(struct ext4_io_submit *io) if (bio) { int io_op_flags = io->io_wbc->sync_mode == WB_SYNC_ALL ? REQ_SYNC : 0; + io_op_flags |= write_hint_to_opf(inode_write_hint(io->io_end->inode)); bio_set_op_attrs(io->io_bio, REQ_OP_WRITE, io_op_flags); submit_bio(io->io_bio); } @@ -397,6 +398,7 @@ static int io_submit_add_bh(struct ext4_io_submit *io, ret = io_submit_init_bio(io, bh); if (ret) return ret; + io->io_bio->bi_opf |= write_hint_to_opf(inode_write_hint(inode)); } ret = bio_add_page(io->io_bio, page, bh->b_size, bh_offset(bh)); if (ret != bh->b_size)