mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 00:48:50 +00:00
fs/nfs: Use enum req_op where appropriate
Improve static type checking by using enum req_op for request operations. Rename an 'rw' argument into 'op' since that name is typically used for request operations. This patch does not change any functionality. Note: REQ_OP_READ = READ = 0 and REQ_OP_WRITE = WRITE = 1. Cc: Trond Myklebust <trond.myklebust@hammerspace.com> Cc: Anna Schumaker <anna@kernel.org> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20220714180729.1065367-58-bvanassche@acm.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
6669797b0d
commit
5d12ce77e1
1 changed files with 6 additions and 7 deletions
|
@ -121,7 +121,7 @@ static bool offset_in_map(u64 offset, struct pnfs_block_dev_map *map)
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct bio *
|
static struct bio *
|
||||||
do_add_page_to_bio(struct bio *bio, int npg, int rw, sector_t isect,
|
do_add_page_to_bio(struct bio *bio, int npg, enum req_op op, sector_t isect,
|
||||||
struct page *page, struct pnfs_block_dev_map *map,
|
struct page *page, struct pnfs_block_dev_map *map,
|
||||||
struct pnfs_block_extent *be, bio_end_io_t end_io,
|
struct pnfs_block_extent *be, bio_end_io_t end_io,
|
||||||
struct parallel_io *par, unsigned int offset, int *len)
|
struct parallel_io *par, unsigned int offset, int *len)
|
||||||
|
@ -131,7 +131,7 @@ do_add_page_to_bio(struct bio *bio, int npg, int rw, sector_t isect,
|
||||||
u64 disk_addr, end;
|
u64 disk_addr, end;
|
||||||
|
|
||||||
dprintk("%s: npg %d rw %d isect %llu offset %u len %d\n", __func__,
|
dprintk("%s: npg %d rw %d isect %llu offset %u len %d\n", __func__,
|
||||||
npg, rw, (unsigned long long)isect, offset, *len);
|
npg, (__force u32)op, (unsigned long long)isect, offset, *len);
|
||||||
|
|
||||||
/* translate to device offset */
|
/* translate to device offset */
|
||||||
isect += be->be_v_offset;
|
isect += be->be_v_offset;
|
||||||
|
@ -154,7 +154,7 @@ do_add_page_to_bio(struct bio *bio, int npg, int rw, sector_t isect,
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
if (!bio) {
|
if (!bio) {
|
||||||
bio = bio_alloc(map->bdev, bio_max_segs(npg), rw, GFP_NOIO);
|
bio = bio_alloc(map->bdev, bio_max_segs(npg), op, GFP_NOIO);
|
||||||
bio->bi_iter.bi_sector = disk_addr >> SECTOR_SHIFT;
|
bio->bi_iter.bi_sector = disk_addr >> SECTOR_SHIFT;
|
||||||
bio->bi_end_io = end_io;
|
bio->bi_end_io = end_io;
|
||||||
bio->bi_private = par;
|
bio->bi_private = par;
|
||||||
|
@ -291,7 +291,7 @@ bl_read_pagelist(struct nfs_pgio_header *header)
|
||||||
} else {
|
} else {
|
||||||
bio = do_add_page_to_bio(bio,
|
bio = do_add_page_to_bio(bio,
|
||||||
header->page_array.npages - i,
|
header->page_array.npages - i,
|
||||||
READ,
|
REQ_OP_READ,
|
||||||
isect, pages[i], &map, &be,
|
isect, pages[i], &map, &be,
|
||||||
bl_end_io_read, par,
|
bl_end_io_read, par,
|
||||||
pg_offset, &pg_len);
|
pg_offset, &pg_len);
|
||||||
|
@ -420,9 +420,8 @@ bl_write_pagelist(struct nfs_pgio_header *header, int sync)
|
||||||
|
|
||||||
pg_len = PAGE_SIZE;
|
pg_len = PAGE_SIZE;
|
||||||
bio = do_add_page_to_bio(bio, header->page_array.npages - i,
|
bio = do_add_page_to_bio(bio, header->page_array.npages - i,
|
||||||
WRITE, isect, pages[i], &map, &be,
|
REQ_OP_WRITE, isect, pages[i], &map,
|
||||||
bl_end_io_write, par,
|
&be, bl_end_io_write, par, 0, &pg_len);
|
||||||
0, &pg_len);
|
|
||||||
if (IS_ERR(bio)) {
|
if (IS_ERR(bio)) {
|
||||||
header->pnfs_error = PTR_ERR(bio);
|
header->pnfs_error = PTR_ERR(bio);
|
||||||
bio = NULL;
|
bio = NULL;
|
||||||
|
|
Loading…
Reference in a new issue