linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org
Cc: adilger@dilger.ca, hch@infradead.org, martin.petersen@oracle.com,
	Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 08/12] fs: add support for buffered writeback to pass down write hints
Date: Thu, 15 Jun 2017 10:42:06 -0600	[thread overview]
Message-ID: <1497544930-19174-9-git-send-email-axboe@kernel.dk> (raw)
In-Reply-To: <1497544930-19174-1-git-send-email-axboe@kernel.dk>

Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 fs/buffer.c | 14 +++++++++-----
 fs/mpage.c  |  1 +
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 161be58c5cb0..3faf73a71d4b 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -49,7 +49,7 @@
 
 static int fsync_buffers_list(spinlock_t *lock, struct list_head *list);
 static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
-			 struct writeback_control *wbc);
+			 unsigned int stream, struct writeback_control *wbc);
 
 #define BH_ENTRY(list) list_entry((list), struct buffer_head, b_assoc_buffers)
 
@@ -1829,7 +1829,8 @@ int __block_write_full_page(struct inode *inode, struct page *page,
 	do {
 		struct buffer_head *next = bh->b_this_page;
 		if (buffer_async_write(bh)) {
-			submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc);
+			submit_bh_wbc(REQ_OP_WRITE, write_flags, bh,
+					inode_write_hint(inode), wbc);
 			nr_underway++;
 		}
 		bh = next;
@@ -1883,7 +1884,8 @@ int __block_write_full_page(struct inode *inode, struct page *page,
 		struct buffer_head *next = bh->b_this_page;
 		if (buffer_async_write(bh)) {
 			clear_buffer_dirty(bh);
-			submit_bh_wbc(REQ_OP_WRITE, write_flags, bh, wbc);
+			submit_bh_wbc(REQ_OP_WRITE, write_flags, bh,
+					inode_write_hint(inode), wbc);
 			nr_underway++;
 		}
 		bh = next;
@@ -3091,7 +3093,7 @@ void guard_bio_eod(int op, struct bio *bio)
 }
 
 static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
-			 struct writeback_control *wbc)
+			 unsigned int write_hint, struct writeback_control *wbc)
 {
 	struct bio *bio;
 
@@ -3134,6 +3136,8 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
 		op_flags |= REQ_META;
 	if (buffer_prio(bh))
 		op_flags |= REQ_PRIO;
+
+	op_flags |= bio_op_write_hint(write_hint);
 	bio_set_op_attrs(bio, op, op_flags);
 
 	submit_bio(bio);
@@ -3142,7 +3146,7 @@ static int submit_bh_wbc(int op, int op_flags, struct buffer_head *bh,
 
 int submit_bh(int op, int op_flags, struct buffer_head *bh)
 {
-	return submit_bh_wbc(op, op_flags, bh, NULL);
+	return submit_bh_wbc(op, op_flags, bh, 0, NULL);
 }
 EXPORT_SYMBOL(submit_bh);
 
diff --git a/fs/mpage.c b/fs/mpage.c
index baff8f820c29..df0635c8a512 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -614,6 +614,7 @@ static int __mpage_writepage(struct page *page, struct writeback_control *wbc,
 			goto confused;
 
 		wbc_init_bio(wbc, bio);
+		bio->bi_opf |= bio_op_write_hint(inode_write_hint(inode));
 	}
 
 	/*
-- 
2.7.4

  parent reply	other threads:[~2017-06-15 16:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15 16:41 [PATCHSET v5] Add support for write life time hints Jens Axboe
2017-06-15 16:41 ` [PATCH 01/12] block: add support for carrying stream information in a bio Jens Axboe
2017-06-16 16:39   ` Martin K. Petersen
2017-06-16 16:42     ` Jens Axboe
2017-06-15 16:42 ` [PATCH 02/12] blk-mq: expose stream write stats through debugfs Jens Axboe
2017-06-16 16:38   ` Martin K. Petersen
2017-06-16 16:41     ` Jens Axboe
2017-06-15 16:42 ` [PATCH 03/12] fs: add support for an inode to carry write hint related data Jens Axboe
2017-06-15 16:42 ` [PATCH 04/12] fs: add support for allowing applications to pass in write life time hints Jens Axboe
2017-06-15 16:42 ` [PATCH 05/12] fs: add fcntl() interface for setting/getting " Jens Axboe
2017-06-16 16:44   ` Martin K. Petersen
2017-06-16 16:55     ` Jens Axboe
2017-06-16 17:59     ` Christoph Hellwig
2017-06-15 16:42 ` [PATCH 06/12] block: add helpers for setting/checking write hint validity Jens Axboe
2017-06-16 16:47   ` Martin K. Petersen
2017-06-16 16:53     ` Jens Axboe
2017-06-15 16:42 ` [PATCH 07/12] fs: add O_DIRECT support for sending down bio stream information Jens Axboe
2017-06-15 16:42 ` Jens Axboe [this message]
2017-06-15 16:42 ` [PATCH 09/12] ext4: add support for passing in write hints for buffered writes Jens Axboe
2017-06-15 16:42 ` [PATCH 10/12] xfs: " Jens Axboe
2017-06-15 16:42 ` [PATCH 11/12] btrfs: " Jens Axboe
2017-06-15 16:42 ` [PATCH 12/12] nvme: add support for streams and directives Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497544930-19174-9-git-send-email-axboe@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=adilger@dilger.ca \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).