linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: axboe@kernel.dk
Cc: linux-block@vger.kernel.org, dm-devel@redhat.com,
	linux-btrfs@vger.kernel.org
Subject: [PATCH 11/15] fs-writeback: move wbc_to_write_flags out of line
Date: Thu, 18 May 2017 15:18:08 +0200	[thread overview]
Message-ID: <20170518131812.22956-12-hch@lst.de> (raw)
In-Reply-To: <20170518131812.22956-1-hch@lst.de>

This way writeback.h doesn't need to pull in blk_types.h.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/fs-writeback.c         | 13 +++++++++++++
 include/linux/writeback.h | 11 +----------
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 63ee2940775c..51b65591afe1 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -59,6 +59,19 @@ struct wb_writeback_work {
 	struct wb_completion *done;	/* set if the caller waits */
 };
 
+#ifdef CONFIG_BLOCK
+int wbc_to_write_flags(struct writeback_control *wbc)
+{
+	if (wbc->sync_mode == WB_SYNC_ALL)
+		return REQ_SYNC;
+	else if (wbc->for_kupdate || wbc->for_background)
+		return REQ_BACKGROUND;
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(wbc_to_write_flags);
+#endif
+
 /*
  * If one wants to wait for one or more wb_writeback_works, each work's
  * ->done should be set to a wb_completion defined using the following
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index d5815794416c..c5ae6ef9b317 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -9,7 +9,6 @@
 #include <linux/fs.h>
 #include <linux/flex_proportions.h>
 #include <linux/backing-dev-defs.h>
-#include <linux/blk_types.h>
 
 struct bio;
 
@@ -103,15 +102,7 @@ struct writeback_control {
 #endif
 };
 
-static inline int wbc_to_write_flags(struct writeback_control *wbc)
-{
-	if (wbc->sync_mode == WB_SYNC_ALL)
-		return REQ_SYNC;
-	else if (wbc->for_kupdate || wbc->for_background)
-		return REQ_BACKGROUND;
-
-	return 0;
-}
+int wbc_to_write_flags(struct writeback_control *wbc);
 
 /*
  * A wb_domain represents a domain that wb's (bdi_writeback's) belong to
-- 
2.11.0


  parent reply	other threads:[~2017-05-18 13:18 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 13:17 dedicated error codes for the block layer Christoph Hellwig
2017-05-18 13:17 ` [PATCH 01/15] nvme-lightnvm: use blk_execute_rq in nvme_nvm_submit_user_cmd Christoph Hellwig
2017-05-24 15:50   ` Bart Van Assche
2017-05-18 13:17 ` [PATCH 02/15] scsi/osd: don't save block errors into req_results Christoph Hellwig
2017-05-24 16:04   ` Bart Van Assche
2017-05-26  5:15     ` hch
2017-05-18 13:18 ` [PATCH 03/15] gfs2: remove the unused sd_log_error field Christoph Hellwig
2017-05-24 16:05   ` Bart Van Assche
2017-05-18 13:18 ` [PATCH 04/15] dm: fix REQ_RAHEAD handling Christoph Hellwig
2017-05-24 16:07   ` Bart Van Assche
2017-05-18 13:18 ` [PATCH 05/15] fs: remove the unused error argument to dio_end_io() Christoph Hellwig
2017-05-24 16:08   ` Bart Van Assche
2017-05-18 13:18 ` [PATCH 06/15] fs: simplify dio_bio_complete Christoph Hellwig
2017-05-24 16:08   ` Bart Van Assche
2017-05-18 13:18 ` [PATCH 07/15] block_dev: propagate bio_iov_iter_get_pages error in __blkdev_direct_IO Christoph Hellwig
2017-05-18 13:18 ` [PATCH 08/15] dm mpath: merge do_end_io_bio into multipath_end_io_bio Christoph Hellwig
2017-05-22 18:51   ` [dm-devel] " Martin Wilck
2017-05-26  5:18     ` Christoph Hellwig
2017-05-18 13:18 ` [PATCH 09/15] dm: don't return errnos from ->map Christoph Hellwig
2017-05-18 13:18 ` [PATCH 10/15] dm: change ->end_io calling convention Christoph Hellwig
2017-05-18 13:18 ` Christoph Hellwig [this message]
2017-05-18 13:18 ` [PATCH 12/15] block: merge blk_types.h into bio.h Christoph Hellwig
2017-05-18 14:25   ` Bart Van Assche
2017-05-19  8:22     ` hch
2017-05-18 13:18 ` [PATCH 14/15] blk-mq: switch ->queue_rq return value to blk_status_t Christoph Hellwig
2017-05-18 14:55 ` dedicated error codes for the block layer David Sterba
2017-05-19  8:21   ` Christoph Hellwig

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=20170518131812.22956-12-hch@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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).