]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fs/xfs: Use the enum req_op and blk_opf_t types
authorBart Van Assche <bvanassche@acm.org>
Thu, 14 Jul 2022 18:07:28 +0000 (11:07 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 14 Jul 2022 18:14:33 +0000 (12:14 -0600)
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 the
combination of a request operation with request flags.

Reviewed-by: Darrick J. Wong <djwong@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-63-bvanassche@acm.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/xfs/xfs_bio_io.c
fs/xfs/xfs_buf.c
fs/xfs/xfs_linux.h
fs/xfs/xfs_log_recover.c

index ae4345b37621b600b8156cb5c10f7b2bac6a79da..fe21c76f75b84d86370a7f7e5282e031c3a87f17 100644 (file)
@@ -15,7 +15,7 @@ xfs_rw_bdev(
        sector_t                sector,
        unsigned int            count,
        char                    *data,
-       unsigned int            op)
+       enum req_op             op)
 
 {
        unsigned int            is_vmalloc = is_vmalloc_addr(data);
index bf4e60871068205eb30a4909654717782d6bbe84..5e8f40d8c052b4efa84f07efa2b2b8e6579a49bb 100644 (file)
@@ -1416,7 +1416,7 @@ xfs_buf_ioapply_map(
        int             map,
        int             *buf_offset,
        int             *count,
-       int             op)
+       blk_opf_t       op)
 {
        int             page_index;
        unsigned int    total_nr_pages = bp->b_page_count;
@@ -1493,7 +1493,7 @@ _xfs_buf_ioapply(
        struct xfs_buf  *bp)
 {
        struct blk_plug plug;
-       int             op;
+       blk_opf_t       op;
        int             offset;
        int             size;
        int             i;
index cb9105d667db440dfdbebbb48606ddebe8857af3..f9878021e7d07dd4a4f06269d847eee14f20a0b8 100644 (file)
@@ -196,7 +196,7 @@ static inline uint64_t howmany_64(uint64_t x, uint32_t y)
 }
 
 int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count,
-               char *data, unsigned int op);
+               char *data, enum req_op op);
 
 #define ASSERT_ALWAYS(expr)    \
        (likely(expr) ? (void)0 : assfail(NULL, #expr, __FILE__, __LINE__))
index 5f7e4e6e33cebccfa92924643d28a8dba74cb272..940c8107cbd4926e59c354f10b302be6f406191d 100644 (file)
@@ -122,7 +122,7 @@ xlog_do_io(
        xfs_daddr_t             blk_no,
        unsigned int            nbblks,
        char                    *data,
-       unsigned int            op)
+       enum req_op             op)
 {
        int                     error;