114572d558
- remove debugging printf from 0001-Btrfs-progs-add-a-btrfs-select-super-command-to-over.patch (forwarded request 76766 from dsterba) OBS-URL: https://build.opensuse.org/request/show/76976 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/btrfsprogs?expand=0&rev=22
104 lines
3.5 KiB
Diff
104 lines
3.5 KiB
Diff
From dbe531beb817f8cb584faf05251f6bd744fc7786 Mon Sep 17 00:00:00 2001
|
|
From: Jan Schmidt <list.btrfs@jan-o-sch.net>
|
|
Date: Wed, 30 Mar 2011 18:53:09 +0200
|
|
Subject: [PATCH 16/32] commands added
|
|
|
|
- scrub commands added
|
|
- open_file_or_dir no longer static (needed by scrub.c)
|
|
|
|
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
|
|
---
|
|
Makefile | 4 ++--
|
|
btrfs.c | 20 ++++++++++++++++++++
|
|
btrfs_cmds.c | 3 ++-
|
|
btrfs_cmds.h | 5 +++++
|
|
4 files changed, 29 insertions(+), 3 deletions(-)
|
|
|
|
Index: btrfs-progs-v0.19-35-g1b444cd/Makefile
|
|
===================================================================
|
|
--- btrfs-progs-v0.19-35-g1b444cd.orig/Makefile
|
|
+++ btrfs-progs-v0.19-35-g1b444cd/Makefile
|
|
@@ -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 $(CFLAGS) -pthread -o btrfs btrfs.o btrfs_cmds.o scrub.o \
|
|
$(objects) $(LDFLAGS) $(LIBS)
|
|
|
|
btrfsctl: $(objects) btrfsctl.o
|
|
Index: btrfs-progs-v0.19-35-g1b444cd/btrfs.c
|
|
===================================================================
|
|
--- btrfs-progs-v0.19-35-g1b444cd.orig/btrfs.c
|
|
+++ btrfs-progs-v0.19-35-g1b444cd/btrfs.c
|
|
@@ -125,6 +125,26 @@ static struct Command commands[] = {
|
|
"If <newlabel> is passed, set the filesystem label to <newlabel>.\n"
|
|
"The filesystem must be unmounted.\n"
|
|
},
|
|
+ { do_scrub_start, -1,
|
|
+ "scrub start", "[-Bdqr] <path>|<device>\n"
|
|
+ "Start a new scrub.",
|
|
+ NULL
|
|
+ },
|
|
+ { do_scrub_cancel, 1,
|
|
+ "scrub cancel", "<path>|<device>\n"
|
|
+ "Cancel a running scrub.",
|
|
+ NULL
|
|
+ },
|
|
+ { do_scrub_resume, -1,
|
|
+ "scrub resume", "[-Bdqr] <path>|<device>\n"
|
|
+ "Resume previously canceled or interrupted scrub.",
|
|
+ NULL
|
|
+ },
|
|
+ { do_scrub_status, -1,
|
|
+ "scrub status", "[-d] <path>|<device>\n"
|
|
+ "Show status of running or finished scrub.",
|
|
+ NULL
|
|
+ },
|
|
{ do_scan, 999,
|
|
"device scan", "[<device>...]\n"
|
|
"Scan all device for or the passed device for a btrfs\n"
|
|
Index: btrfs-progs-v0.19-35-g1b444cd/btrfs_cmds.c
|
|
===================================================================
|
|
--- btrfs-progs-v0.19-35-g1b444cd.orig/btrfs_cmds.c
|
|
+++ btrfs-progs-v0.19-35-g1b444cd/btrfs_cmds.c
|
|
@@ -91,7 +91,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;
|
|
@@ -858,6 +858,7 @@ int do_balance(int argc, char **argv)
|
|
}
|
|
return 0;
|
|
}
|
|
+
|
|
int do_remove_volume(int nargs, char **args)
|
|
{
|
|
|
|
Index: btrfs-progs-v0.19-35-g1b444cd/btrfs_cmds.h
|
|
===================================================================
|
|
--- btrfs-progs-v0.19-35-g1b444cd.orig/btrfs_cmds.h
|
|
+++ btrfs-progs-v0.19-35-g1b444cd/btrfs_cmds.h
|
|
@@ -23,6 +23,10 @@ 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_resume(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);
|
|
@@ -33,3 +37,4 @@ int do_df_filesystem(int nargs, char **a
|
|
int find_updated_files(int fd, u64 root_id, u64 oldest_gen);
|
|
int do_find_newer(int argc, char **argv);
|
|
int do_change_label(int argc, char **argv);
|
|
+int open_file_or_dir(const char *fname);
|