From patchwork Thu Jun 15 16:42:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9789299 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 4F46060384 for ; Thu, 15 Jun 2017 16:42:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 426F62852E for ; Thu, 15 Jun 2017 16:42:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37132286BF; Thu, 15 Jun 2017 16:42:43 +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 DC57A2852E for ; Thu, 15 Jun 2017 16:42:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752063AbdFOQml (ORCPT ); Thu, 15 Jun 2017 12:42:41 -0400 Received: from mail-io0-f170.google.com ([209.85.223.170]:35060 "EHLO mail-io0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752134AbdFOQmj (ORCPT ); Thu, 15 Jun 2017 12:42:39 -0400 Received: by mail-io0-f170.google.com with SMTP id k93so15398722ioi.2 for ; Thu, 15 Jun 2017 09:42:34 -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=FlcuyXVXn0xRlsE2Gn2G2oKyza/IKbSODTT3a+CL+oQ=; b=dLejZV3bBsuJYtBQHxr8R8Ow8zzxhxMLIjsPSfRXne/o3G5aK3qXFwfnsxqMDV8I4T UZVDQvsJD7VoGm1vx+MBY2AIBR9m8atFj4mXbbvGjQxEuIPi8TpiinEI0sRtv3aPCHoK ol1GB/LSW7ywPOgOfaABJvbH7IgwgeFt7Yon+g92Eq/dIXMLIOUFYxLCBLMLDsKHR9G7 eYP20GYQMuBwIZVpoEbXcx9JgEXG0fJ5SLVsee5jxXTp7Eab6wGvk6oeh5ndOWc1Xcs8 tMObOFZ/W3p85Pap9Wh2Lq4YJ2/Ibj38iDWdBfvlzVs39ZbVZs0MnHZmVyRnVfYW0Icw 7X+g== 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=FlcuyXVXn0xRlsE2Gn2G2oKyza/IKbSODTT3a+CL+oQ=; b=iaMAjfOMGo6n+navNZRBn+0urOTTmFOBgP/N0lzw//kLs1FvxsjU6WcF5QUIFiO4qD 5sxfhAyxtoEb8+QYGwtayMbbmeea7bxVN0HgXL2JLE9s/VZxUIXZh5DqtRZ/t7UZMlQw 8NAbJEscmgHwxLouhVTpyZ/u4jxf2kTSa1iC2cigsp176Xgkdw0urhWtgxQen/enxXPV FV+gX0XDnU/CROzBOiMKIWWY3dEv31jbA/Dur8DUSH4pYJTDFb/6bdgX/lL9wZIJ6BNK R61JqltCEyBE/4vbtN0n3hgJE+DBdeYYuQQnlHKHOC1TvJ+I+t8qsOahCLmAAvkAXqDT Il0g== X-Gm-Message-State: AKS2vOwdsLJNC+Nvo73fvgDCtxbVbu5Ql7eGpGxG6DPCY5hJGdrdSx/b gyhv3KIMl4jEd6rc X-Received: by 10.107.136.211 with SMTP id s80mr6159800ioi.18.1497544943736; Thu, 15 Jun 2017 09:42:23 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id 97sm313476iot.25.2017.06.15.09.42.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Jun 2017 09:42:22 -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, Jens Axboe Subject: [PATCH 07/12] fs: add O_DIRECT support for sending down bio stream information Date: Thu, 15 Jun 2017 10:42:05 -0600 Message-Id: <1497544930-19174-8-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497544930-19174-1-git-send-email-axboe@kernel.dk> References: <1497544930-19174-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/block_dev.c | 2 ++ fs/direct-io.c | 2 ++ fs/iomap.c | 1 + 3 files changed, 5 insertions(+) diff --git a/fs/block_dev.c b/fs/block_dev.c index 519599dddd36..de4301168710 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -239,6 +239,7 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, should_dirty = true; } else { bio.bi_opf = dio_bio_write_op(iocb); + bio.bi_opf |= bio_op_write_hint(iocb_write_hint(iocb)); task_io_account_write(ret); } @@ -374,6 +375,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) bio_set_pages_dirty(bio); } else { bio->bi_opf = dio_bio_write_op(iocb); + bio->bi_opf |= bio_op_write_hint(iocb_write_hint(iocb)); task_io_account_write(bio->bi_iter.bi_size); } diff --git a/fs/direct-io.c b/fs/direct-io.c index a04ebea77de8..98874478ec8a 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -386,6 +386,8 @@ dio_bio_alloc(struct dio *dio, struct dio_submit *sdio, else bio->bi_end_io = dio_bio_end_io; + bio->bi_opf |= bio_op_write_hint(iocb_write_hint(dio->iocb)); + sdio->bio = bio; sdio->logical_offset_in_bio = sdio->cur_page_fs_offset; } diff --git a/fs/iomap.c b/fs/iomap.c index 4b10892967a5..7e18e760e421 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -804,6 +804,7 @@ iomap_dio_actor(struct inode *inode, loff_t pos, loff_t length, if (dio->flags & IOMAP_DIO_WRITE) { bio_set_op_attrs(bio, REQ_OP_WRITE, REQ_SYNC | REQ_IDLE); + bio->bi_opf |= bio_op_write_hint(inode_write_hint(inode)); task_io_account_write(bio->bi_iter.bi_size); } else { bio_set_op_attrs(bio, REQ_OP_READ, 0);