@@ -37,8 +37,8 @@ all: version $(progs) manpages
version:
bash version.sh
-btrfs: $(objects) btrfs.o btrfs_cmds.o
- gcc $(CFLAGS) -o btrfs btrfs.o btrfs_cmds.o \
+btrfs: $(objects) btrfs.o btrfs_cmds.o scrub.o
+ gcc -lpthread $(CFLAGS) -o btrfs btrfs.o btrfs_cmds.o scrub.o \
$(objects) $(LDFLAGS) $(LIBS)
btrfsctl: $(objects) btrfsctl.o
@@ -95,6 +95,18 @@ static struct Command commands[] = {
"filesystem balance", "<path>\n"
"Balance the chunks across the device."
},
+ { do_scrub_start, -1,
+ "filesystem scrub start", "[-D] [-w] <path>\n"
+ "Check the underlying media for errors."
+ },
+ { do_scrub_cancel, 1,
+ "filesystem scrub cancel", "<path>\n"
+ "Cancel a running scrub."
+ },
+ { do_scrub_status, -1,
+ "filesystem scrub status", "[-r] <path>\n"
+ "Show status of running or finished scrub."
+ },
{ do_scan,
999, "device scan", "[<device> [<device>..]\n"
"Scan all device for or the passed device for a btrfs\n"
@@ -90,7 +90,7 @@ static int test_isdir(char *path)
}
-static int open_file_or_dir(const char *fname)
+int open_file_or_dir(const char *fname)
{
int ret;
struct stat st;
@@ -776,6 +776,7 @@ int do_balance(int argc, char **argv)
}
return 0;
}
+
int do_remove_volume(int nargs, char **args)
{
@@ -23,6 +23,9 @@ int do_defrag(int argc, char **argv);
int do_show_filesystem(int nargs, char **argv);
int do_add_volume(int nargs, char **args);
int do_balance(int nargs, char **argv);
+int do_scrub_start(int nargs, char **argv);
+int do_scrub_status(int argc, char **argv);
+int do_scrub_cancel(int nargs, char **argv);
int do_remove_volume(int nargs, char **args);
int do_scan(int nargs, char **argv);
int do_resize(int nargs, char **argv);
@@ -32,3 +35,4 @@ int list_subvols(int fd);
int do_df_filesystem(int nargs, char **argv);
int find_updated_files(int fd, u64 root_id, u64 oldest_gen);
int do_find_newer(int argc, char **argv);
+int open_file_or_dir(const char *fname);