From patchwork Fri Jun 16 17:24:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9792331 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 57BE560231 for ; Fri, 16 Jun 2017 17:25:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C52D26490 for ; Fri, 16 Jun 2017 17:25:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3137F28500; Fri, 16 Jun 2017 17:25: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 C438C26490 for ; Fri, 16 Jun 2017 17:25:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751985AbdFPRZR (ORCPT ); Fri, 16 Jun 2017 13:25:17 -0400 Received: from mail-io0-f181.google.com ([209.85.223.181]:36394 "EHLO mail-io0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752231AbdFPRYz (ORCPT ); Fri, 16 Jun 2017 13:24:55 -0400 Received: by mail-io0-f181.google.com with SMTP id y77so34268114ioe.3 for ; Fri, 16 Jun 2017 10:24:55 -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=6XTXlmMBkGXpkQqSecX9PoTzZ+7KmfFRzBbBBvqRvOc=; b=xiwQ1n7BjK1NUmKvjRuIu66PnsfJTrIqxCSqxtmN+SNZX0o7UQBfjnmNjS5ma8ENtC Oj3amarwY1N2D0afcJ0l/wFeunbWBVbfXbxSF/XyeTwJ1pdsfL6VlddUvsGnU6JyptfS iTvN5kTIC2T/0gSx4gTTvw3c63icXkLBBHXJqSxyON7gqEahULIgs8KCgSQEWzFYhsyB +irkZMDD0kIXclGrAWmv06DKd0Pn265RVD7sboBQaB4QHiGCjt+qy1y7ZU+dSpoHgZlN Q22PyzzlZeiaauiEW+Zv/zbB1Yr5667GTAFTthi1uSNrimhd4rg9+uMZRNgS8wMa4H6p qgTg== 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=6XTXlmMBkGXpkQqSecX9PoTzZ+7KmfFRzBbBBvqRvOc=; b=TyZ24XJA2ccKB0OGWAoqRb09m4ufTx8MO5aNUXsbsTdp8yUtWupimop4r/6HxSdiRD wxKbeoaMLeo4XhKCC26PvC3Ue/HVi2k1CAwm5qmKdbetQJC2eiOOJyaC/biFLEeI14r5 sDf/LuiTmDKPm11uXS8h57o8o484ZzRe60MQtd7/uHo7bDroenj0n/5pG5AtFf1pumsT NA3lWMiDhMrgKidXd2tTevG0L2f26JTLV/drpnCPOUOfX2J7V2MV8yOpSNfiIHHuMlEE 2LHO/J/i0YUc6QEYyuCoI24O+0Vp7I+PQqj2DRip47MXdJPgpJwR21m9JBH71tDE1v0F iefA== X-Gm-Message-State: AKS2vOx/ZP14KvO/pn/RtHS4ZEc7Uewtc1k98iBx7GFbO05aICXpiL4U 5tMbn5OAWZfEzc1A/4v4FQ== X-Received: by 10.107.175.201 with SMTP id p70mr12777893ioo.20.1497633894224; Fri, 16 Jun 2017 10:24:54 -0700 (PDT) Received: from localhost.localdomain ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id e31sm1661101ioi.51.2017.06.16.10.24.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 16 Jun 2017 10:24:53 -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 write life time hints Date: Fri, 16 Jun 2017 11:24:38 -0600 Message-Id: <1497633883-21230-7-git-send-email-axboe@kernel.dk> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497633883-21230-1-git-send-email-axboe@kernel.dk> References: <1497633883-21230-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..b9222a9d285e 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 |= write_hint_to_opf(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 |= write_hint_to_opf(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..1253b059eae6 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 |= write_hint_to_opf(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..e8639861bd80 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 |= write_hint_to_opf(inode_write_hint(inode)); task_io_account_write(bio->bi_iter.bi_size); } else { bio_set_op_attrs(bio, REQ_OP_READ, 0);