Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1262629
| From | mchristi@redhat.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 11/32] gfs2: prepare for bi_rw split |
| Date | 2015-11-04 23:10 +0100 |
| Message-ID | <qrepI-6lw-15@gated-at.bofh.it> (permalink) |
| References | <qrepI-6lw-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Mike Christie <mchristi@redhat.com>
This patch prepares gfs2's submit_bio use for the next
patches that split bi_rw into a operation and flags field.
Instead of passing in a bitmap with both the operation and
flags mixed in, the callers will now pass them in seperately.
This patch modifies the code related to the submit_bio calls
so the flags and operation are seperated. When this is done
for all code, one of the later patches in the series will
the actual submit_bio call, so the patches are bisectable.
Signed-off-by: Mike Christie <mchristi@redhat.com>
---
fs/gfs2/log.c | 8 ++++----
fs/gfs2/lops.c | 11 ++++++-----
fs/gfs2/lops.h | 2 +-
3 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 536e7a6..8324af5 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)
@@ -735,7 +735,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 d5369a1..36b047a 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);
- submit_bio(rw, sdp->sd_log_bio);
+ submit_bio(op | op_flags, sdp->sd_log_bio);
sdp->sd_log_bio = NULL;
}
}
@@ -299,7 +300,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);
@@ -328,7 +329,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)
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RESEND RFC PATCH 00/32] separate operations from flags in the bio/request structs mchristi@redhat.com - 2015-11-04 23:10 +0100
[PATCH 32/32] block: remove __REQ op defs and reduce bi_op/bi_rw sizes mchristi@redhat.com - 2015-11-04 23:10 +0100
Re: [PATCH 32/32] block: remove __REQ op defs and reduce bi_op/bi_rw sizes Christoph Hellwig <hch@infradead.org> - 2015-11-07 11:30 +0100
[PATCH 11/32] gfs2: prepare for bi_rw split mchristi@redhat.com - 2015-11-04 23:10 +0100
[PATCH 23/32] block/fs: pass in op and flags to ll_rw_block mchristi@redhat.com - 2015-11-04 23:10 +0100
[PATCH 13/32] mm: prepare for bi_rw split mchristi@redhat.com - 2015-11-04 23:10 +0100
[PATCH 24/32] dm: pass dm stats data dir instead of bi_rw mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 21/32] bcache: set bi_op to REQ_OP mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 27/32] cfq/cgroup: pass operation and flags seperately mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 12/32] xfs: prepare for bi_rw split mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 22/32] block/fs/drivers: set bi_op to REQ_OP mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 20/32] md: set bi_op to REQ_OP mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 30/32] drbd: don't use bi_rw for operations mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 28/32] block/fs/drivers: use bio/rq_data_dir helpers mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 18/32] drbd: set bio bi_op to REQ_OP mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 26/32] ide cd: do not set REQ_WRITE on requests. mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 25/32] block: add operation field to request struct mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 19/32] block: add helper to get data dir from op mchristi@redhat.com - 2015-11-04 23:20 +0100
Re: [dm-devel] [PATCH 19/32] block: add helper to get data dir from op Mike Christie <mchristi@redhat.com> - 2015-11-05 18:40 +0100
Re: [dm-devel] [PATCH 19/32] block: add helper to get data dir from op Christoph Hellwig <hch@infradead.org> - 2015-11-07 11:20 +0100
[PATCH 29/32] block/drivers: rm request cmd_flags REQ_OP use mchristi@redhat.com - 2015-11-04 23:20 +0100
[PATCH 05/32] drbd: prepare drbd for bi_rw split mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 03/32] dio/btrfs: prep dio->submit_bio users for bi_rw split. mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 16/32] block/fs/md: pass in op and flags to submit_bh mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 07/32] dm: prepare for bi_rw split mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 10/32] f2fs: prepare for bi_rw split mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 15/32] btrfs: prepare for bi_rw split mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 08/32] target: prepare for bi_rw split mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 17/32] block: add operation field to bio struct mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 06/32] xen blkback: prepare for bi_rw split mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 02/32] block/fs/mm: prepare submit_bio_wait users for bi_rw split mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 14/32] block/fs/mm: pass in op and flags to submit_bio mchristi@redhat.com - 2015-11-04 23:30 +0100
[PATCH 01/32] block/fs: add REQ_OP definitions. mchristi@redhat.com - 2015-11-04 23:40 +0100
Re: [RESEND RFC PATCH 00/32] separate operations from flags in the bio/request structs Bob Peterson <rpeterso@redhat.com> - 2015-11-05 17:50 +0100
Re: [RESEND RFC PATCH 00/32] separate operations from flags in the bio/request structs Christoph Hellwig <hch@infradead.org> - 2015-11-07 11:20 +0100
csiph-web