From patchwork Thu Jun 15 03:45:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9788011 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 0FA5060231 for ; Thu, 15 Jun 2017 03:45:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05A0923F88 for ; Thu, 15 Jun 2017 03:45:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEACD27C2D; Thu, 15 Jun 2017 03:45:34 +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 76F9423F88 for ; Thu, 15 Jun 2017 03:45:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752092AbdFODpd (ORCPT ); Wed, 14 Jun 2017 23:45:33 -0400 Received: from mail-pg0-f50.google.com ([74.125.83.50]:34461 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752064AbdFODpc (ORCPT ); Wed, 14 Jun 2017 23:45:32 -0400 Received: by mail-pg0-f50.google.com with SMTP id v18so1655827pgb.1 for ; Wed, 14 Jun 2017 20:45:32 -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=bxRq1NjdW4EGBWflB+iN6iR8QXPyMQ5/khlBqexG4ffJJ/ZfNmHI3C5+YC44Xi6gic lNa0JXgjfW10D0qzmo3zEUbHtIbSeSP5zXAfAPaY8TMlR0MkgCuy/dpuYO5aSFdH/C0T oezgGHM0iMjlF/Cp78O2Ac/SD+DEf1PQKvUw2czKb4ApI/u8zMt5/YvEuAQYVJvJWyZx JPPjPzIUBg7aF3yxMxYfcKtwMb33bZK1GG/tPZ+Zz+aRGUZNu4w1V2KWiV5TjdfYDYcM OMsxvqzNnwwzJMOSwrmawIkgV6UuXyv/cujUMuYdM9rrcnnrUKiwRaMfGAp2XYCsq16k ZNyA== 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=XXkuI6u4wJrHB/VHHhckJeToVscXpQ9WpOE8pQm8CZoCcv17HwAs2J12LS3KVm8zyf dbFNttH56GoJ4X57hV3kHY2N8fwFEP1IbnGSfrZETNvOfuj7MB6Ef5eyRc8tF9wruS8J QEExCxw1rr6Ot4In5XwfR6EYMPxJYQTT8ESvbS1Jv4R6PYIrMxl61F2KfI3n9XhYK7OA AOqQLhhIhc8VM98B1pJ/Ko2paDwCOhQmpnrR2MERtoLlc1/cXOM1SE4hJBDgqQ5h2CM+ jNuvVfgRVbl6S+j2kY1EN7H0I3oq85gCEV/+w/f/7jkIsdrqRTS2Wwk7ntpQe0unwYe4 0Ndw== X-Gm-Message-State: AKS2vOxymAa7LLcK2fGXTh4fk8U7xcfENjL8emjoQ/7dMKdW7e3JAuTo FcL1mz3wD0CN3yHE X-Received: by 10.84.142.131 with SMTP id 3mr2615348plx.211.1497498330890; Wed, 14 Jun 2017 20:45:30 -0700 (PDT) Received: from localhost.localdomain (66.29.164.166.static.utbb.net. [66.29.164.166]) by smtp.gmail.com with ESMTPSA id f71sm2532627pfd.98.2017.06.14.20.45.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Jun 2017 20:45:30 -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 06/11] fs: add O_DIRECT support for sending down bio stream information Date: Wed, 14 Jun 2017 21:45:07 -0600 Message-Id: <1497498312-17704-7-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497498312-17704-1-git-send-email-axboe@kernel.dk> References: <1497498312-17704-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);