fs/gfs2: Use the enum req_op and blk_opf_t types
Improve static type checking by using the enum req_op type for variables that represent a request operation and the new blk_opf_t type for variables that represent request flags. Combine the first two gfs2_submit_bhs() arguments into a single argument. Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com> Cc: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20220714180729.1065367-54-bvanassche@acm.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
7649c873c1
commit
67688c08b7
@ -823,7 +823,7 @@ void gfs2_flush_revokes(struct gfs2_sbd *sdp)
|
||||
|
||||
void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
|
||||
u64 seq, u32 tail, u32 lblock, u32 flags,
|
||||
int op_flags)
|
||||
blk_opf_t op_flags)
|
||||
{
|
||||
struct gfs2_log_header *lh;
|
||||
u32 hash, crc;
|
||||
@ -905,7 +905,7 @@ void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
|
||||
|
||||
static void log_write_header(struct gfs2_sbd *sdp, u32 flags)
|
||||
{
|
||||
int op_flags = REQ_PREFLUSH | REQ_FUA | REQ_META | REQ_SYNC;
|
||||
blk_opf_t op_flags = REQ_PREFLUSH | REQ_FUA | REQ_META | REQ_SYNC;
|
||||
enum gfs2_freeze_state state = atomic_read(&sdp->sd_freeze_state);
|
||||
|
||||
gfs2_assert_withdraw(sdp, (state != SFS_FROZEN));
|
||||
|
@ -82,7 +82,7 @@ extern void gfs2_log_reserve(struct gfs2_sbd *sdp, struct gfs2_trans *tr,
|
||||
unsigned int *extra_revokes);
|
||||
extern void gfs2_write_log_header(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
|
||||
u64 seq, u32 tail, u32 lblock, u32 flags,
|
||||
int op_flags);
|
||||
blk_opf_t op_flags);
|
||||
extern void gfs2_log_flush(struct gfs2_sbd *sdp, struct gfs2_glock *gl,
|
||||
u32 type);
|
||||
extern void gfs2_log_commit(struct gfs2_sbd *sdp, struct gfs2_trans *trans);
|
||||
|
@ -238,7 +238,7 @@ static void gfs2_end_log_write(struct bio *bio)
|
||||
* there is no pending bio, then this is a no-op.
|
||||
*/
|
||||
|
||||
void gfs2_log_submit_bio(struct bio **biop, int opf)
|
||||
void gfs2_log_submit_bio(struct bio **biop, blk_opf_t opf)
|
||||
{
|
||||
struct bio *bio = *biop;
|
||||
if (bio) {
|
||||
@ -292,7 +292,7 @@ static struct bio *gfs2_log_alloc_bio(struct gfs2_sbd *sdp, u64 blkno,
|
||||
*/
|
||||
|
||||
static struct bio *gfs2_log_get_bio(struct gfs2_sbd *sdp, u64 blkno,
|
||||
struct bio **biop, int op,
|
||||
struct bio **biop, enum req_op op,
|
||||
bio_end_io_t *end_io, bool flush)
|
||||
{
|
||||
struct bio *bio = *biop;
|
||||
|
@ -16,7 +16,7 @@ extern u64 gfs2_log_bmap(struct gfs2_jdesc *jd, unsigned int lbn);
|
||||
extern void gfs2_log_write(struct gfs2_sbd *sdp, struct gfs2_jdesc *jd,
|
||||
struct page *page, unsigned size, unsigned offset,
|
||||
u64 blkno);
|
||||
extern void gfs2_log_submit_bio(struct bio **biop, int opf);
|
||||
extern void gfs2_log_submit_bio(struct bio **biop, blk_opf_t opf);
|
||||
extern void gfs2_pin(struct gfs2_sbd *sdp, struct buffer_head *bh);
|
||||
extern int gfs2_find_jhead(struct gfs2_jdesc *jd,
|
||||
struct gfs2_log_header_host *head, bool keep_cache);
|
||||
|
@ -34,7 +34,7 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb
|
||||
{
|
||||
struct buffer_head *bh, *head;
|
||||
int nr_underway = 0;
|
||||
int write_flags = REQ_META | REQ_PRIO | wbc_to_write_flags(wbc);
|
||||
blk_opf_t write_flags = REQ_META | REQ_PRIO | wbc_to_write_flags(wbc);
|
||||
|
||||
BUG_ON(!PageLocked(page));
|
||||
BUG_ON(!page_has_buffers(page));
|
||||
@ -217,14 +217,13 @@ 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 op, int op_flags, struct buffer_head *bhs[],
|
||||
int num)
|
||||
static void gfs2_submit_bhs(blk_opf_t opf, struct buffer_head *bhs[], int num)
|
||||
{
|
||||
while (num > 0) {
|
||||
struct buffer_head *bh = *bhs;
|
||||
struct bio *bio;
|
||||
|
||||
bio = bio_alloc(bh->b_bdev, num, op | op_flags, GFP_NOIO);
|
||||
bio = bio_alloc(bh->b_bdev, num, opf, GFP_NOIO);
|
||||
bio->bi_iter.bi_sector = bh->b_blocknr * (bh->b_size >> 9);
|
||||
while (num > 0) {
|
||||
bh = *bhs;
|
||||
@ -288,7 +287,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
|
||||
}
|
||||
}
|
||||
|
||||
gfs2_submit_bhs(REQ_OP_READ, REQ_META | REQ_PRIO, bhs, num);
|
||||
gfs2_submit_bhs(REQ_OP_READ | REQ_META | REQ_PRIO, bhs, num);
|
||||
if (!(flags & DIO_WAIT))
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user