btrfs: separate types for submit_bio_start and submit_bio_done
authorDavid Sterba <dsterba@suse.com>
Fri, 23 Jun 2017 01:05:23 +0000 (03:05 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Mar 2018 23:26:55 +0000 (01:26 +0200)
The callbacks make use of different parameters that are passed to the
other type unnecessarily. This patch adds separate types for each and
the unused parameters will be removed.

The type extent_submit_bio_hook_t keeps all parameters and can be used
where the start/done types are not appropriate.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h
fs/btrfs/extent_io.h

index bbbcbf87ac93ea87c79502fbb3d7df01c1ecb3c8..ee5d29a0219fb60c33184301e10995f993b1b18d 100644 (file)
@@ -124,8 +124,8 @@ struct async_submit_bio {
        void *private_data;
        struct btrfs_fs_info *fs_info;
        struct bio *bio;
-       extent_submit_bio_hook_t *submit_bio_start;
-       extent_submit_bio_hook_t *submit_bio_done;
+       extent_submit_bio_start_t *submit_bio_start;
+       extent_submit_bio_done_t *submit_bio_done;
        int mirror_num;
        unsigned long bio_flags;
        /*
@@ -751,8 +751,8 @@ static void run_one_async_free(struct btrfs_work *work)
 blk_status_t btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
                                 int mirror_num, unsigned long bio_flags,
                                 u64 bio_offset, void *private_data,
-                                extent_submit_bio_hook_t *submit_bio_start,
-                                extent_submit_bio_hook_t *submit_bio_done)
+                                extent_submit_bio_start_t *submit_bio_start,
+                                extent_submit_bio_done_t *submit_bio_done)
 {
        struct async_submit_bio *async;
 
index aaf99529883db2f17ad7fcff20cadb4c1609af49..70a88d61b547c9c572ffda0d98d0a2d76d4f8211 100644 (file)
@@ -131,8 +131,8 @@ blk_status_t btrfs_bio_wq_end_io(struct btrfs_fs_info *info, struct bio *bio,
 blk_status_t btrfs_wq_submit_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
                        int mirror_num, unsigned long bio_flags,
                        u64 bio_offset, void *private_data,
-                       extent_submit_bio_hook_t *submit_bio_start,
-                       extent_submit_bio_hook_t *submit_bio_done);
+                       extent_submit_bio_start_t *submit_bio_start,
+                       extent_submit_bio_done_t *submit_bio_done);
 int btrfs_write_tree_block(struct extent_buffer *buf);
 void btrfs_wait_tree_block_writeback(struct extent_buffer *buf);
 int btrfs_init_log_root_tree(struct btrfs_trans_handle *trans,
index c82a5842d524850a093b51c8ccee9dd6154f50ea..bbfae2abfb39ad2616654c594ef00be2164da7c2 100644 (file)
@@ -95,6 +95,15 @@ struct io_failure_record;
 typedef        blk_status_t (extent_submit_bio_hook_t)(void *private_data, struct bio *bio,
                                       int mirror_num, unsigned long bio_flags,
                                       u64 bio_offset);
+
+typedef blk_status_t (extent_submit_bio_start_t)(void *private_data,
+               struct bio *bio, int mirror_num, unsigned long bio_flags,
+               u64 bio_offset);
+
+typedef blk_status_t (extent_submit_bio_done_t)(void *private_data,
+               struct bio *bio, int mirror_num, unsigned long bio_flags,
+               u64 bio_offset);
+
 struct extent_io_ops {
        /*
         * The following callbacks must be allways defined, the function