btrfs: move scrub prototypes into scrub.h
authorJosef Bacik <josef@toxicpanda.com>
Wed, 26 Oct 2022 19:08:35 +0000 (15:08 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:47 +0000 (18:00 +0100)
Move these out of ctree.h into scrub.h to cut down on code in ctree.h.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/dev-replace.c
fs/btrfs/disk-io.c
fs/btrfs/ioctl.c
fs/btrfs/scrub.c
fs/btrfs/scrub.h [new file with mode: 0644]
fs/btrfs/super.c
fs/btrfs/transaction.c
fs/btrfs/volumes.c

index b1b6de5..f3facc1 100644 (file)
@@ -732,17 +732,6 @@ static inline unsigned long get_eb_page_index(unsigned long offset)
 #define EXPORT_FOR_TESTS
 #endif
 
-/* scrub.c */
-int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
-                   u64 end, struct btrfs_scrub_progress *progress,
-                   int readonly, int is_dev_replace);
-void btrfs_scrub_pause(struct btrfs_fs_info *fs_info);
-void btrfs_scrub_continue(struct btrfs_fs_info *fs_info);
-int btrfs_scrub_cancel(struct btrfs_fs_info *info);
-int btrfs_scrub_cancel_dev(struct btrfs_device *dev);
-int btrfs_scrub_progress(struct btrfs_fs_info *fs_info, u64 devid,
-                        struct btrfs_scrub_progress *progress);
-
 /* dev-replace.c */
 void btrfs_bio_counter_inc_blocked(struct btrfs_fs_info *fs_info);
 void btrfs_bio_counter_sub(struct btrfs_fs_info *fs_info, s64 amount);
index 94f8975..84af201 100644 (file)
@@ -25,6 +25,7 @@
 #include "block-group.h"
 #include "fs.h"
 #include "accessors.h"
+#include "scrub.h"
 
 /*
  * Device replace overview
index a613a9a..880bd39 100644 (file)
@@ -50,6 +50,7 @@
 #include "defrag.h"
 #include "uuid-tree.h"
 #include "relocation.h"
+#include "scrub.h"
 
 #define BTRFS_SUPER_FLAG_SUPP  (BTRFS_HEADER_FLAG_WRITTEN |\
                                 BTRFS_HEADER_FLAG_RELOC |\
index dba1f07..98cf16f 100644 (file)
@@ -59,6 +59,7 @@
 #include "uuid-tree.h"
 #include "ioctl.h"
 #include "file.h"
+#include "scrub.h"
 
 #ifdef CONFIG_64BIT
 /* If we have a 32-bit userspace and 64-bit kernel, then the UAPI
index e46e6c4..8c89e63 100644 (file)
@@ -24,6 +24,7 @@
 #include "fs.h"
 #include "accessors.h"
 #include "file-item.h"
+#include "scrub.h"
 
 /*
  * This is only the first step towards a full-features scrub. It reads all
diff --git a/fs/btrfs/scrub.h b/fs/btrfs/scrub.h
new file mode 100644 (file)
index 0000000..7639103
--- /dev/null
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef BTRFS_SCRUB_H
+#define BTRFS_SCRUB_H
+
+int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
+                   u64 end, struct btrfs_scrub_progress *progress,
+                   int readonly, int is_dev_replace);
+void btrfs_scrub_pause(struct btrfs_fs_info *fs_info);
+void btrfs_scrub_continue(struct btrfs_fs_info *fs_info);
+int btrfs_scrub_cancel(struct btrfs_fs_info *info);
+int btrfs_scrub_cancel_dev(struct btrfs_device *dev);
+int btrfs_scrub_progress(struct btrfs_fs_info *fs_info, u64 devid,
+                        struct btrfs_scrub_progress *progress);
+
+#endif
index 2cd0524..4bfda9b 100644 (file)
@@ -55,6 +55,7 @@
 #include "defrag.h"
 #include "dir-item.h"
 #include "ioctl.h"
+#include "scrub.h"
 #define CREATE_TRACE_POINTS
 #include <trace/events/btrfs.h>
 
index a262fd1..593b241 100644 (file)
@@ -33,6 +33,7 @@
 #include "uuid-tree.h"
 #include "ioctl.h"
 #include "relocation.h"
+#include "scrub.h"
 
 static struct kmem_cache *btrfs_trans_handle_cachep;
 
index abfa6a9..5606060 100644 (file)
@@ -38,6 +38,7 @@
 #include "uuid-tree.h"
 #include "ioctl.h"
 #include "relocation.h"
+#include "scrub.h"
 
 static struct bio_set btrfs_bioset;