Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1473967

Re: [PATCH 2/8] writeback: add wbc_to_write_flags()

From Omar Sandoval <osandov@osandov.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/8] writeback: add wbc_to_write_flags()
Date 2016-09-01 01:40 +0200
Message-ID <scngR-sq-7@gated-at.bofh.it> (permalink)
References <schbr-59T-11@gated-at.bofh.it> <schbs-59T-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 31, 2016 at 11:05:45AM -0600, Jens Axboe wrote:
> Add wbc_to_write_flags(), which returns the write modifier flags to use,
> based on a struct writeback_control. No functional changes in this
> patch, but it prepares us for factoring other wbc fields for write type.
> 
> Signed-off-by: Jens Axboe <axboe@fb.com>
> Reviewed-by: Jan Kara <jack@suse.cz>

[snip]

> diff --git a/include/linux/writeback.h b/include/linux/writeback.h
> index fc1e16c25a29..e1fc25172397 100644
> --- a/include/linux/writeback.h
> +++ b/include/linux/writeback.h
> @@ -100,6 +100,14 @@ struct writeback_control {
>  #endif
>  };
>  
> +static inline int wbc_to_write_flags(struct writeback_control *wbc)
> +{
> +	if (wbc->sync_mode == WB_SYNC_ALL)
> +		return WRITE_SYNC;
> +
> +	return WRITE;

I think this should be `return 0;` after the op/flags split. WRITE == 1,
so this would get interpreted as REQ_FAILFAST_DEV in bi_opf.

From 2a222ca992c3 ("fs: have submit_bh users pass in op and flags
separately"):

@@ -1697,7 +1697,7 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
        struct buffer_head *bh, *head;
        unsigned int blocksize, bbits;
        int nr_underway = 0;
-       int write_op = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE);
+       int write_flags = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : 0);

-- 
Omar

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHSET v6] Throttled background buffered writeback Jens Axboe <axboe@fb.com> - 2016-08-31 19:10 +0200
  [PATCH 5/8] block: add code to track actual device queue depth Jens Axboe <axboe@fb.com> - 2016-08-31 19:10 +0200
  [PATCH 3/8] writeback: use WRITE_BG for kupdate and background writeback Jens Axboe <axboe@fb.com> - 2016-08-31 19:10 +0200
  [PATCH 1/8] block: add WRITE_BG Jens Axboe <axboe@fb.com> - 2016-08-31 19:10 +0200
    Re: [PATCH 1/8] block: add WRITE_BG Johannes Thumshirn <jthumshirn@suse.de> - 2016-09-01 10:00 +0200
    Re: [PATCH 1/8] block: add WRITE_BG Johannes Thumshirn <jthumshirn@suse.de> - 2016-09-01 10:00 +0200
  [PATCH 8/8] writeback: throttle buffered writeback Jens Axboe <axboe@fb.com> - 2016-08-31 19:10 +0200
  [PATCH 2/8] writeback: add wbc_to_write_flags() Jens Axboe <axboe@fb.com> - 2016-08-31 19:10 +0200
    Re: [PATCH 2/8] writeback: add wbc_to_write_flags() Omar Sandoval <osandov@osandov.com> - 2016-09-01 01:40 +0200
  [PATCH 6/8] block: add scalable completion tracking of requests Jens Axboe <axboe@fb.com> - 2016-08-31 19:10 +0200

csiph-web