From patchwork Mon Jun 19 17:04:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9796915 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 AFE116020B for ; Mon, 19 Jun 2017 17:05:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9539F1FF0B for ; Mon, 19 Jun 2017 17:05:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89D54281F9; Mon, 19 Jun 2017 17:05:20 +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=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 818E21FF0B for ; Mon, 19 Jun 2017 17:05:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751129AbdFSRFP (ORCPT ); Mon, 19 Jun 2017 13:05:15 -0400 Received: from mail-it0-f42.google.com ([209.85.214.42]:38539 "EHLO mail-it0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751081AbdFSRFN (ORCPT ); Mon, 19 Jun 2017 13:05:13 -0400 Received: by mail-it0-f42.google.com with SMTP id b205so47104777itg.1 for ; Mon, 19 Jun 2017 10:05:13 -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=HxtUY7M1jicHJ11bxghMMIAfJf2lcbSM9Lr+3w7KaXs78Q0vz+hEMyNjChcNZGVmtH iM6EFeswsWPvMy6UqMQsSwTvUHq8v7upr3u4xFgF5ZOTvPoGafrVBT6e5YO1YaEoThXC SIainbWthEIXW5LskmJK65labvEhMFnqdrY971/i0IBosuWk7suXvTvhu3c7UdEoUwkV uptLigOmvwiXGb0FHKfV8cB9xEO6VJjykgq35Xvqmx1XOSiV6zFpemNqZv4tJnftV1AO IYdcz1mMSpNpH5s8PKjn1mf19ovYFIiY/wVroDtfGmejhy2pwpiRUd0ribyumLcsMMXl E/6w== 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=JLR/iGgjVJ/GNL7krAstfb4RLwLM3e4nRxkHCW4r4yJ2NUbWnp8uNWd8o5yPp9sOmE /0cnQdew5en+unxkqLtgFtdrBJHH+iRY5VzzqhVfiC59SYBoFWmmvDTN3A7/ajA029PC Dw/zxfZgUiRmqHgnGoKB1KnTTw1CH3yOIBFT0mRxMYCipwn2+AByGsn1aVMi4EKTLxFu A5L5zW5sjVtsAED+RUD1JHVJuHhZQ7pAVly4Zmb83EsJsopCMXsyF/LtMQbF+3y5z9Ct 8qFvHp7HxUOD5z6HKQBMvNoaHlW1MA1Efx3/g+1orR3dC2oP3C+7u56RQjR2vAB0nsLS MVvw== X-Gm-Message-State: AKS2vOxwRoi5omLj8BEPE30zxQfz+MhVso9e5c+yvHwBQEJn7hx2FwpX FWz4gg98njD6IcBTKq9bSA== X-Received: by 10.36.83.17 with SMTP id n17mr23849765itb.19.1497891912849; Mon, 19 Jun 2017 10:05:12 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id 3sm6770522ith.7.2017.06.19.10.05.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Jun 2017 10:05:12 -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: Mon, 19 Jun 2017 11:04:59 -0600 Message-Id: <1497891902-25737-7-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497891902-25737-1-git-send-email-axboe@kernel.dk> References: <1497891902-25737-1-git-send-email-axboe@kernel.dk> 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 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)