fs/ocfs2: 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 last two o2hb_setup_one_bio() arguments into a single argument. Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com> Cc: Mark Fasheh <mark@fasheh.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20220714180729.1065367-61-bvanassche@acm.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
ce6b531588
commit
61ba06c706
|
@ -501,8 +501,7 @@ static void o2hb_bio_end_io(struct bio *bio)
|
||||||
static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg,
|
static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg,
|
||||||
struct o2hb_bio_wait_ctxt *wc,
|
struct o2hb_bio_wait_ctxt *wc,
|
||||||
unsigned int *current_slot,
|
unsigned int *current_slot,
|
||||||
unsigned int max_slots, int op,
|
unsigned int max_slots, blk_opf_t opf)
|
||||||
int op_flags)
|
|
||||||
{
|
{
|
||||||
int len, current_page;
|
int len, current_page;
|
||||||
unsigned int vec_len, vec_start;
|
unsigned int vec_len, vec_start;
|
||||||
|
@ -516,7 +515,7 @@ static struct bio *o2hb_setup_one_bio(struct o2hb_region *reg,
|
||||||
* GFP_KERNEL that the local node can get fenced. It would be
|
* GFP_KERNEL that the local node can get fenced. It would be
|
||||||
* nicest if we could pre-allocate these bios and avoid this
|
* nicest if we could pre-allocate these bios and avoid this
|
||||||
* all together. */
|
* all together. */
|
||||||
bio = bio_alloc(reg->hr_bdev, 16, op | op_flags, GFP_ATOMIC);
|
bio = bio_alloc(reg->hr_bdev, 16, opf, GFP_ATOMIC);
|
||||||
if (!bio) {
|
if (!bio) {
|
||||||
mlog(ML_ERROR, "Could not alloc slots BIO!\n");
|
mlog(ML_ERROR, "Could not alloc slots BIO!\n");
|
||||||
bio = ERR_PTR(-ENOMEM);
|
bio = ERR_PTR(-ENOMEM);
|
||||||
|
@ -564,7 +563,7 @@ static int o2hb_read_slots(struct o2hb_region *reg,
|
||||||
|
|
||||||
while(current_slot < max_slots) {
|
while(current_slot < max_slots) {
|
||||||
bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots,
|
bio = o2hb_setup_one_bio(reg, &wc, ¤t_slot, max_slots,
|
||||||
REQ_OP_READ, 0);
|
REQ_OP_READ);
|
||||||
if (IS_ERR(bio)) {
|
if (IS_ERR(bio)) {
|
||||||
status = PTR_ERR(bio);
|
status = PTR_ERR(bio);
|
||||||
mlog_errno(status);
|
mlog_errno(status);
|
||||||
|
@ -596,8 +595,8 @@ static int o2hb_issue_node_write(struct o2hb_region *reg,
|
||||||
|
|
||||||
slot = o2nm_this_node();
|
slot = o2nm_this_node();
|
||||||
|
|
||||||
bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1, REQ_OP_WRITE,
|
bio = o2hb_setup_one_bio(reg, write_wc, &slot, slot+1,
|
||||||
REQ_SYNC);
|
REQ_OP_WRITE | REQ_SYNC);
|
||||||
if (IS_ERR(bio)) {
|
if (IS_ERR(bio)) {
|
||||||
status = PTR_ERR(bio);
|
status = PTR_ERR(bio);
|
||||||
mlog_errno(status);
|
mlog_errno(status);
|
||||||
|
|
Loading…
Reference in New Issue