Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1414177
| From | mchristi@redhat.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 16/45] gfs2: use bio op accessors |
| Date | 2016-06-05 21:50 +0200 |
| Message-ID | <rGMdB-2xU-39@gated-at.bofh.it> (permalink) |
| References | <rGM3T-2uj-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Mike Christie <mchristi@redhat.com>
Separate the op from the rq_flag_bits and have gfs2
set/get the bio using bio_set_op_attrs/bio_op.
Signed-off-by: Mike Christie <mchristi@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
---
fs/gfs2/log.c | 8 ++++----
fs/gfs2/lops.c | 11 ++++++-----
fs/gfs2/lops.h | 2 +-
fs/gfs2/meta_io.c | 7 ++++---
fs/gfs2/ops_fstype.c | 2 +-
5 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 0ff028c..e58ccef0 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -657,7 +657,7 @@ static void log_write_header(struct gfs2_sbd *sdp, u32 flags)
struct gfs2_log_header *lh;
unsigned int tail;
u32 hash;
- int rw = WRITE_FLUSH_FUA | REQ_META;
+ int op_flags = WRITE_FLUSH_FUA | REQ_META;
struct page *page = mempool_alloc(gfs2_page_pool, GFP_NOIO);
enum gfs2_freeze_state state = atomic_read(&sdp->sd_freeze_state);
lh = page_address(page);
@@ -682,12 +682,12 @@ static void log_write_header(struct gfs2_sbd *sdp, u32 flags)
if (test_bit(SDF_NOBARRIERS, &sdp->sd_flags)) {
gfs2_ordered_wait(sdp);
log_flush_wait(sdp);
- rw = WRITE_SYNC | REQ_META | REQ_PRIO;
+ op_flags = WRITE_SYNC | REQ_META | REQ_PRIO;
}
sdp->sd_log_idle = (tail == sdp->sd_log_flush_head);
gfs2_log_write_page(sdp, page);
- gfs2_log_flush_bio(sdp, rw);
+ gfs2_log_flush_bio(sdp, REQ_OP_WRITE, op_flags);
log_flush_wait(sdp);
if (sdp->sd_log_tail != tail)
@@ -738,7 +738,7 @@ void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl,
gfs2_ordered_write(sdp);
lops_before_commit(sdp, tr);
- gfs2_log_flush_bio(sdp, WRITE);
+ gfs2_log_flush_bio(sdp, REQ_OP_WRITE, 0);
if (sdp->sd_log_head != sdp->sd_log_flush_head) {
log_flush_wait(sdp);
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index ce28242..58d1c98 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -230,17 +230,18 @@ static void gfs2_end_log_write(struct bio *bio)
/**
* gfs2_log_flush_bio - Submit any pending log bio
* @sdp: The superblock
- * @rw: The rw flags
+ * @op: REQ_OP
+ * @op_flags: rq_flag_bits
*
* Submit any pending part-built or full bio to the block device. If
* there is no pending bio, then this is a no-op.
*/
-void gfs2_log_flush_bio(struct gfs2_sbd *sdp, int rw)
+void gfs2_log_flush_bio(struct gfs2_sbd *sdp, int op, int op_flags)
{
if (sdp->sd_log_bio) {
atomic_inc(&sdp->sd_log_in_flight);
- sdp->sd_log_bio->bi_rw = rw;
+ bio_set_op_attrs(sdp->sd_log_bio, op, op_flags);
submit_bio(sdp->sd_log_bio);
sdp->sd_log_bio = NULL;
}
@@ -300,7 +301,7 @@ static struct bio *gfs2_log_get_bio(struct gfs2_sbd *sdp, u64 blkno)
nblk >>= sdp->sd_fsb2bb_shift;
if (blkno == nblk)
return bio;
- gfs2_log_flush_bio(sdp, WRITE);
+ gfs2_log_flush_bio(sdp, REQ_OP_WRITE, 0);
}
return gfs2_log_alloc_bio(sdp, blkno);
@@ -329,7 +330,7 @@ static void gfs2_log_write(struct gfs2_sbd *sdp, struct page *page,
bio = gfs2_log_get_bio(sdp, blkno);
ret = bio_add_page(bio, page, size, offset);
if (ret == 0) {
- gfs2_log_flush_bio(sdp, WRITE);
+ gfs2_log_flush_bio(sdp, REQ_OP_WRITE, 0);
bio = gfs2_log_alloc_bio(sdp, blkno);
ret = bio_add_page(bio, page, size, offset);
WARN_ON(ret == 0);
diff --git a/fs/gfs2/lops.h b/fs/gfs2/lops.h
index a65a7ba..e529f53 100644
--- a/fs/gfs2/lops.h
+++ b/fs/gfs2/lops.h
@@ -27,7 +27,7 @@ extern const struct gfs2_log_operations gfs2_databuf_lops;
extern const struct gfs2_log_operations *gfs2_log_ops[];
extern void gfs2_log_write_page(struct gfs2_sbd *sdp, struct page *page);
-extern void gfs2_log_flush_bio(struct gfs2_sbd *sdp, int rw);
+extern void gfs2_log_flush_bio(struct gfs2_sbd *sdp, int op, int op_flags);
extern void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh);
static inline unsigned int buf_limit(struct gfs2_sbd *sdp)
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c
index b718447..052c113 100644
--- a/fs/gfs2/meta_io.c
+++ b/fs/gfs2/meta_io.c
@@ -213,7 +213,8 @@ static void gfs2_meta_read_endio(struct bio *bio)
* Submit several consecutive buffer head I/O requests as a single bio I/O
* request. (See submit_bh_wbc.)
*/
-static void gfs2_submit_bhs(int rw, struct buffer_head *bhs[], int num)
+static void gfs2_submit_bhs(int op, int op_flags, struct buffer_head *bhs[],
+ int num)
{
struct buffer_head *bh = bhs[0];
struct bio *bio;
@@ -230,7 +231,7 @@ static void gfs2_submit_bhs(int rw, struct buffer_head *bhs[], int num)
bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh));
}
bio->bi_end_io = gfs2_meta_read_endio;
- bio->bi_rw = rw;
+ bio_set_op_attrs(bio, op, op_flags);
submit_bio(bio);
}
@@ -281,7 +282,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
}
}
- gfs2_submit_bhs(READ_SYNC | REQ_META | REQ_PRIO, bhs, num);
+ gfs2_submit_bhs(REQ_OP_READ, READ_SYNC | REQ_META | REQ_PRIO, bhs, num);
if (!(flags & DIO_WAIT))
return 0;
diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c
index d9e19f6..f423c68 100644
--- a/fs/gfs2/ops_fstype.c
+++ b/fs/gfs2/ops_fstype.c
@@ -246,7 +246,7 @@ static int gfs2_read_super(struct gfs2_sbd *sdp, sector_t sector, int silent)
bio->bi_end_io = end_bio_io_page;
bio->bi_private = page;
- bio->bi_rw = READ_SYNC | REQ_META;
+ bio_set_op_attrs(bio, REQ_OP_READ, READ_SYNC | REQ_META);
submit_bio(bio);
wait_on_page_locked(page);
bio_put(bio);
--
2.7.2
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/45] v8: separate operations from flags in the bio/request structs mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 37/45] drivers: use req op accessor mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 35/45] block: convert merge/insert code to check for REQ_OPs. mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 43/45] block, drivers: add REQ_OP_FLUSH operation mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 36/45] block: convert is_sync helpers to use REQ_OPs. mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 14/45] btrfs: use bio fields for op and flags mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 05/45] block, drivers, cgroup: use op_is_write helper instead of checking for REQ_WRITE mchristi@redhat.com - 2016-06-05 21:40 +0200
Re: [PATCH 05/45] block, drivers, cgroup: use op_is_write helper instead of checking for REQ_WRITE Hannes Reinecke <hare@suse.de> - 2016-06-06 08:20 +0200
[PATCH 40/45] block: move bio io prio to a new field mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 23/45] dm: pass dm stats data dir instead of bi_rw mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 41/45] block, drivers, fs: shrink bi_rw from long to int mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 45/45] block, drivers, fs: rename REQ_FLUSH to REQ_PREFLUSH mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 44/45] block: do not use REQ_FLUSH for tracking flush support mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 38/45] blktrace: use op accessors mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 42/45] block, fs, drivers: remove REQ_OP compat defs and related code mchristi@redhat.com - 2016-06-05 21:40 +0200
Re: [PATCH 42/45] block, fs, drivers: remove REQ_OP compat defs and related code kbuild test robot <lkp@intel.com> - 2016-06-05 23:00 +0200
Re: [PATCH 42/45] block, fs, drivers: remove REQ_OP compat defs and related code kbuild test robot <lkp@intel.com> - 2016-06-05 23:40 +0200
Re: [PATCH 42/45] block, fs, drivers: remove REQ_OP compat defs and related code kbuild test robot <lkp@intel.com> - 2016-06-06 00:10 +0200
[PATCH 21/45] ocfs2: use bio op accessors mchristi@redhat.com - 2016-06-05 21:40 +0200
[PATCH 28/45] target: use bio op accessors mchristi@redhat.com - 2016-06-05 21:40 +0200
Re: [PATCH 28/45] target: use bio op accessors Hannes Reinecke <hare@suse.de> - 2016-06-06 08:50 +0200
Re: [PATCH 28/45] target: use bio op accessors Hannes Reinecke <hare@suse.de> - 2016-06-06 17:50 +0200
Re: [PATCH 28/45] target: use bio op accessors Mike Christie <mchristi@redhat.com> - 2016-06-06 17:50 +0200
[PATCH 15/45] f2fs: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 02/45] block: add REQ_OP definitions and helpers mchristi@redhat.com - 2016-06-05 21:50 +0200
Re: [PATCH 02/45] block: add REQ_OP definitions and helpers Hannes Reinecke <hare@suse.de> - 2016-06-06 08:20 +0200
[PATCH 22/45] pm: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 33/45] block: prepare elevator to use REQ_OPs. mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 18/45] hfsplus: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 20/45] nilfs: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 06/45] dm: use op_is_write instead of checking for REQ_WRITE mchristi@redhat.com - 2016-06-05 21:50 +0200
Re: [PATCH 06/45] dm: use op_is_write instead of checking for REQ_WRITE Hannes Reinecke <hare@suse.de> - 2016-06-06 08:20 +0200
[PATCH 19/45] mpage: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 16/45] gfs2: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 26/45] drbd: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 32/45] block: prepare mq request creation to use REQ_OPs mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 27/45] md: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 34/45] blkg_rwstat: separate op from flags mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 17/45] xfs: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 07/45] bcache: use op_is_write instead of checking for REQ_WRITE mchristi@redhat.com - 2016-06-05 21:50 +0200
Re: [PATCH 07/45] bcache: use op_is_write instead of checking for REQ_WRITE Hannes Reinecke <hare@suse.de> - 2016-06-06 08:20 +0200
[PATCH 31/45] block: prepare request creation/destruction code to use REQ_OPs mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 29/45] xen: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 30/45] block: copy bio op to request op mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 25/45] bcache: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
Re: [PATCH 25/45] bcache: use bio op accessors Hannes Reinecke <hare@suse.de> - 2016-06-06 08:50 +0200
[PATCH 24/45] dm: use bio op accessors mchristi@redhat.com - 2016-06-05 21:50 +0200
Re: [PATCH 24/45] dm: use bio op accessors Hannes Reinecke <hare@suse.de> - 2016-06-06 08:50 +0200
[PATCH 04/45] fs: have ll_rw_block users pass in op and flags separately mchristi@redhat.com - 2016-06-05 21:50 +0200
[PATCH 11/45] btrfs: have submit_one_bio users use bio op accessors mchristi@redhat.com - 2016-06-05 22:00 +0200
[PATCH 08/45] block, fs, mm, drivers: use bio set/get op accessors mchristi@redhat.com - 2016-06-05 22:00 +0200
Re: [PATCH 08/45] block, fs, mm, drivers: use bio set/get op accessors Hannes Reinecke <hare@suse.de> - 2016-06-06 08:30 +0200
[PATCH 09/45] block discard: use bio set op accessor mchristi@redhat.com - 2016-06-05 22:00 +0200
[PATCH 13/45] btrfs: update __btrfs_map_block for REQ_OP transition mchristi@redhat.com - 2016-06-05 22:00 +0200
[PATCH 12/45] btrfs: use bio op accessors mchristi@redhat.com - 2016-06-05 22:00 +0200
[PATCH 10/45] direct-io: use bio set/get op accessors mchristi@redhat.com - 2016-06-05 22:00 +0200
[PATCH 03/45] fs: have submit_bh users pass in op and flags separately mchristi@redhat.com - 2016-06-05 22:00 +0200
csiph-web