- add btrfs-debug-tree to initrd
- adjust fs size to correct size (bnc#744593) - man page documentation updates - do not package obsolete utilities - mkfs: store correct size of device in superblock (bnc#730103) - updated restriper/balance commands to match kernel version - device scanning fixes for dm and multipath (bnc#749540) OBS-URL: https://build.opensuse.org/package/show/filesystems/btrfsprogs?expand=0&rev=121
This commit is contained in:
parent
9b657ba61b
commit
b3ba9dc0aa
@ -19,11 +19,11 @@ Signed-off-by: Jan Kara <jack@suse.cz>
|
||||
utils.h | 2 +-
|
||||
4 files changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/convert.c b/convert.c
|
||||
index c036f46..13f3ece 100644
|
||||
--- a/convert.c
|
||||
+++ b/convert.c
|
||||
@@ -2374,7 +2374,7 @@ int do_convert(const char *devname, int datacsum, int packing, int noxattr)
|
||||
Index: btrfs-progs-v0.19-118-gfdb6c04/convert.c
|
||||
===================================================================
|
||||
--- btrfs-progs-v0.19-118-gfdb6c04.orig/convert.c
|
||||
+++ btrfs-progs-v0.19-118-gfdb6c04/convert.c
|
||||
@@ -2374,7 +2374,7 @@ int do_convert(const char *devname, int
|
||||
goto fail;
|
||||
}
|
||||
ret = make_btrfs(fd, devname, ext2_fs->super->s_volume_name,
|
||||
@ -32,11 +32,22 @@ index c036f46..13f3ece 100644
|
||||
blocksize, blocksize);
|
||||
if (ret) {
|
||||
fprintf(stderr, "unable to create initial ctree\n");
|
||||
diff --git a/mkfs.c b/mkfs.c
|
||||
index be236d0..97481bd 100644
|
||||
--- a/mkfs.c
|
||||
+++ b/mkfs.c
|
||||
@@ -1302,8 +1302,10 @@ int main(int ac, char **av)
|
||||
Index: btrfs-progs-v0.19-118-gfdb6c04/mkfs.c
|
||||
===================================================================
|
||||
--- btrfs-progs-v0.19-118-gfdb6c04.orig/mkfs.c
|
||||
+++ btrfs-progs-v0.19-118-gfdb6c04/mkfs.c
|
||||
@@ -1290,6 +1290,10 @@ int main(int ac, char **av)
|
||||
ret = btrfs_prepare_device(fd, file, zero_end, &dev_block_count, &mixed);
|
||||
if (block_count == 0)
|
||||
block_count = dev_block_count;
|
||||
+ else if (block_count > dev_block_count) {
|
||||
+ fprintf(stderr, "%s is smaller than requested size\n", file);
|
||||
+ exit(1);
|
||||
+ }
|
||||
} else {
|
||||
ac = 0;
|
||||
file = av[optind++];
|
||||
@@ -1302,8 +1306,10 @@ int main(int ac, char **av)
|
||||
first_file = file;
|
||||
source_dir_size = size_sourcedir(source_dir, sectorsize,
|
||||
&num_of_meta_chunks, &size_of_data);
|
||||
@ -48,7 +59,7 @@ index be236d0..97481bd 100644
|
||||
ret = zero_output_file(fd, block_count, sectorsize);
|
||||
if (ret) {
|
||||
fprintf(stderr, "unable to zero the output file\n");
|
||||
@@ -1329,7 +1331,7 @@ int main(int ac, char **av)
|
||||
@@ -1329,7 +1335,7 @@ int main(int ac, char **av)
|
||||
leafsize * i;
|
||||
}
|
||||
|
||||
@ -57,10 +68,10 @@ index be236d0..97481bd 100644
|
||||
nodesize, leafsize,
|
||||
sectorsize, stripesize);
|
||||
if (ret) {
|
||||
diff --git a/utils.c b/utils.c
|
||||
index 6c96548..a2be9c9 100644
|
||||
--- a/utils.c
|
||||
+++ b/utils.c
|
||||
Index: btrfs-progs-v0.19-118-gfdb6c04/utils.c
|
||||
===================================================================
|
||||
--- btrfs-progs-v0.19-118-gfdb6c04.orig/utils.c
|
||||
+++ btrfs-progs-v0.19-118-gfdb6c04/utils.c
|
||||
@@ -74,7 +74,7 @@ static u64 reference_root_table[] = {
|
||||
};
|
||||
|
||||
@ -70,7 +81,7 @@ index 6c96548..a2be9c9 100644
|
||||
u32 leafsize, u32 sectorsize, u32 stripesize)
|
||||
{
|
||||
struct btrfs_super_block super;
|
||||
@@ -276,7 +276,7 @@ int make_btrfs(int fd, const char *device, const char *label,
|
||||
@@ -276,7 +276,7 @@ int make_btrfs(int fd, const char *devic
|
||||
dev_item = btrfs_item_ptr(buf, nritems, struct btrfs_dev_item);
|
||||
btrfs_set_device_id(buf, dev_item, 1);
|
||||
btrfs_set_device_generation(buf, dev_item, 0);
|
||||
@ -79,10 +90,10 @@ index 6c96548..a2be9c9 100644
|
||||
btrfs_set_device_bytes_used(buf, dev_item,
|
||||
BTRFS_MKFS_SYSTEM_GROUP_SIZE);
|
||||
btrfs_set_device_io_align(buf, dev_item, sectorsize);
|
||||
diff --git a/utils.h b/utils.h
|
||||
index c5f55e1..bf2d5a4 100644
|
||||
--- a/utils.h
|
||||
+++ b/utils.h
|
||||
Index: btrfs-progs-v0.19-118-gfdb6c04/utils.h
|
||||
===================================================================
|
||||
--- btrfs-progs-v0.19-118-gfdb6c04.orig/utils.h
|
||||
+++ btrfs-progs-v0.19-118-gfdb6c04/utils.h
|
||||
@@ -22,7 +22,7 @@
|
||||
#define BTRFS_MKFS_SYSTEM_GROUP_SIZE (4 * 1024 * 1024)
|
||||
|
||||
@ -92,6 +103,3 @@ index c5f55e1..bf2d5a4 100644
|
||||
u32 leafsize, u32 sectorsize, u32 stripesize);
|
||||
int btrfs_make_root_dir(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, u64 objectid);
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
||||
|
@ -16,7 +16,7 @@ Index: btrfs-progs-v0.19-118-gfdb6c04/man/mkfs.btrfs.8.in
|
||||
===================================================================
|
||||
--- btrfs-progs-v0.19-118-gfdb6c04.orig/man/mkfs.btrfs.8.in
|
||||
+++ btrfs-progs-v0.19-118-gfdb6c04/man/mkfs.btrfs.8.in
|
||||
@@ -5,16 +5,16 @@ mkfs.btrfs \- create an btrfs filesystem
|
||||
@@ -5,17 +5,17 @@ mkfs.btrfs \- create an btrfs filesystem
|
||||
.B mkfs.btrfs
|
||||
[ \fB\-A\fP\fI alloc-start\fP ]
|
||||
[ \fB\-b\fP\fI byte-count\fP ]
|
||||
@ -28,6 +28,7 @@ Index: btrfs-progs-v0.19-118-gfdb6c04/man/mkfs.btrfs.8.in
|
||||
-[ \fB \-M\fP\fI mixed data+metadata\fP ]
|
||||
-[ \fB \-n\fP\fI nodesize\fP ]
|
||||
-[ \fB \-s\fP\fI sectorsize\fP ]
|
||||
-[ \fB \-T\fP ]
|
||||
-[ \fB \-h\fP ]
|
||||
-[ \fB \-V\fP ] \fI device\fP [ \fI device ...\fP ]
|
||||
+[ \fB\-d\fP\fI data-profile\fP ]
|
||||
@ -38,6 +39,7 @@ Index: btrfs-progs-v0.19-118-gfdb6c04/man/mkfs.btrfs.8.in
|
||||
+[ \fB\-M\fP\fI mixed data+metadata\fP ]
|
||||
+[ \fB\-n\fP\fI nodesize\fP ]
|
||||
+[ \fB\-s\fP\fI sectorsize\fP ]
|
||||
+[ \fB\-T\fP ]
|
||||
+[ \fB\-h\fP ]
|
||||
+[ \fB\-V\fP ] \fI device\fP [ \fI device ...\fP ]
|
||||
.SH DESCRIPTION
|
||||
|
@ -17,16 +17,16 @@ Index: btrfs-progs-v0.19-118-gfdb6c04/man/mkfs.btrfs.8.in
|
||||
[ \fB\-n\fP\fI nodesize\fP ]
|
||||
[ \fB\-s\fP\fI sectorsize\fP ]
|
||||
+[ \fB\-r\fP\fI rootdir\fP ]
|
||||
[ \fB\-T\fP ]
|
||||
[ \fB\-h\fP ]
|
||||
[ \fB\-V\fP ] \fI device\fP [ \fI device ...\fP ]
|
||||
.SH DESCRIPTION
|
||||
@@ -62,6 +63,9 @@ Specify the nodesize. By default the val
|
||||
@@ -63,6 +64,9 @@ Specify the nodesize. By default the val
|
||||
\fB\-s\fR, \fB\-\-sectorsize \fIsize\fR
|
||||
Specify the sectorsize, the minimum block allocation.
|
||||
.TP
|
||||
+\fB\-r\fR, \fB\-\-rootdir \fIrootdir\fR
|
||||
+Specify a directory to copy into the newly created fs.
|
||||
+.TP
|
||||
\fB\-V\fR, \fB\-\-version\fR
|
||||
Print the \fBmkfs.btrfs\fP version and exit.
|
||||
.SH AVAILABILITY
|
||||
\fB\-T\fR, \fB\-\-nodiscard \fR
|
||||
Do not perform whole device TRIM operation by default.
|
||||
.TP
|
||||
|
@ -0,0 +1,28 @@
|
||||
From 08121cd091aa7b555dcb09077296deec8b1c4d72 Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Tue, 13 Mar 2012 18:10:09 +0100
|
||||
Subject: [PATCH 1/8] btrfs-progs: adjust size of filesystem if blockdevice is
|
||||
larger
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
utils.c | 3 +++
|
||||
1 files changed, 3 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/utils.c b/utils.c
|
||||
index 0beaf80..f885307 100644
|
||||
--- a/utils.c
|
||||
+++ b/utils.c
|
||||
@@ -273,6 +273,9 @@ int make_btrfs(int fd, const char *device, const char *label,
|
||||
btrfs_set_item_offset(buf, btrfs_item_nr(buf, nritems), itemoff);
|
||||
btrfs_set_item_size(buf, btrfs_item_nr(buf, nritems), item_size);
|
||||
|
||||
+ if (num_bytes < dev_num_bytes)
|
||||
+ dev_num_bytes = num_bytes;
|
||||
+
|
||||
dev_item = btrfs_item_ptr(buf, nritems, struct btrfs_dev_item);
|
||||
btrfs_set_device_id(buf, dev_item, 1);
|
||||
btrfs_set_device_generation(buf, dev_item, 0);
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
@ -0,0 +1,31 @@
|
||||
From 04ed6645aa91d023c06c1db361a2a22f4615eea0 Mon Sep 17 00:00:00 2001
|
||||
From: Ilya Dryomov <idryomov@gmail.com>
|
||||
Date: Mon, 12 Mar 2012 19:17:39 +0200
|
||||
Subject: [PATCH 2/8] Btrfs-progs: nuke redundant zeroing in
|
||||
__list_subvol_search()
|
||||
|
||||
There's no need to zero out things twice.
|
||||
|
||||
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
|
||||
---
|
||||
btrfs-list.c | 4 ----
|
||||
1 files changed, 0 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/btrfs-list.c b/btrfs-list.c
|
||||
index 5f4a9be..44a73de 100644
|
||||
--- a/btrfs-list.c
|
||||
+++ b/btrfs-list.c
|
||||
@@ -569,10 +569,6 @@ static int __list_subvol_search(int fd, struct root_lookup *root_lookup)
|
||||
root_lookup_init(root_lookup);
|
||||
memset(&args, 0, sizeof(args));
|
||||
|
||||
- root_lookup_init(root_lookup);
|
||||
-
|
||||
- memset(&args, 0, sizeof(args));
|
||||
-
|
||||
/* search in the tree of tree roots */
|
||||
sk->tree_id = 1;
|
||||
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
89
0175-Btrfs-progs-refactor-resolve_root-function-a-bit.patch
Normal file
89
0175-Btrfs-progs-refactor-resolve_root-function-a-bit.patch
Normal file
@ -0,0 +1,89 @@
|
||||
From 039e2ae2add77881b332667ef5c8e218cd208198 Mon Sep 17 00:00:00 2001
|
||||
From: Ilya Dryomov <idryomov@gmail.com>
|
||||
Date: Mon, 12 Mar 2012 19:17:39 +0200
|
||||
Subject: [PATCH 3/8] Btrfs-progs: refactor resolve_root() function a bit
|
||||
|
||||
Don't pass a pointer to root_id to resolve_root(). It's always the same as
|
||||
ri->root_id, passing a pointer hints that root_id can somehow change which is
|
||||
not true.
|
||||
|
||||
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
|
||||
---
|
||||
btrfs-list.c | 21 ++++++++++-----------
|
||||
1 files changed, 10 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/btrfs-list.c b/btrfs-list.c
|
||||
index 44a73de..cc1dc66 100644
|
||||
--- a/btrfs-list.c
|
||||
+++ b/btrfs-list.c
|
||||
@@ -200,7 +200,7 @@ static int add_root(struct root_lookup *root_lookup,
|
||||
* in by lookup_ino_path
|
||||
*/
|
||||
static int resolve_root(struct root_lookup *rl, struct root_info *ri,
|
||||
- u64 *root_id, u64 *parent_id, u64 *top_id, char **path)
|
||||
+ u64 *parent_id, u64 *top_id, char **path)
|
||||
{
|
||||
char *full_path = NULL;
|
||||
int len = 0;
|
||||
@@ -254,7 +254,6 @@ static int resolve_root(struct root_lookup *rl, struct root_info *ri,
|
||||
}
|
||||
}
|
||||
|
||||
- *root_id = ri->root_id;
|
||||
*path = full_path;
|
||||
|
||||
return 0;
|
||||
@@ -692,23 +691,23 @@ int list_subvols(int fd, int print_parent)
|
||||
n = rb_last(&root_lookup.root);
|
||||
while (n) {
|
||||
struct root_info *entry;
|
||||
- u64 root_id;
|
||||
u64 level;
|
||||
u64 parent_id;
|
||||
char *path;
|
||||
+
|
||||
entry = rb_entry(n, struct root_info, rb_node);
|
||||
- resolve_root(&root_lookup, entry, &root_id, &parent_id,
|
||||
- &level, &path);
|
||||
+ resolve_root(&root_lookup, entry, &parent_id, &level, &path);
|
||||
if (print_parent) {
|
||||
printf("ID %llu parent %llu top level %llu path %s\n",
|
||||
- (unsigned long long)root_id,
|
||||
+ (unsigned long long)entry->root_id,
|
||||
(unsigned long long)parent_id,
|
||||
(unsigned long long)level, path);
|
||||
} else {
|
||||
printf("ID %llu top level %llu path %s\n",
|
||||
- (unsigned long long)root_id,
|
||||
+ (unsigned long long)entry->root_id,
|
||||
(unsigned long long)level, path);
|
||||
}
|
||||
+
|
||||
free(path);
|
||||
n = rb_prev(n);
|
||||
}
|
||||
@@ -914,17 +913,17 @@ char *path_for_root(int fd, u64 root)
|
||||
n = rb_last(&root_lookup.root);
|
||||
while (n) {
|
||||
struct root_info *entry;
|
||||
- u64 root_id;
|
||||
u64 parent_id;
|
||||
u64 level;
|
||||
char *path;
|
||||
+
|
||||
entry = rb_entry(n, struct root_info, rb_node);
|
||||
- resolve_root(&root_lookup, entry, &root_id, &parent_id, &level,
|
||||
- &path);
|
||||
- if (root_id == root)
|
||||
+ resolve_root(&root_lookup, entry, &parent_id, &level, &path);
|
||||
+ if (entry->root_id == root)
|
||||
ret_path = path;
|
||||
else
|
||||
free(path);
|
||||
+
|
||||
n = rb_prev(n);
|
||||
}
|
||||
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
142
0176-Btrfs-progs-bring-subvol-get-default-back-in.patch
Normal file
142
0176-Btrfs-progs-bring-subvol-get-default-back-in.patch
Normal file
@ -0,0 +1,142 @@
|
||||
From ab67e5db559701b71a20e39948c5a531b7469362 Mon Sep 17 00:00:00 2001
|
||||
From: Ilya Dryomov <idryomov@gmail.com>
|
||||
Date: Mon, 12 Mar 2012 19:17:39 +0200
|
||||
Subject: [PATCH 4/8] Btrfs-progs: bring 'subvol get-default' back in
|
||||
|
||||
Commit bab2c565 accidentally broke 'subvol get-default' command by
|
||||
removing almost all of the underlying code. Bring it back with some
|
||||
fixes and improvements.
|
||||
|
||||
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
|
||||
---
|
||||
btrfs-list.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
ctree.h | 2 +
|
||||
2 files changed, 82 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/btrfs-list.c b/btrfs-list.c
|
||||
index cc1dc66..00c428b 100644
|
||||
--- a/btrfs-list.c
|
||||
+++ b/btrfs-list.c
|
||||
@@ -552,6 +552,60 @@ build:
|
||||
return full;
|
||||
}
|
||||
|
||||
+static int get_default_subvolid(int fd, u64 *default_id)
|
||||
+{
|
||||
+ struct btrfs_ioctl_search_args args;
|
||||
+ struct btrfs_ioctl_search_key *sk = &args.key;
|
||||
+ struct btrfs_ioctl_search_header *sh;
|
||||
+ u64 found = 0;
|
||||
+ int ret;
|
||||
+
|
||||
+ memset(&args, 0, sizeof(args));
|
||||
+
|
||||
+ /*
|
||||
+ * search for a dir item with a name 'default' in the tree of
|
||||
+ * tree roots, it should point us to a default root
|
||||
+ */
|
||||
+ sk->tree_id = 1;
|
||||
+
|
||||
+ /* don't worry about ancient format and request only one item */
|
||||
+ sk->nr_items = 1;
|
||||
+
|
||||
+ sk->max_objectid = BTRFS_ROOT_TREE_DIR_OBJECTID;
|
||||
+ sk->min_objectid = BTRFS_ROOT_TREE_DIR_OBJECTID;
|
||||
+ sk->max_type = BTRFS_DIR_ITEM_KEY;
|
||||
+ sk->min_type = BTRFS_DIR_ITEM_KEY;
|
||||
+ sk->max_offset = (u64)-1;
|
||||
+ sk->max_transid = (u64)-1;
|
||||
+
|
||||
+ ret = ioctl(fd, BTRFS_IOC_TREE_SEARCH, &args);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
+ /* the ioctl returns the number of items it found in nr_items */
|
||||
+ if (sk->nr_items == 0)
|
||||
+ goto out;
|
||||
+
|
||||
+ sh = (struct btrfs_ioctl_search_header *)args.buf;
|
||||
+
|
||||
+ if (sh->type == BTRFS_DIR_ITEM_KEY) {
|
||||
+ struct btrfs_dir_item *di;
|
||||
+ int name_len;
|
||||
+ char *name;
|
||||
+
|
||||
+ di = (struct btrfs_dir_item *)(sh + 1);
|
||||
+ name_len = btrfs_stack_dir_name_len(di);
|
||||
+ name = (char *)(di + 1);
|
||||
+
|
||||
+ if (!strncmp("default", name, name_len))
|
||||
+ found = btrfs_disk_key_objectid(&di->location);
|
||||
+ }
|
||||
+
|
||||
+out:
|
||||
+ *default_id = found;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int __list_subvol_search(int fd, struct root_lookup *root_lookup)
|
||||
{
|
||||
int ret;
|
||||
@@ -663,12 +717,32 @@ static int __list_subvol_fill_paths(int fd, struct root_lookup *root_lookup)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-int list_subvols(int fd, int print_parent)
|
||||
+int list_subvols(int fd, int print_parent, int get_default)
|
||||
{
|
||||
struct root_lookup root_lookup;
|
||||
struct rb_node *n;
|
||||
+ u64 default_id;
|
||||
int ret;
|
||||
|
||||
+ if (get_default) {
|
||||
+ ret = get_default_subvolid(fd, &default_id);
|
||||
+ if (ret) {
|
||||
+ fprintf(stderr, "ERROR: can't perform the search - %s\n",
|
||||
+ strerror(errno));
|
||||
+ return ret;
|
||||
+ }
|
||||
+ if (default_id == 0) {
|
||||
+ fprintf(stderr, "ERROR: 'default' dir item not found\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ /* no need to resolve roots if FS_TREE is default */
|
||||
+ if (default_id == BTRFS_FS_TREE_OBJECTID) {
|
||||
+ printf("ID 5 (FS_TREE)\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
ret = __list_subvol_search(fd, &root_lookup);
|
||||
if (ret) {
|
||||
fprintf(stderr, "ERROR: can't perform the search - %s\n",
|
||||
@@ -696,6 +770,11 @@ int list_subvols(int fd, int print_parent)
|
||||
char *path;
|
||||
|
||||
entry = rb_entry(n, struct root_info, rb_node);
|
||||
+ if (get_default && entry->root_id != default_id) {
|
||||
+ n = rb_prev(n);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
resolve_root(&root_lookup, entry, &parent_id, &level, &path);
|
||||
if (print_parent) {
|
||||
printf("ID %llu parent %llu top level %llu path %s\n",
|
||||
diff --git a/ctree.h b/ctree.h
|
||||
index 5309059..141ec59 100644
|
||||
--- a/ctree.h
|
||||
+++ b/ctree.h
|
||||
@@ -1416,6 +1416,8 @@ BTRFS_SETGET_FUNCS(dir_type, struct btrfs_dir_item, type, 8);
|
||||
BTRFS_SETGET_FUNCS(dir_name_len, struct btrfs_dir_item, name_len, 16);
|
||||
BTRFS_SETGET_FUNCS(dir_transid, struct btrfs_dir_item, transid, 64);
|
||||
|
||||
+BTRFS_SETGET_STACK_FUNCS(stack_dir_name_len, struct btrfs_dir_item, name_len, 16);
|
||||
+
|
||||
static inline void btrfs_dir_item_key(struct extent_buffer *eb,
|
||||
struct btrfs_dir_item *item,
|
||||
struct btrfs_disk_key *key)
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
185
0177-Btrfs-progs-make-print-tree.c-aware-of-free-space-ca.patch
Normal file
185
0177-Btrfs-progs-make-print-tree.c-aware-of-free-space-ca.patch
Normal file
@ -0,0 +1,185 @@
|
||||
From 55b993c8889135f51ce66b26caf54e3e17b03e34 Mon Sep 17 00:00:00 2001
|
||||
From: Ilya Dryomov <idryomov@gmail.com>
|
||||
Date: Tue, 13 Mar 2012 18:36:56 +0200
|
||||
Subject: [PATCH 5/8] Btrfs-progs: make print-tree.c aware of free space cache
|
||||
|
||||
This adds proper formatting for free space and inode cache items in
|
||||
btrfs-debug-tree output.
|
||||
|
||||
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
|
||||
---
|
||||
ctree.h | 29 +++++++++++++++++++++++++++++
|
||||
print-tree.c | 52 +++++++++++++++++++++++++++++++++++++++++++---------
|
||||
2 files changed, 72 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/ctree.h b/ctree.h
|
||||
index 141ec59..147c3cb 100644
|
||||
--- a/ctree.h
|
||||
+++ b/ctree.h
|
||||
@@ -256,6 +256,13 @@ struct btrfs_chunk {
|
||||
/* additional stripes go here */
|
||||
} __attribute__ ((__packed__));
|
||||
|
||||
+struct btrfs_free_space_header {
|
||||
+ struct btrfs_disk_key location;
|
||||
+ __le64 generation;
|
||||
+ __le64 num_entries;
|
||||
+ __le64 num_bitmaps;
|
||||
+} __attribute__ ((__packed__));
|
||||
+
|
||||
static inline unsigned long btrfs_chunk_item_size(int num_stripes)
|
||||
{
|
||||
BUG_ON(num_stripes == 0);
|
||||
@@ -1432,6 +1439,28 @@ static inline void btrfs_set_dir_item_key(struct extent_buffer *eb,
|
||||
write_eb_member(eb, item, struct btrfs_dir_item, location, key);
|
||||
}
|
||||
|
||||
+/* struct btrfs_free_space_header */
|
||||
+BTRFS_SETGET_FUNCS(free_space_entries, struct btrfs_free_space_header,
|
||||
+ num_entries, 64);
|
||||
+BTRFS_SETGET_FUNCS(free_space_bitmaps, struct btrfs_free_space_header,
|
||||
+ num_bitmaps, 64);
|
||||
+BTRFS_SETGET_FUNCS(free_space_generation, struct btrfs_free_space_header,
|
||||
+ generation, 64);
|
||||
+
|
||||
+static inline void btrfs_free_space_key(struct extent_buffer *eb,
|
||||
+ struct btrfs_free_space_header *h,
|
||||
+ struct btrfs_disk_key *key)
|
||||
+{
|
||||
+ read_eb_member(eb, h, struct btrfs_free_space_header, location, key);
|
||||
+}
|
||||
+
|
||||
+static inline void btrfs_set_free_space_key(struct extent_buffer *eb,
|
||||
+ struct btrfs_free_space_header *h,
|
||||
+ struct btrfs_disk_key *key)
|
||||
+{
|
||||
+ write_eb_member(eb, h, struct btrfs_free_space_header, location, key);
|
||||
+}
|
||||
+
|
||||
/* struct btrfs_disk_key */
|
||||
BTRFS_SETGET_STACK_FUNCS(disk_key_objectid, struct btrfs_disk_key,
|
||||
objectid, 64);
|
||||
diff --git a/print-tree.c b/print-tree.c
|
||||
index fc134c0..face47a 100644
|
||||
--- a/print-tree.c
|
||||
+++ b/print-tree.c
|
||||
@@ -94,6 +94,7 @@ static void print_chunk(struct extent_buffer *eb, struct btrfs_chunk *chunk)
|
||||
(unsigned long long)btrfs_stripe_offset_nr(eb, chunk, i));
|
||||
}
|
||||
}
|
||||
+
|
||||
static void print_dev_item(struct extent_buffer *eb,
|
||||
struct btrfs_dev_item *dev_item)
|
||||
{
|
||||
@@ -276,8 +277,29 @@ static void print_root_ref(struct extent_buffer *leaf, int slot, char *tag)
|
||||
namelen, namebuf);
|
||||
}
|
||||
|
||||
-static void print_key_type(u8 type)
|
||||
+static void print_free_space_header(struct extent_buffer *leaf, int slot)
|
||||
{
|
||||
+ struct btrfs_free_space_header *header;
|
||||
+ struct btrfs_disk_key location;
|
||||
+
|
||||
+ header = btrfs_item_ptr(leaf, slot, struct btrfs_free_space_header);
|
||||
+ btrfs_free_space_key(leaf, header, &location);
|
||||
+ printf("\t\tlocation ");
|
||||
+ btrfs_print_key(&location);
|
||||
+ printf("\n");
|
||||
+ printf("\t\tcache generation %llu entries %llu bitmaps %llu\n",
|
||||
+ (unsigned long long)btrfs_free_space_generation(leaf, header),
|
||||
+ (unsigned long long)btrfs_free_space_entries(leaf, header),
|
||||
+ (unsigned long long)btrfs_free_space_bitmaps(leaf, header));
|
||||
+}
|
||||
+
|
||||
+static void print_key_type(u64 objectid, u8 type)
|
||||
+{
|
||||
+ if (type == 0 && objectid == BTRFS_FREE_SPACE_OBJECTID) {
|
||||
+ printf("UNTYPED");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
switch (type) {
|
||||
case BTRFS_INODE_ITEM_KEY:
|
||||
printf("INODE_ITEM");
|
||||
@@ -362,10 +384,10 @@ static void print_key_type(u8 type)
|
||||
};
|
||||
}
|
||||
|
||||
-static void print_objectid(unsigned long long objectid, u8 type)
|
||||
+static void print_objectid(u64 objectid, u8 type)
|
||||
{
|
||||
if (type == BTRFS_DEV_EXTENT_KEY) {
|
||||
- printf("%llu", objectid); /* device id */
|
||||
+ printf("%llu", (unsigned long long)objectid); /* device id */
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -415,6 +437,12 @@ static void print_objectid(unsigned long long objectid, u8 type)
|
||||
case BTRFS_EXTENT_CSUM_OBJECTID:
|
||||
printf("EXTENT_CSUM");
|
||||
break;
|
||||
+ case BTRFS_FREE_SPACE_OBJECTID:
|
||||
+ printf("FREE_SPACE");
|
||||
+ break;
|
||||
+ case BTRFS_FREE_INO_OBJECTID:
|
||||
+ printf("FREE_INO");
|
||||
+ break;
|
||||
case BTRFS_MULTIPLE_OBJECTIDS:
|
||||
printf("MULTIPLE");
|
||||
break;
|
||||
@@ -425,19 +453,19 @@ static void print_objectid(unsigned long long objectid, u8 type)
|
||||
}
|
||||
/* fall-thru */
|
||||
default:
|
||||
- printf("%llu", objectid);
|
||||
+ printf("%llu", (unsigned long long)objectid);
|
||||
}
|
||||
}
|
||||
|
||||
void btrfs_print_key(struct btrfs_disk_key *disk_key)
|
||||
{
|
||||
- u8 type;
|
||||
+ u64 objectid = btrfs_disk_key_objectid(disk_key);
|
||||
+ u8 type = btrfs_disk_key_type(disk_key);
|
||||
+
|
||||
printf("key (");
|
||||
- type = btrfs_disk_key_type(disk_key);
|
||||
- print_objectid((unsigned long long)btrfs_disk_key_objectid(disk_key),
|
||||
- type);
|
||||
+ print_objectid(objectid, type);
|
||||
printf(" ");
|
||||
- print_key_type(type);
|
||||
+ print_key_type(objectid, type);
|
||||
printf(" %llu)", (unsigned long long)btrfs_disk_key_offset(disk_key));
|
||||
}
|
||||
|
||||
@@ -460,6 +488,7 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
|
||||
struct btrfs_block_group_item bg_item;
|
||||
struct btrfs_dir_log_item *dlog;
|
||||
u32 nr = btrfs_header_nritems(l);
|
||||
+ u64 objectid;
|
||||
u32 type;
|
||||
|
||||
printf("leaf %llu items %d free space %d generation %llu owner %llu\n",
|
||||
@@ -472,12 +501,17 @@ void btrfs_print_leaf(struct btrfs_root *root, struct extent_buffer *l)
|
||||
for (i = 0 ; i < nr ; i++) {
|
||||
item = btrfs_item_nr(l, i);
|
||||
btrfs_item_key(l, &disk_key, i);
|
||||
+ objectid = btrfs_disk_key_objectid(&disk_key);
|
||||
type = btrfs_disk_key_type(&disk_key);
|
||||
printf("\titem %d ", i);
|
||||
btrfs_print_key(&disk_key);
|
||||
printf(" itemoff %d itemsize %d\n",
|
||||
btrfs_item_offset(l, item),
|
||||
btrfs_item_size(l, item));
|
||||
+
|
||||
+ if (type == 0 && objectid == BTRFS_FREE_SPACE_OBJECTID)
|
||||
+ print_free_space_header(l, i);
|
||||
+
|
||||
switch (type) {
|
||||
case BTRFS_INODE_ITEM_KEY:
|
||||
ii = btrfs_item_ptr(l, i, struct btrfs_inode_item);
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
@ -0,0 +1,72 @@
|
||||
From c64c11e0a2918e6319be9337a756979e1f398730 Mon Sep 17 00:00:00 2001
|
||||
From: Ilya Dryomov <idryomov@gmail.com>
|
||||
Date: Tue, 13 Mar 2012 22:15:07 +0200
|
||||
Subject: [PATCH 6/8] Btrfs-progs: allow dup for data chunks in mixed mode
|
||||
|
||||
Before commit a46e7ff2 was merged it was possible to create dup for
|
||||
data+metadata chunks (mixed mode) by giving -m raid1 -d raid1 -M to
|
||||
mkfs. a46e7ff2 purposefully disabled behind the scenes profile
|
||||
upgrading/downgrading, so give users a chance to pick dup explicitly and
|
||||
bail if dup for data is requested in normal mode.
|
||||
|
||||
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
|
||||
---
|
||||
mkfs.c | 16 ++++++++++++----
|
||||
1 files changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/mkfs.c b/mkfs.c
|
||||
index acdb646..cf571c4 100644
|
||||
--- a/mkfs.c
|
||||
+++ b/mkfs.c
|
||||
@@ -258,17 +258,23 @@ static int create_raid_groups(struct btrfs_trans_handle *trans,
|
||||
|
||||
if (metadata_profile & ~allowed) {
|
||||
fprintf(stderr, "unable to create FS with metadata "
|
||||
- "profile %llu (%llu devices)\n", metadata_profile,
|
||||
+ "profile %llu (have %llu devices)\n", metadata_profile,
|
||||
num_devices);
|
||||
exit(1);
|
||||
}
|
||||
if (data_profile & ~allowed) {
|
||||
fprintf(stderr, "unable to create FS with data "
|
||||
- "profile %llu (%llu devices)\n", data_profile,
|
||||
+ "profile %llu (have %llu devices)\n", data_profile,
|
||||
num_devices);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
+ /* allow dup'ed data chunks only in mixed mode */
|
||||
+ if (!mixed && (data_profile & BTRFS_BLOCK_GROUP_DUP)) {
|
||||
+ fprintf(stderr, "dup for data is allowed only in mixed mode\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
if (allowed & metadata_profile) {
|
||||
u64 meta_flags = BTRFS_BLOCK_GROUP_METADATA;
|
||||
|
||||
@@ -329,7 +335,7 @@ static void print_usage(void)
|
||||
fprintf(stderr, "options:\n");
|
||||
fprintf(stderr, "\t -A --alloc-start the offset to start the FS\n");
|
||||
fprintf(stderr, "\t -b --byte-count total number of bytes in the FS\n");
|
||||
- fprintf(stderr, "\t -d --data data profile, raid0, raid1, raid10 or single\n");
|
||||
+ fprintf(stderr, "\t -d --data data profile, raid0, raid1, raid10, dup or single\n");
|
||||
fprintf(stderr, "\t -f --force don't check if a device is already mounted\n");
|
||||
fprintf(stderr, "\t -l --leafsize size of btree leaves\n");
|
||||
fprintf(stderr, "\t -L --label set a label\n");
|
||||
@@ -357,10 +363,12 @@ static u64 parse_profile(char *s)
|
||||
return BTRFS_BLOCK_GROUP_RAID1;
|
||||
} else if (strcmp(s, "raid10") == 0) {
|
||||
return BTRFS_BLOCK_GROUP_RAID10;
|
||||
+ } else if (strcmp(s, "dup") == 0) {
|
||||
+ return BTRFS_BLOCK_GROUP_DUP;
|
||||
} else if (strcmp(s, "single") == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
- fprintf(stderr, "Unknown option %s\n", s);
|
||||
+ fprintf(stderr, "Unknown profile %s\n", s);
|
||||
print_usage();
|
||||
}
|
||||
/* not reached */
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
79
0179-btrfs-progs-mkfs-rename-T-to-K.patch
Normal file
79
0179-btrfs-progs-mkfs-rename-T-to-K.patch
Normal file
@ -0,0 +1,79 @@
|
||||
From b6f17f9e5c87b93cd887088121551839d2f24b35 Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Mon, 26 Mar 2012 14:50:02 +0200
|
||||
Subject: [PATCH 7/8] btrfs-progs: mkfs: rename -T to -K
|
||||
|
||||
Fixup to "mkfs: allow not to trim a device", to match mkfs.xfs option
|
||||
name.
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
man/mkfs.btrfs.8.in | 4 ++--
|
||||
mkfs.c | 8 ++++----
|
||||
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/man/mkfs.btrfs.8.in b/man/mkfs.btrfs.8.in
|
||||
index 307d1fb..71f061d 100644
|
||||
--- a/man/mkfs.btrfs.8.in
|
||||
+++ b/man/mkfs.btrfs.8.in
|
||||
@@ -14,7 +14,7 @@ mkfs.btrfs \- create an btrfs filesystem
|
||||
[ \fB\-n\fP\fI nodesize\fP ]
|
||||
[ \fB\-s\fP\fI sectorsize\fP ]
|
||||
[ \fB\-r\fP\fI rootdir\fP ]
|
||||
-[ \fB\-T\fP ]
|
||||
+[ \fB\-K\fP ]
|
||||
[ \fB\-h\fP ]
|
||||
[ \fB\-V\fP ] \fI device\fP [ \fI device ...\fP ]
|
||||
.SH DESCRIPTION
|
||||
@@ -67,7 +67,7 @@ Specify the sectorsize, the minimum block allocation.
|
||||
\fB\-r\fR, \fB\-\-rootdir \fIrootdir\fR
|
||||
Specify a directory to copy into the newly created fs.
|
||||
.TP
|
||||
-\fB\-T\fR, \fB\-\-nodiscard \fR
|
||||
+\fB\-K\fR, \fB\-\-nodiscard \fR
|
||||
Do not perform whole device TRIM operation by default.
|
||||
.TP
|
||||
\fB\-V\fR, \fB\-\-version\fR
|
||||
diff --git a/mkfs.c b/mkfs.c
|
||||
index cf571c4..d17f71c 100644
|
||||
--- a/mkfs.c
|
||||
+++ b/mkfs.c
|
||||
@@ -344,7 +344,7 @@ static void print_usage(void)
|
||||
fprintf(stderr, "\t -n --nodesize size of btree nodes\n");
|
||||
fprintf(stderr, "\t -s --sectorsize min block allocation\n");
|
||||
fprintf(stderr, "\t -r --rootdir the source directory\n");
|
||||
- fprintf(stderr, "\t -T --nodiscard do not perform whole device TRIM\n");
|
||||
+ fprintf(stderr, "\t -K --nodiscard do not perform whole device TRIM\n");
|
||||
fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
|
||||
exit(1);
|
||||
}
|
||||
@@ -407,7 +407,7 @@ static struct option long_options[] = {
|
||||
{ "version", 0, NULL, 'V' },
|
||||
{ "rootdir", 1, NULL, 'r' },
|
||||
{ "force", 0, NULL, 'f' },
|
||||
- { "nodiscard", 0, NULL, 'T' },
|
||||
+ { "nodiscard", 0, NULL, 'K' },
|
||||
{ 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -1236,7 +1236,7 @@ int main(int ac, char **av)
|
||||
|
||||
while(1) {
|
||||
int c;
|
||||
- c = getopt_long(ac, av, "A:b:l:n:s:m:d:L:r:VMfT", long_options,
|
||||
+ c = getopt_long(ac, av, "A:b:l:n:s:m:d:L:r:VMfK", long_options,
|
||||
&option_index);
|
||||
if (c < 0)
|
||||
break;
|
||||
@@ -1285,7 +1285,7 @@ int main(int ac, char **av)
|
||||
case 'f':
|
||||
force=1;
|
||||
break;
|
||||
- case 'T':
|
||||
+ case 'K':
|
||||
nodiscard=1;
|
||||
break;
|
||||
default:
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
30
0180-btrfs-progs-use-IEEE1541-suffixes-for-sizes.patch
Normal file
30
0180-btrfs-progs-use-IEEE1541-suffixes-for-sizes.patch
Normal file
@ -0,0 +1,30 @@
|
||||
From d37ac57247379f929cd25cc1388c3df8830d704d Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Mon, 26 Mar 2012 14:50:48 +0200
|
||||
Subject: [PATCH 8/8] btrfs-progs: use IEEE1541 suffixes for sizes
|
||||
|
||||
IEEE 1541-2002
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
utils.c | 4 ++--
|
||||
1 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/utils.c b/utils.c
|
||||
index f885307..97e0da7 100644
|
||||
--- a/utils.c
|
||||
+++ b/utils.c
|
||||
@@ -1094,8 +1094,8 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static char *size_strs[] = { "", "KB", "MB", "GB", "TB",
|
||||
- "PB", "EB", "ZB", "YB"};
|
||||
+static char *size_strs[] = { "", "KiB", "MiB", "GiB", "TiB",
|
||||
+ "PiB", "EiB", "ZiB", "YiB"};
|
||||
char *pretty_sizes(u64 size)
|
||||
{
|
||||
int num_divs = 0;
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
152
0181-btrfs-progs-mkfs-allow-not-to-trim-a-device.patch
Normal file
152
0181-btrfs-progs-mkfs-allow-not-to-trim-a-device.patch
Normal file
@ -0,0 +1,152 @@
|
||||
From 251cef9c8992b79d9d80515387cb0c26ab3b154d Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Tue, 31 Jan 2012 15:32:28 +0100
|
||||
Subject: [PATCH] btrfs-progs: mkfs: allow not to trim a device
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
man/mkfs.btrfs.8.in | 4 ++++
|
||||
mkfs.c | 15 +++++++++++----
|
||||
utils.c | 18 +++++++++++++-----
|
||||
utils.h | 2 ++
|
||||
4 files changed, 30 insertions(+), 9 deletions(-)
|
||||
|
||||
Index: btrfs-progs-v0.19-118-gfdb6c04/man/mkfs.btrfs.8.in
|
||||
===================================================================
|
||||
--- btrfs-progs-v0.19-118-gfdb6c04.orig/man/mkfs.btrfs.8.in
|
||||
+++ btrfs-progs-v0.19-118-gfdb6c04/man/mkfs.btrfs.8.in
|
||||
@@ -13,6 +13,7 @@ mkfs.btrfs \- create an btrfs filesystem
|
||||
[ \fB \-M\fP\fI mixed data+metadata\fP ]
|
||||
[ \fB \-n\fP\fI nodesize\fP ]
|
||||
[ \fB \-s\fP\fI sectorsize\fP ]
|
||||
+[ \fB \-T\fP ]
|
||||
[ \fB \-h\fP ]
|
||||
[ \fB \-V\fP ] \fI device\fP [ \fI device ...\fP ]
|
||||
.SH DESCRIPTION
|
||||
@@ -62,6 +63,9 @@ Specify the nodesize. By default the val
|
||||
\fB\-s\fR, \fB\-\-sectorsize \fIsize\fR
|
||||
Specify the sectorsize, the minimum block allocation.
|
||||
.TP
|
||||
+\fB\-T\fR, \fB\-\-nodiscard \fR
|
||||
+Do not perform whole device TRIM operation by default.
|
||||
+.TP
|
||||
\fB\-V\fR, \fB\-\-version\fR
|
||||
Print the \fBmkfs.btrfs\fP version and exit.
|
||||
.SH AVAILABILITY
|
||||
Index: btrfs-progs-v0.19-118-gfdb6c04/mkfs.c
|
||||
===================================================================
|
||||
--- btrfs-progs-v0.19-118-gfdb6c04.orig/mkfs.c
|
||||
+++ btrfs-progs-v0.19-118-gfdb6c04/mkfs.c
|
||||
@@ -311,6 +311,7 @@ static void print_usage(void)
|
||||
fprintf(stderr, "\t -n --nodesize size of btree nodes\n");
|
||||
fprintf(stderr, "\t -s --sectorsize min block allocation\n");
|
||||
fprintf(stderr, "\t -r --rootdir the source directory\n");
|
||||
+ fprintf(stderr, "\t -T --nodiscard do not perform whole device TRIM\n");
|
||||
fprintf(stderr, "%s\n", BTRFS_BUILD_VERSION);
|
||||
exit(1);
|
||||
}
|
||||
@@ -370,6 +371,7 @@ static struct option long_options[] = {
|
||||
{ "version", 0, NULL, 'V' },
|
||||
{ "rootdir", 1, NULL, 'r' },
|
||||
{ "force", 0, NULL, 'f' },
|
||||
+ { "nodiscard", 0, NULL, 'T' },
|
||||
{ 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
@@ -1186,6 +1188,7 @@ int main(int ac, char **av)
|
||||
int mixed = 0;
|
||||
int data_profile_opt = 0;
|
||||
int metadata_profile_opt = 0;
|
||||
+ int nodiscard = 0;
|
||||
|
||||
char *source_dir = NULL;
|
||||
int source_dir_set = 0;
|
||||
@@ -1197,7 +1200,7 @@ int main(int ac, char **av)
|
||||
|
||||
while(1) {
|
||||
int c;
|
||||
- c = getopt_long(ac, av, "A:b:l:n:s:m:d:L:r:VMf", long_options,
|
||||
+ c = getopt_long(ac, av, "A:b:l:n:s:m:d:L:r:VMfT", long_options,
|
||||
&option_index);
|
||||
if (c < 0)
|
||||
break;
|
||||
@@ -1246,6 +1249,9 @@ int main(int ac, char **av)
|
||||
case 'f':
|
||||
force=1;
|
||||
break;
|
||||
+ case 'T':
|
||||
+ nodiscard=1;
|
||||
+ break;
|
||||
default:
|
||||
print_usage();
|
||||
}
|
||||
@@ -1287,7 +1293,8 @@ int main(int ac, char **av)
|
||||
exit(1);
|
||||
}
|
||||
first_file = file;
|
||||
- ret = btrfs_prepare_device(fd, file, zero_end, &dev_block_count, &mixed);
|
||||
+ ret = __btrfs_prepare_device(fd, file, zero_end,
|
||||
+ &dev_block_count, &mixed, nodiscard);
|
||||
if (block_count == 0)
|
||||
block_count = dev_block_count;
|
||||
else if (block_count > dev_block_count) {
|
||||
@@ -1392,8 +1399,8 @@ int main(int ac, char **av)
|
||||
close(fd);
|
||||
continue;
|
||||
}
|
||||
- ret = btrfs_prepare_device(fd, file, zero_end,
|
||||
- &dev_block_count, &mixed);
|
||||
+ ret = __btrfs_prepare_device(fd, file, zero_end,
|
||||
+ &dev_block_count, &mixed, nodiscard);
|
||||
mixed = old_mixed;
|
||||
BUG_ON(ret);
|
||||
|
||||
Index: btrfs-progs-v0.19-118-gfdb6c04/utils.c
|
||||
===================================================================
|
||||
--- btrfs-progs-v0.19-118-gfdb6c04.orig/utils.c
|
||||
+++ btrfs-progs-v0.19-118-gfdb6c04/utils.c
|
||||
@@ -539,6 +539,12 @@ int btrfs_add_to_fsid(struct btrfs_trans
|
||||
int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret,
|
||||
int *mixed)
|
||||
{
|
||||
+ /* discard by default when called from 'device add' */
|
||||
+ return __btrfs_prepare_device(fd, file, zero_end, block_count_ret, mixed, 0);
|
||||
+}
|
||||
+int __btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret,
|
||||
+ int *mixed, int nodiscard)
|
||||
+{
|
||||
u64 block_count;
|
||||
u64 bytenr;
|
||||
struct stat st;
|
||||
@@ -562,11 +568,13 @@ int btrfs_prepare_device(int fd, char *f
|
||||
*mixed = 1;
|
||||
}
|
||||
|
||||
- /*
|
||||
- * We intentionally ignore errors from the discard ioctl. It is
|
||||
- * not necessary for the mkfs functionality but just an optimization.
|
||||
- */
|
||||
- discard_blocks(fd, 0, block_count);
|
||||
+ if (!nodiscard) {
|
||||
+ /*
|
||||
+ * We intentionally ignore errors from the discard ioctl. It is
|
||||
+ * not necessary for the mkfs functionality but just an optimization.
|
||||
+ */
|
||||
+ discard_blocks(fd, 0, block_count);
|
||||
+ }
|
||||
|
||||
ret = zero_dev_start(fd);
|
||||
if (ret) {
|
||||
Index: btrfs-progs-v0.19-118-gfdb6c04/utils.h
|
||||
===================================================================
|
||||
--- btrfs-progs-v0.19-118-gfdb6c04.orig/utils.h
|
||||
+++ btrfs-progs-v0.19-118-gfdb6c04/utils.h
|
||||
@@ -28,6 +28,8 @@ int btrfs_make_root_dir(struct btrfs_tra
|
||||
struct btrfs_root *root, u64 objectid);
|
||||
int btrfs_prepare_device(int fd, char *file, int zero_end,
|
||||
u64 *block_count_ret, int *mixed);
|
||||
+int __btrfs_prepare_device(int fd, char *file, int zero_end,
|
||||
+ u64 *block_count_ret, int *mixed, int nodiscard);
|
||||
int btrfs_add_to_fsid(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root, int fd, char *path,
|
||||
u64 block_count, u32 io_width, u32 io_align,
|
107
0182-btrfs-progs-convert-set-label-or-copy-from-origin.patch
Normal file
107
0182-btrfs-progs-convert-set-label-or-copy-from-origin.patch
Normal file
@ -0,0 +1,107 @@
|
||||
From 9e2b399e046af8a0ec96662b7b849fb7327384cc Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Tue, 31 Jan 2012 14:40:22 +0100
|
||||
Subject: [PATCH] btrfs-progs: convert: set label or copy from origin
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
convert.c | 46 ++++++++++++++++++++++++++++++++++++++--------
|
||||
1 files changed, 38 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/convert.c b/convert.c
|
||||
index 13f3ece..3e74108 100644
|
||||
--- a/convert.c
|
||||
+++ b/convert.c
|
||||
@@ -2332,7 +2332,8 @@ err:
|
||||
return ret;
|
||||
}
|
||||
|
||||
-int do_convert(const char *devname, int datacsum, int packing, int noxattr)
|
||||
+int do_convert(const char *devname, int datacsum, int packing, int noxattr,
|
||||
+ int copylabel, const char *fslabel)
|
||||
{
|
||||
int i, fd, ret;
|
||||
u32 blocksize;
|
||||
@@ -2424,6 +2425,17 @@ int do_convert(const char *devname, int datacsum, int packing, int noxattr)
|
||||
fprintf(stderr, "error during create_ext2_image %d\n", ret);
|
||||
goto fail;
|
||||
}
|
||||
+ memset(root->fs_info->super_copy.label, 0, BTRFS_LABEL_SIZE);
|
||||
+ if (copylabel == 1) {
|
||||
+ strncpy(root->fs_info->super_copy.label,
|
||||
+ ext2_fs->super->s_volume_name, 16);
|
||||
+ fprintf(stderr, "copy label '%s'\n",
|
||||
+ root->fs_info->super_copy.label);
|
||||
+ } else if (copylabel == -1) {
|
||||
+ strncpy(root->fs_info->super_copy.label, fslabel, BTRFS_LABEL_SIZE);
|
||||
+ fprintf(stderr, "set label to '%s'\n", fslabel);
|
||||
+ }
|
||||
+
|
||||
printf("cleaning up system chunk.\n");
|
||||
ret = cleanup_sys_chunk(root, ext2_root);
|
||||
if (ret) {
|
||||
@@ -2812,11 +2824,13 @@ fail:
|
||||
|
||||
static void print_usage(void)
|
||||
{
|
||||
- printf("usage: btrfs-convert [-d] [-i] [-n] [-r] device\n");
|
||||
- printf("\t-d disable data checksum\n");
|
||||
- printf("\t-i ignore xattrs and ACLs\n");
|
||||
- printf("\t-n disable packing of small files\n");
|
||||
- printf("\t-r roll back to ext2fs\n");
|
||||
+ printf("usage: btrfs-convert [-d] [-i] [-n] [-r] [-l label] [-L] device\n");
|
||||
+ printf("\t-d disable data checksum\n");
|
||||
+ printf("\t-i ignore xattrs and ACLs\n");
|
||||
+ printf("\t-n disable packing of small files\n");
|
||||
+ printf("\t-r roll back to ext2fs\n");
|
||||
+ printf("\t-l LABEL set filesystem label\n");
|
||||
+ printf("\t-L use label from converted fs\n");
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -2826,9 +2840,12 @@ int main(int argc, char *argv[])
|
||||
int noxattr = 0;
|
||||
int datacsum = 1;
|
||||
int rollback = 0;
|
||||
+ int copylabel = 0;
|
||||
char *file;
|
||||
+ char *fslabel = NULL;
|
||||
+
|
||||
while(1) {
|
||||
- int c = getopt(argc, argv, "dinr");
|
||||
+ int c = getopt(argc, argv, "dinrl:L");
|
||||
if (c < 0)
|
||||
break;
|
||||
switch(c) {
|
||||
@@ -2844,6 +2861,19 @@ int main(int argc, char *argv[])
|
||||
case 'r':
|
||||
rollback = 1;
|
||||
break;
|
||||
+ case 'l':
|
||||
+ copylabel = -1;
|
||||
+ fslabel = strdup(optarg);
|
||||
+ if (strlen(fslabel) > BTRFS_LABEL_SIZE) {
|
||||
+ fprintf(stderr,
|
||||
+ "warning: label too long, trimmed to %d bytes\n",
|
||||
+ BTRFS_LABEL_SIZE);
|
||||
+ fslabel[BTRFS_LABEL_SIZE]=0;
|
||||
+ }
|
||||
+ break;
|
||||
+ case 'L':
|
||||
+ copylabel = 1;
|
||||
+ break;
|
||||
default:
|
||||
print_usage();
|
||||
return 1;
|
||||
@@ -2864,7 +2894,7 @@ int main(int argc, char *argv[])
|
||||
if (rollback) {
|
||||
ret = do_rollback(file, 0);
|
||||
} else {
|
||||
- ret = do_convert(file, datacsum, packing, noxattr);
|
||||
+ ret = do_convert(file, datacsum, packing, noxattr, copylabel, fslabel);
|
||||
}
|
||||
if (ret)
|
||||
return 1;
|
||||
--
|
||||
1.7.9
|
||||
|
@ -0,0 +1,42 @@
|
||||
From 273488299effe9a9182fffc1a7cd9639b68a0da4 Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Fri, 17 Feb 2012 11:44:03 +0100
|
||||
Subject: [PATCH] btrfs-progs: mkfs: disallow uneven data/metadata blocksize
|
||||
for mixed
|
||||
|
||||
With support for bigger metadata blocks, we must avoid different
|
||||
block size for mixed block groups, this causes corruption
|
||||
(xfstests/083).
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
mkfs.c | 13 +++++++++++++
|
||||
1 files changed, 13 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/mkfs.c b/mkfs.c
|
||||
index e3ced19..e02efcc 100644
|
||||
--- a/mkfs.c
|
||||
+++ b/mkfs.c
|
||||
@@ -1313,6 +1313,19 @@ int main(int ac, char **av)
|
||||
"profiles must be the same\n");
|
||||
exit(1);
|
||||
}
|
||||
+
|
||||
+ if (leafsize != nodesize) {
|
||||
+ fprintf(stderr, "With mixed block groups node and leaf "
|
||||
+ "block sizes must be the same\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
+ if (sectorsize != nodesize) {
|
||||
+ fprintf(stderr, "With mixed block groups data and metadata "
|
||||
+ "block sizes must be the same\n");
|
||||
+ exit(1);
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
blocks[0] = BTRFS_SUPER_INFO_OFFSET;
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
36
0184-btrfs-progs-get-default-man-page.patch
Normal file
36
0184-btrfs-progs-get-default-man-page.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From 68b5d415ff9515863c2080aebfe8d069b00a47fc Mon Sep 17 00:00:00 2001
|
||||
From: Goffredo Baroncelli <kreijack@inwind.it>
|
||||
Date: Mon, 26 Mar 2012 17:41:33 +0200
|
||||
Subject: [PATCH 01/10] btrfs-progs: get-default man page
|
||||
|
||||
Added the man page info for the "btrfs subvolume get-default" command
|
||||
|
||||
Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
|
||||
---
|
||||
btrfs_cmds.c | 10 ++++++++++
|
||||
1 files changed, 10 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/btrfs_cmds.c b/btrfs_cmds.c
|
||||
index 558d40e..26a0700 100644
|
||||
--- a/btrfs_cmds.c
|
||||
+++ b/btrfs_cmds.c
|
||||
@@ -1761,6 +1761,16 @@ int do_change_label(int nargs, char **argv)
|
||||
}
|
||||
|
||||
|
||||
+/**** man: btrfs subvolume get-default
|
||||
+ *
|
||||
+ * \Bbtrfs\b \Bsubvolume get-default\b\I <path>\i
|
||||
+ *
|
||||
+ * Query which subvolume of the filesystem <path> will be mounted
|
||||
+ * as default.
|
||||
+ *
|
||||
+ * Get the \Idefault\i subvolume of the filesystem \I<path>\i.
|
||||
+ ****/
|
||||
+
|
||||
int do_get_default_subvol(int nargs, char **argv)
|
||||
{
|
||||
int fd;
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
51
0185-btrfs-progs-Correct-xstrip-function.patch
Normal file
51
0185-btrfs-progs-Correct-xstrip-function.patch
Normal file
@ -0,0 +1,51 @@
|
||||
From e38f0663be83e68f682919ca4e2d60cf6683b643 Mon Sep 17 00:00:00 2001
|
||||
From: Goffredo Baroncelli <kreijack@inwind.it>
|
||||
Date: Mon, 26 Mar 2012 17:43:26 +0200
|
||||
Subject: [PATCH 02/10] btrfs-progs: Correct xstrip() function
|
||||
|
||||
Signed-off-by: Goffredo Baroncelli <kreijack@inwind.it>
|
||||
---
|
||||
helpextract.c | 9 +++++----
|
||||
1 files changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/helpextract.c b/helpextract.c
|
||||
index 9489ea0..a729074 100644
|
||||
--- a/helpextract.c
|
||||
+++ b/helpextract.c
|
||||
@@ -38,20 +38,21 @@ static char *xstrip(char *s){
|
||||
|
||||
char *last=NULL;
|
||||
char *first;
|
||||
+ char prev;
|
||||
|
||||
while(*s && isspace(*s) ) s++;
|
||||
|
||||
first=s;
|
||||
-
|
||||
+ prev=*s;
|
||||
while(*s){
|
||||
- if(isspace(*s)) last=s;
|
||||
+ if(!isspace(prev) && isspace(*s)) last=s;
|
||||
+ prev=*s;
|
||||
s++;
|
||||
}
|
||||
|
||||
if(last) *last=0;
|
||||
return first;
|
||||
|
||||
-
|
||||
}
|
||||
|
||||
static void addtuple(char *key, char *cmdline, char *short_help,
|
||||
@@ -184,7 +185,7 @@ static int search_in_file(char *nf){
|
||||
return 0;
|
||||
}
|
||||
|
||||
-/* remove all the escape sequence excepet \\ */
|
||||
+/* remove all the escape sequence except \\ */
|
||||
static char * my_escape(char *src, char *filters[] ){
|
||||
|
||||
static char buffer[LINEBUF*5];
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
53
0186-btrfs-progs-document-devid-parameter-for-resize.patch
Normal file
53
0186-btrfs-progs-document-devid-parameter-for-resize.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From a8d78caea3bd1983181806f5110288f23c776005 Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Mon, 26 Mar 2012 18:00:58 +0200
|
||||
Subject: [PATCH 03/10] btrfs-progs: document devid parameter for resize
|
||||
|
||||
Based on patch from Goffredo Baroncelli.
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
btrfs_cmds.c | 15 +++++++++------
|
||||
1 files changed, 9 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/btrfs_cmds.c b/btrfs_cmds.c
|
||||
index 26a0700..0a741f0 100644
|
||||
--- a/btrfs_cmds.c
|
||||
+++ b/btrfs_cmds.c
|
||||
@@ -804,10 +804,9 @@ int do_scan(int argc, char **argv)
|
||||
|
||||
/**** man: btrfs filesystem resize
|
||||
*
|
||||
- * \Bbtrfs\b \Bfilesystem resize\b\I [+/\-]<size>[gkm]|max <path>\i
|
||||
+ * \Bbtrfs\b \Bfilesystem resize\b\I [<devid>:][+/\-]<size>[gkm]|max <path>\i
|
||||
*
|
||||
- * Resize the file system. If 'max' is passed, the filesystem
|
||||
- * will occupe all available space on the device.
|
||||
+ * Resize the file system.
|
||||
*
|
||||
* Resize a filesystem identified by \I<path>\i.
|
||||
* The \I<size>\i parameter specifies the new size of the filesystem.
|
||||
@@ -818,13 +817,17 @@ int do_scan(int argc, char **argv)
|
||||
* the units designators: 'K', 'M', or 'G', kilobytes, megabytes, or gigabytes,
|
||||
* respectively.
|
||||
*
|
||||
- * If 'max' is passed, the filesystem will occupy all available space on the
|
||||
+ * If 'max' is specified, the filesystem will occupy all available space on the
|
||||
* volume(s).
|
||||
*
|
||||
- * The \Bresize\b command \Bdoes not\b manipulate the size of underlying
|
||||
- * partition. If you wish to enlarge/reduce a filesystem, you must make sure
|
||||
+ * The \Bresize\b command \Bdoes not\b manipulate the size of the underlying
|
||||
+ * partition. If you wish to enlarge/reduce a filesystem, you have to make sure
|
||||
* you can expand the partition before enlarging the filesystem and shrink the
|
||||
* partition after reducing the size of the filesystem.
|
||||
+ *
|
||||
+ * When the filesystem consists of multiple devices, it is possible to specify
|
||||
+ * which one should be resized via the <devid> parameter. To know the <devid>
|
||||
+ * of a device use the command \fBbtrfs filesystem show\fR.
|
||||
****/
|
||||
|
||||
int do_resize(int argc, char **argv)
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
41
0187-btrfs-progs-document-csize-in-manpage.patch
Normal file
41
0187-btrfs-progs-document-csize-in-manpage.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From ffa4e18f557d39e5d4b2357a40e073607e0c98a0 Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Mon, 26 Mar 2012 18:14:20 +0200
|
||||
Subject: [PATCH 04/10] btrfs-progs: document csize in manpage
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
btrfs_cmds.c | 17 +++++++++++++++++
|
||||
1 files changed, 17 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/btrfs_cmds.c b/btrfs_cmds.c
|
||||
index 0a741f0..17c3f8e 100644
|
||||
--- a/btrfs_cmds.c
|
||||
+++ b/btrfs_cmds.c
|
||||
@@ -2090,6 +2090,23 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+/**** man: btrfs filesystem csize
|
||||
+ *
|
||||
+ * \Bbtrfs\b \Bfilesystem csize [-s \Istart\i\B] [-e \Iend\i\B] <file>
|
||||
+ *
|
||||
+ * Read regular and compressed size of extents in the range \I[start,end)\i.
|
||||
+ *
|
||||
+ * Read regular and compressed size of extents in the range \I[start,end)\i.
|
||||
+ *
|
||||
+ * \B-s\b\I start\i
|
||||
+ * range start inclusive, accepts K/M/G modifiers
|
||||
+ * \B-e\b\I end\i
|
||||
+ * range end exclusive, accepts K/M/G modifiers
|
||||
+ *
|
||||
+ * No range specified will read the whole file, no end of range reads up to
|
||||
+ * the end of file.
|
||||
+ ****/
|
||||
+
|
||||
int do_compr_size(int argc, char **argv)
|
||||
{
|
||||
int ret;
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
126
0188-btrfs-progs-document-balance-in-manpage.patch
Normal file
126
0188-btrfs-progs-document-balance-in-manpage.patch
Normal file
@ -0,0 +1,126 @@
|
||||
From ba5f32986c342795eb910e8d77b5a5756af049ce Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Mon, 26 Mar 2012 19:25:41 +0200
|
||||
Subject: [PATCH 05/10] btrfs-progs: document balance in manpage
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
btrfs_cmds.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 files changed, 71 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/btrfs_cmds.c b/btrfs_cmds.c
|
||||
index 17c3f8e..a7231d0 100644
|
||||
--- a/btrfs_cmds.c
|
||||
+++ b/btrfs_cmds.c
|
||||
@@ -1350,9 +1350,38 @@ static struct option balance_longopts[] = {
|
||||
{ 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
-/*
|
||||
- * [-d [filters]] [-m [filters]] [-s [filters]] [-vf]
|
||||
- */
|
||||
+/**** man: btrfs filesystem balance start
|
||||
+ *
|
||||
+ * \Bbtrfs\b \Bfilesystem balance start\b \B[-d [filters]] [-m [filters]] [-s [filters]] [-vf]\b \I<path>\i
|
||||
+ *
|
||||
+ * Balance chunks accross the devices on filesystem under \Ipath\i. Control
|
||||
+ * operation by subcommands.
|
||||
+ *
|
||||
+ * \B-d\b apply filters on data block groups
|
||||
+ *
|
||||
+ * \B-m\b apply filters on metadata block groups
|
||||
+ *
|
||||
+ * \B-s\b apply filters on system block groups
|
||||
+ *
|
||||
+ * \B-f\b force operation on system block groups
|
||||
+ *
|
||||
+ * \B-v\b verbose, dupms filters at the end of operation
|
||||
+ *
|
||||
+ * \Ifilters\i may be a comma separated list of the following items, see section \BBALANCE FILTERS\b for more.
|
||||
+ *
|
||||
+ * \Bprofile\b=raid0|raid1|raid10|single|dup specify profiles, multiple allowed, note to escape the '|' from shell
|
||||
+ *
|
||||
+ * \Busage\b=<nnn> process only block groups with usage above \Innn\i percent
|
||||
+ *
|
||||
+ * \Bdevid\b=<devid> process only block groups on device \Idevid\i
|
||||
+ *
|
||||
+ * \Bconvert\b=raid0|raid1|radi10|single|dup convert raid profile to the specified one (only one profile allowed)
|
||||
+ *
|
||||
+ * \Bvrange\b=[start]..[end] virtual block address space subset filter
|
||||
+ *
|
||||
+ * \Bdrange\b=[start]..[end] devid subset filter, it's tied to devid filter: we say balance out range [start..end) on a particular devid.
|
||||
+ ****/
|
||||
+
|
||||
int do_balance(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
@@ -1496,6 +1525,16 @@ int do_balance(int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/**** man: btrfs filesystem balance pause
|
||||
+ *
|
||||
+ * \Bbtrfs\b \Bfilesystem balance pause\b \I<path>\i
|
||||
+ *
|
||||
+ * Pause balance operation at the first possible occasion.
|
||||
+ *
|
||||
+ * Pause balance operation at the first possible occasion. This may block for a
|
||||
+ * few minutes if the balance is in the middle of processing.
|
||||
+ ****/
|
||||
+
|
||||
int do_balance_pause(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
@@ -1522,6 +1561,16 @@ int do_balance_pause(int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/**** man: btrfs filesystem balance cancel
|
||||
+ *
|
||||
+ * \Bbtrfs\b \Bfilesystem balance cancel\b \I<path>\i
|
||||
+ *
|
||||
+ * Cancel balance operation at the first possible occasion.
|
||||
+ *
|
||||
+ * Cancel balance operation at the first possible occasion. This may block for
|
||||
+ * a few minutes if the balance is in the middle of processing.
|
||||
+ ****/
|
||||
+
|
||||
int do_balance_cancel(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
@@ -1548,6 +1597,15 @@ int do_balance_cancel(int argc, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/**** man: btrfs filesystem balance resume
|
||||
+ *
|
||||
+ * \Bbtrfs\b \Bfilesystem balance resume\b \I<path>\i
|
||||
+ *
|
||||
+ * Resume balance operation.
|
||||
+ *
|
||||
+ * Resume balance operation and continue from the last position.
|
||||
+ ****/
|
||||
+
|
||||
int do_balance_resume(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
@@ -1601,6 +1659,16 @@ static struct option balance_progress_longopts[] = {
|
||||
{ 0, 0, 0, 0}
|
||||
};
|
||||
|
||||
+/**** man: btrfs filesystem balance status
|
||||
+ *
|
||||
+ * \Bbtrfs\b \Bfilesystem balance status\b [-v] \I<path>\i
|
||||
+ *
|
||||
+ * Show status of running or paused balance operation.
|
||||
+ *
|
||||
+ * Show status of running or paused balance operation.
|
||||
+ *
|
||||
+ * \B-v\b verbose
|
||||
+ ****/
|
||||
int do_balance_progress(int argc, char **argv)
|
||||
{
|
||||
int fd;
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
26
0189-btrfs-progs-manpage-fix-markup-in-device-scan.patch
Normal file
26
0189-btrfs-progs-manpage-fix-markup-in-device-scan.patch
Normal file
@ -0,0 +1,26 @@
|
||||
From 05b288e9a3ced5f077156726622904081f41388f Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Mon, 26 Mar 2012 23:35:14 +0200
|
||||
Subject: [PATCH 06/10] btrfs-progs: manpage:fix markup in device scan
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
btrfs_cmds.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/btrfs_cmds.c b/btrfs_cmds.c
|
||||
index a7231d0..c2fd09e 100644
|
||||
--- a/btrfs_cmds.c
|
||||
+++ b/btrfs_cmds.c
|
||||
@@ -827,7 +827,7 @@ int do_scan(int argc, char **argv)
|
||||
*
|
||||
* When the filesystem consists of multiple devices, it is possible to specify
|
||||
* which one should be resized via the <devid> parameter. To know the <devid>
|
||||
- * of a device use the command \fBbtrfs filesystem show\fR.
|
||||
+ * of a device use the command \Bbtrfs filesystem show\b.
|
||||
****/
|
||||
|
||||
int do_resize(int argc, char **argv)
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
55
0190-btrfs-progs-document-fi-df.patch
Normal file
55
0190-btrfs-progs-document-fi-df.patch
Normal file
@ -0,0 +1,55 @@
|
||||
From 13a29ecb84a41af67c1d96c2c5f2848738a2f570 Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Tue, 27 Mar 2012 00:02:35 +0200
|
||||
Subject: [PATCH 07/10] btrfs-progs: document fi df
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
btrfs_cmds.c | 31 +++++++++++++++++++++++++++++++
|
||||
1 files changed, 31 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/btrfs_cmds.c b/btrfs_cmds.c
|
||||
index c2fd09e..f7310ee 100644
|
||||
--- a/btrfs_cmds.c
|
||||
+++ b/btrfs_cmds.c
|
||||
@@ -1871,6 +1871,37 @@ int do_get_default_subvol(int nargs, char **argv)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+/**** man: btrfs filesystem df
|
||||
+ *
|
||||
+ * \Bbtrfs\b \Bfilesystem df\b\I <path>\i
|
||||
+ *
|
||||
+ * Print allocated and used data for all block group types.
|
||||
+ *
|
||||
+ * Print allocated and used data for all block group types.
|
||||
+ *
|
||||
+ * Example of filesystem created with default mkfs options:
|
||||
+ *
|
||||
+ * Data, RAID0: total=4.00GiB, used=0.00
|
||||
+ * Data: total=8.00MiB, used=0.00
|
||||
+ * System, RAID1: total=8.00MiB, used=4.00KiB
|
||||
+ * System: total=4.00MiB, used=0.00
|
||||
+ * Metadata, RAID1: total=1.00GiB, used=24.00KiB
|
||||
+ * Metadata: total=8.00MiB, used=0.00
|
||||
+ *
|
||||
+ * Example of filesystem created with \Isingle\i profiles for data and metadata:
|
||||
+ *
|
||||
+ * Data: total=38.99GiB, used=58.89MiB
|
||||
+ * System: total=4.00MiB, used=12.00KiB
|
||||
+ * Metadata: total=1.01GiB, used=2.86MiB
|
||||
+ *
|
||||
+ * \Itotal\i allocated space
|
||||
+ * \t
|
||||
+ * \Iused\i actually used data
|
||||
+ *
|
||||
+ * This information gives better idea of allocated space than the 'df' utility,
|
||||
+ * though it does not actually answer the question of how much free space there is.
|
||||
+ ****/
|
||||
+
|
||||
int do_df_filesystem(int nargs, char **argv)
|
||||
{
|
||||
struct btrfs_ioctl_space_args *sargs;
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
54
0191-btrfs-progs-document-inspect-internal-commands.patch
Normal file
54
0191-btrfs-progs-document-inspect-internal-commands.patch
Normal file
@ -0,0 +1,54 @@
|
||||
From 9219cfd9e5cb86a2123b3159056ad53b6efd578e Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Tue, 27 Mar 2012 00:15:39 +0200
|
||||
Subject: [PATCH 08/10] btrfs-progs: document inspect-internal commands
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
btrfs_cmds.c | 23 +++++++++++++++++++++++
|
||||
1 files changed, 23 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/btrfs_cmds.c b/btrfs_cmds.c
|
||||
index f7310ee..cb6df70 100644
|
||||
--- a/btrfs_cmds.c
|
||||
+++ b/btrfs_cmds.c
|
||||
@@ -2047,6 +2047,17 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+/**** man: btrfs inspect-internal inode-resolve
|
||||
+ *
|
||||
+ * \Bbtrfs\b \Binspect-internal inode-resolve\b \B[-v]\b\I <inode> <path>\i
|
||||
+ *
|
||||
+ * Resolve given inode number to path name.
|
||||
+ *
|
||||
+ * Resolve given inode number to path name. This operation does not need to
|
||||
+ * traverse the whole filesystem, but effectively uses internal
|
||||
+ * structures.
|
||||
+ ****/
|
||||
+
|
||||
int do_ino_to_path(int nargs, char **argv)
|
||||
{
|
||||
int fd;
|
||||
@@ -2081,6 +2092,18 @@ int do_ino_to_path(int nargs, char **argv)
|
||||
argv[optind+1]);
|
||||
}
|
||||
|
||||
+/**** man: btrfs inspect-internal logical-resolve
|
||||
+ *
|
||||
+ * \Bbtrfs\b \Binspect-internal logical-resolve\b \B[-v] [-P]\b\I <logical> <path>\i
|
||||
+ *
|
||||
+ * Resolve given logical block number to path name or inode number.
|
||||
+ *
|
||||
+ * Resolve given logical block number to path name or inode number. Can be used
|
||||
+ * in connection with scrub reports.
|
||||
+ *
|
||||
+ * \I-P\i print paths instead of inode numbers
|
||||
+ ****/
|
||||
+
|
||||
int do_logical_to_ino(int nargs, char **argv)
|
||||
{
|
||||
int ret;
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
104
0192-btrfs-progs-add-man-page-for-btrfs-convert.patch
Normal file
104
0192-btrfs-progs-add-man-page-for-btrfs-convert.patch
Normal file
@ -0,0 +1,104 @@
|
||||
From 2c19dc5e7bd5fe9a2838ec852128f64a5be54c4c Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Mon, 26 Mar 2012 15:39:08 +0200
|
||||
Subject: [PATCH 09/10] btrfs-progs: add man page for btrfs-convert
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
man/Makefile | 5 +++-
|
||||
man/btrfs-convert.8.in | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 64 insertions(+), 1 deletions(-)
|
||||
create mode 100644 man/btrfs-convert.8.in
|
||||
|
||||
diff --git a/man/Makefile b/man/Makefile
|
||||
index 4a90b75..f28eec7 100644
|
||||
--- a/man/Makefile
|
||||
+++ b/man/Makefile
|
||||
@@ -7,7 +7,7 @@ mandir = $(prefix)/man
|
||||
man8dir = $(mandir)/man8
|
||||
|
||||
MANPAGES = mkfs.btrfs.8.gz btrfsctl.8.gz btrfsck.8.gz btrfs-image.8.gz \
|
||||
- btrfs-show.8.gz btrfs.8.gz
|
||||
+ btrfs-show.8.gz btrfs.8.gz btrfs-convert.8.gz
|
||||
|
||||
all: $(MANPAGES)
|
||||
|
||||
@@ -29,6 +29,9 @@ btrfs-image.8.gz: btrfs-image.8.in
|
||||
btrfs-show.8.gz: btrfs-show.8.in
|
||||
$(GZIP) -n -c btrfs-show.8.in > btrfs-show.8.gz
|
||||
|
||||
+btrfs-convert.8.gz: btrfs-convert.8.in
|
||||
+ $(GZIP) -n -c btrfs-convert.8.in > btrfs-convert.8.gz
|
||||
+
|
||||
clean :
|
||||
rm -f $(MANPAGES)
|
||||
|
||||
diff --git a/man/btrfs-convert.8.in b/man/btrfs-convert.8.in
|
||||
new file mode 100644
|
||||
index 0000000..4057419
|
||||
--- /dev/null
|
||||
+++ b/man/btrfs-convert.8.in
|
||||
@@ -0,0 +1,60 @@
|
||||
+.TH BTRFS-CONVERT 8
|
||||
+.SH NAME
|
||||
+btrfs-convert \- convert ext2/ext3/ext4 filesystem image to btrfs in-place
|
||||
+.SH SYNOPSIS
|
||||
+.B btrfs-convert \fB[\-dinL]\fP \fB[\-r]\fP \fB[\-l\fP \fILABEL\fP\fB]\fP \fIdevice\fP
|
||||
+.SH DESCRIPTION
|
||||
+.B btrfs-convert
|
||||
+is used to convert a ext2/ext3/ext4 filesystem image to a btrfs one. This is
|
||||
+performed on an unmounted image. The conversion is done in-place and it's
|
||||
+possible to do a rollback to original fs. The original filesystem image is
|
||||
+accessible as a subvolume named \fIext2\_subvol\fP.
|
||||
+
|
||||
+The success of the operation depends on amount of free space in the original
|
||||
+filesystem, as btrfs uses this space to store it's own metadata and just adds
|
||||
+pointers to the data blocks.
|
||||
+
|
||||
+Duration of the operation depends on fragmentation and allocated space on the
|
||||
+orignal filesystem, it may take seveal hours for a terabyte-sized filesystem.
|
||||
+
|
||||
+If the operation does not finish succesfully, the image is recognized as the
|
||||
+original fileystem.
|
||||
+
|
||||
+.SH OPTIONS
|
||||
+.TP
|
||||
+\fB\-d\fP
|
||||
+Disable data checksumming. This may speed up the convert operation.
|
||||
+.TP
|
||||
+\fB\-i\fP
|
||||
+Do not convert ACLs.
|
||||
+.TP
|
||||
+\fB\-n\fP
|
||||
+Disable packing of small files.
|
||||
+.TP
|
||||
+\fB\-l\fR \fILABEL\fP
|
||||
+Set the label of btrfs filesystem to \fILABEL\fP.
|
||||
+.TP
|
||||
+\fB\-L\fP
|
||||
+Copy label from the original filesystem to btrfs.
|
||||
+.TP
|
||||
+\fB\-r\fP
|
||||
+Try rollback to the original filesystem. Beware that this may not always
|
||||
+succeed if the btrfs filesystem has been changed in a way that prevents this.
|
||||
+
|
||||
+.SH CAVEATS
|
||||
+The resulting filesystem will inherit the fragmentation and it's possible to
|
||||
+run whole filesystem defragmentation and then balance.
|
||||
+
|
||||
+The raid profile of both data and metada will be \fIsingle\fP, this is not the
|
||||
+same as default mkfs will create. Use balance with convert filter to change
|
||||
+raid profile you want.
|
||||
+
|
||||
+Security labels or quotas are not transferred to the new filesystem.
|
||||
+
|
||||
+Block sizes must be at least of btrfs supported size (currently 4KB on x86_64).
|
||||
+
|
||||
+.SH AVAILABILITY
|
||||
+.B btrfs-convert
|
||||
+is part of btrfs-progs.
|
||||
+.SH SEE ALSO
|
||||
+.BR mkfs.btrfs (8)
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
28
0193-btrfs-progs-tweak-order-of-devices-in-fi-show.patch
Normal file
28
0193-btrfs-progs-tweak-order-of-devices-in-fi-show.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From e2a577cb8f553a1cc74f949b0a798aa5f07d6302 Mon Sep 17 00:00:00 2001
|
||||
From: David Sterba <dsterba@suse.cz>
|
||||
Date: Tue, 27 Mar 2012 00:51:11 +0200
|
||||
Subject: [PATCH 10/10] btrfs-progs: tweak order of devices in fi show
|
||||
|
||||
Devids are printed in descending order, change it to ascending.
|
||||
|
||||
Signed-off-by: David Sterba <dsterba@suse.cz>
|
||||
---
|
||||
btrfs_cmds.c | 2 +-
|
||||
1 files changed, 1 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/btrfs_cmds.c b/btrfs_cmds.c
|
||||
index cb6df70..82fb61f 100644
|
||||
--- a/btrfs_cmds.c
|
||||
+++ b/btrfs_cmds.c
|
||||
@@ -901,7 +901,7 @@ static void print_one_uuid(struct btrfs_fs_devices *fs_devices)
|
||||
|
||||
free(super_bytes_used);
|
||||
|
||||
- list_for_each(cur, &fs_devices->devices) {
|
||||
+ list_for_each_prev(cur, &fs_devices->devices) {
|
||||
char *total_bytes;
|
||||
char *bytes_used;
|
||||
device = list_entry(cur, struct btrfs_device, dev_list);
|
||||
--
|
||||
1.7.6.233.gd79bc
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash -e
|
||||
#%stage: filesystem
|
||||
#%if: "$rootfstype" = "btrfs"
|
||||
#%programs: /sbin/btrfs /sbin/btrfs-zero-log /sbin/btrfs-convert /sbin/btrfs-select-super /sbin/btrfs-image /sbin/btrfstune /sbin/btrfs-restore /sbin/btrfs-find-root /sbin/btrfsck /sbin/mkfs.btrfs /sbin/btrfs-dump-super
|
||||
#%if: -x /usr/sbin/btrfs
|
||||
#%programs: /sbin/btrfs /sbin/btrfs-zero-log /sbin/btrfs-convert /sbin/btrfs-select-super /sbin/btrfs-image /sbin/btrfstune /sbin/btrfs-restore /sbin/btrfs-find-root /sbin/btrfsck /sbin/mkfs.btrfs /sbin/btrfs-dump-super /sbin/btrfs-debug-tree
|
||||
|
||||
modprobe btrfs
|
||||
|
||||
|
@ -32,11 +32,9 @@ if(!-b $dev) {
|
||||
print("Not a block device: $dev\n");
|
||||
$size=(stat($dev))[7];
|
||||
} else {
|
||||
$size=`blkdev --getsize64 "$dev"`;
|
||||
$size=`blockdev --getsize64 "$dev"`;
|
||||
}
|
||||
sysopen(F, $dev, O_EXCL | O_RDWR) or die("Cannot open $dev exclusively: $!");
|
||||
sysseek(F, 0, 2);
|
||||
$size=tell(F);
|
||||
print("Device size: $size\n") if($dbg);
|
||||
for(my $i=0;$i<6;$i++) {
|
||||
my $off=btrfs_sb_offset($i);
|
||||
@ -67,4 +65,8 @@ for(my $i=0;$i<6;$i++) {
|
||||
}
|
||||
close(F);
|
||||
print("Syncing dev\n");
|
||||
system("fsync \'$dev\'");
|
||||
if (!-b $dev) {
|
||||
system("fsync \'$dev\'");
|
||||
} else {
|
||||
system("blockdev --flushbufs \'$dev\'");
|
||||
}
|
||||
|
130
btrfs-man-update
130
btrfs-man-update
@ -1,130 +0,0 @@
|
||||
Index: btrfs-progs-v0.19-118-gfdb6c04/man/btrfs.8.in
|
||||
===================================================================
|
||||
--- btrfs-progs-v0.19-118-gfdb6c04.orig/man/btrfs.8.in
|
||||
+++ btrfs-progs-v0.19-118-gfdb6c04/man/btrfs.8.in
|
||||
@@ -29,15 +29,36 @@ btrfs \- control a btrfs filesystem
|
||||
\fB\fBbtrfs\fP \fBfilesystem sync\fP\fI <path> \fP
|
||||
\fP
|
||||
.PP
|
||||
-\fB\fBbtrfs\fP \fBscrub cancel\fP {\fI<path>\fP|\fI<device>\fP}
|
||||
+\fB\fBbtrfs\fP \fBfilesystem df\fP\fI <path> \fP
|
||||
\fP
|
||||
.PP
|
||||
-\fB\fBbtrfs\fP \fBscrub resume\fP [-Bdqru] {\fI<path>\fP|\fI<device>\fP}
|
||||
+\fB\fBbtrfs\fP \fBfilesystem balance start [-d [filters]] [-m [filters]] [-s [filters]] [-vf]\fP\fI <path> \fP
|
||||
+\fP
|
||||
+.PP
|
||||
+\fB\fBbtrfs\fP \fBfilesystem balance pause\fP\fI <path> \fP
|
||||
+\fP
|
||||
+.PP
|
||||
+\fB\fBbtrfs\fP \fBfilesystem balance cancel\fP\fI <path> \fP
|
||||
+\fP
|
||||
+.PP
|
||||
+\fB\fBbtrfs\fP \fBfilesystem balance resume\fP\fI <path> \fP
|
||||
+\fP
|
||||
+.PP
|
||||
+\fB\fBbtrfs\fP \fBfilesystem balance status [-v]\fP\fI <path> \fP
|
||||
+\fP
|
||||
+.PP
|
||||
+\fB\fBbtrfs\fP \fBfilesystem csize [-s start] [-e end]\fP\fI <file> \fP
|
||||
\fP
|
||||
.PP
|
||||
\fB\fBbtrfs\fP \fBscrub start\fP [-Bdqru] {\fI<path>\fP|\fI<device>\fP}
|
||||
\fP
|
||||
.PP
|
||||
+\fB\fBbtrfs\fP \fBscrub cancel\fP {\fI<path>\fP|\fI<device>\fP}
|
||||
+\fP
|
||||
+.PP
|
||||
+\fB\fBbtrfs\fP \fBscrub resume\fP [-Bdqru] {\fI<path>\fP|\fI<device>\fP}
|
||||
+\fP
|
||||
+.PP
|
||||
\fB\fBbtrfs\fP \fBscrub status\fP [-d] {\fI<path>\fP|\fI<device>\fP}
|
||||
\fP
|
||||
.PP
|
||||
@@ -56,9 +77,18 @@ btrfs \- control a btrfs filesystem
|
||||
\fB\fBbtrfs\fP \fBsubvolume set-default\fP\fI <id> <path>\fP
|
||||
\fP
|
||||
.PP
|
||||
+\fB\fBbtrfs\fP \fBsubvolume get-default\fP\fI <path>\fP
|
||||
+\fP
|
||||
+.PP
|
||||
\fB\fBbtrfs\fP \fBsubvolume snapshot\fP\fI [-r] <source> [<dest>/]<name>\fP
|
||||
\fP
|
||||
.PP
|
||||
+\fB\fBbtrfs\fP \fBinspect-internal inode-resolve [-v] <inode> \fP\fI<path>\fP
|
||||
+\fP
|
||||
+.PP
|
||||
+\fB\fBbtrfs\fP \fBinspect-internal logical-resolve [-v] [-P] <logical> \fP\fI<path>\fP
|
||||
+\fP
|
||||
+.PP
|
||||
.SH DESCRIPTION
|
||||
\fBbtrfs\fP is used to control the filesystem and the files and directories
|
||||
stored. It is the tool to create or destroy a snapshot or a subvolume for
|
||||
@@ -171,24 +201,26 @@ otherwise the devices list is extracted
|
||||
Force a sync for the filesystem identified by \fI<path>\fP.
|
||||
|
||||
.TP
|
||||
-\fBbtrfs\fP \fBscrub cancel\fP {\fI<path>\fP|\fI<device>\fP}
|
||||
-If a scrub is running on the filesystem identified by \fI<path>\fP, cancel it.
|
||||
-Progress is saved in the scrub progress file and scrubbing can be resumed later
|
||||
-using the \fBscrub resume\fP command.
|
||||
-If a \fI<device>\fP is given, the corresponding filesystem is found and
|
||||
-\fBscrub cancel\fP behaves as if it was called on that filesystem.
|
||||
+\fBbtrfs\fP \fBfilesystem df\fP\fI <path> \fP
|
||||
+Show space usage information for the filesystem identified by \fI<path>\fP.
|
||||
|
||||
.TP
|
||||
-\fBbtrfs\fP \fBscrub resume\fP [-Bdqru] {\fI<path>\fP|\fI<device>\fP}
|
||||
-Resume a canceled or interrupted scrub cycle on the filesystem identified by
|
||||
-\fI<path>\fP or on a given \fI<device>\fP. Does not start a new scrub if the
|
||||
-last scrub finished successfully.
|
||||
-.RS
|
||||
+\fBbtrfs\fP \fBfilesystem balance\fP\fI <path> \fP
|
||||
+
|
||||
+Balance chunks across the devices, control by subcommands \fIstart\fP,
|
||||
+\fIpause\fP, \fIcancel\fP, \fIresume\fP and read \fIstatus\fP. See section
|
||||
+BALANCE FILTERS for more details.
|
||||
|
||||
-\fIOptions\fP
|
||||
.TP
|
||||
-see \fBscrub start\fP.
|
||||
-.RE
|
||||
+\fB\fBbtrfs\fP \fBfilesystem csize [-s start] [-e end]\fP\fI <file> \fP
|
||||
+Read regular and compressed size of extents in the range \fI[start,end)\fP.
|
||||
+
|
||||
+\fB-s start\fP
|
||||
+range start inclusive, accepts K/M/G modifiers
|
||||
+\fB-e end\fP
|
||||
+range end exclusive, accepts K/M/G modifiers
|
||||
+
|
||||
+No range reads whole file, no end of range reads up to the end of file.
|
||||
|
||||
.TP
|
||||
\fBbtrfs\fP \fBscrub start\fP [-Bdqru] {\fI<path>\fP|\fI<device>\fP}
|
||||
@@ -213,6 +245,26 @@ Scrub unused space as well. (NOT IMPLEME
|
||||
.RE
|
||||
|
||||
.TP
|
||||
+\fBbtrfs\fP \fBscrub cancel\fP {\fI<path>\fP|\fI<device>\fP}
|
||||
+If a scrub is running on the filesystem identified by \fI<path>\fP, cancel it.
|
||||
+Progress is saved in the scrub progress file and scrubbing can be resumed later
|
||||
+using the \fBscrub resume\fP command.
|
||||
+If a \fI<device>\fP is given, the corresponding filesystem is found and
|
||||
+\fBscrub cancel\fP behaves as if it was called on that filesystem.
|
||||
+
|
||||
+.TP
|
||||
+\fBbtrfs\fP \fBscrub resume\fP [-Bdqru] {\fI<path>\fP|\fI<device>\fP}
|
||||
+Resume a canceled or interrupted scrub cycle on the filesystem identified by
|
||||
+\fI<path>\fP or on a given \fI<device>\fP. Does not start a new scrub if the
|
||||
+last scrub finished successfully.
|
||||
+.RS
|
||||
+
|
||||
+\fIOptions\fP
|
||||
+.TP
|
||||
+see \fBscrub start\fP.
|
||||
+.RE
|
||||
+
|
||||
+.TP
|
||||
\fBbtrfs\fP \fBscrub status\fP [-d] {\fI<path>\fP|\fI<device>\fP}
|
||||
Show status of a running scrub for the filesystem identified by \fI<path>\fP or
|
||||
for the specified \fI<device>\fP.
|
@ -1,3 +1,13 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 6 13:27:48 CEST 2012 - dsterba@suse.cz
|
||||
|
||||
- add btrfs-debug-tree to initrd
|
||||
- adjust fs size to correct size (bnc#744593)
|
||||
- man page documentation updates
|
||||
- do not package obsolete utilities
|
||||
- mkfs: store correct size of device in superblock (bnc#730103)
|
||||
- updated restriper/balance commands to match kernel version
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Mar 9 16:26:20 UTC 2012 - rschweikert@suse.com
|
||||
|
||||
@ -12,7 +22,7 @@ Mon Mar 5 13:06:43 CET 2012 - dsterba@suse.cz
|
||||
- fix block group accounting
|
||||
- reset csums for rescue nodatasum mount
|
||||
- prune corrupt extent allocation tree blocks
|
||||
- device scanning fixes for dm and multipath
|
||||
- device scanning fixes for dm and multipath (bnc#749540)
|
||||
- initrd support: move btrfs device scan after block device setup
|
||||
- documentation updates
|
||||
- add csize for file commpressed size
|
||||
|
@ -79,6 +79,8 @@ Patch144: 0144-Btrfs-progs-print-the-objectid-of-the-root-we-find-w.patch
|
||||
Patch145: 0145-Btrfs-progs-make-specifying-root-objectid-work-if-th.patch
|
||||
Patch146: 0146-Btrfs-progs-don-t-free-the-existing-node.patch
|
||||
Patch147: 0147-mkfs-Handle-creation-of-filesystem-larger-than-the-f.patch
|
||||
Patch181: 0181-btrfs-progs-mkfs-allow-not-to-trim-a-device.patch
|
||||
Patch182: 0182-btrfs-progs-convert-set-label-or-copy-from-origin.patch
|
||||
Patch150: 0150-btrfs-progs-removed-extraneous-whitespace-from-mkfs-.patch
|
||||
Patch151: 0151-btrfs-progs-document-rootdir-mkfs-switch.patch
|
||||
Patch152: 0152-Add-open_ctree_fs_info-for-partial-FS-opens.patch
|
||||
@ -102,6 +104,25 @@ Patch169: 0169-btrfsck-add-early-code-to-handle-corrupted-block-gro.patch
|
||||
Patch170: 0170-Btrfs-progs-btrfs-map-logical-Fix-typo-in-usage.patch
|
||||
Patch171: 0171-Btrfs-progs-btrfs-corrupt-block-fix-the-wrong-usage.patch
|
||||
Patch172: 0172-Btrfs-progs-fix-btrfsck-s-snapshot-wrong-unresolved-.patch
|
||||
Patch173: 0173-btrfs-progs-adjust-size-of-filesystem-if-blockdevice.patch
|
||||
Patch174: 0174-Btrfs-progs-nuke-redundant-zeroing-in-__list_subvol_.patch
|
||||
Patch175: 0175-Btrfs-progs-refactor-resolve_root-function-a-bit.patch
|
||||
Patch176: 0176-Btrfs-progs-bring-subvol-get-default-back-in.patch
|
||||
Patch177: 0177-Btrfs-progs-make-print-tree.c-aware-of-free-space-ca.patch
|
||||
Patch178: 0178-Btrfs-progs-allow-dup-for-data-chunks-in-mixed-mode.patch
|
||||
Patch179: 0179-btrfs-progs-mkfs-rename-T-to-K.patch
|
||||
Patch180: 0180-btrfs-progs-use-IEEE1541-suffixes-for-sizes.patch
|
||||
Patch183: 0183-btrfs-progs-mkfs-disallow-uneven-data-metadata-block.patch
|
||||
Patch184: 0184-btrfs-progs-get-default-man-page.patch
|
||||
Patch185: 0185-btrfs-progs-Correct-xstrip-function.patch
|
||||
Patch186: 0186-btrfs-progs-document-devid-parameter-for-resize.patch
|
||||
Patch187: 0187-btrfs-progs-document-csize-in-manpage.patch
|
||||
Patch188: 0188-btrfs-progs-document-balance-in-manpage.patch
|
||||
Patch189: 0189-btrfs-progs-manpage-fix-markup-in-device-scan.patch
|
||||
Patch190: 0190-btrfs-progs-document-fi-df.patch
|
||||
Patch191: 0191-btrfs-progs-document-inspect-internal-commands.patch
|
||||
Patch192: 0192-btrfs-progs-add-man-page-for-btrfs-convert.patch
|
||||
Patch193: 0193-btrfs-progs-tweak-order-of-devices-in-fi-show.patch
|
||||
|
||||
# other fixes
|
||||
Patch135: 0135-Btrfs-progs-fix-compiler-warning-of-extent-tree.c.patch
|
||||
@ -112,7 +133,6 @@ Patch138: 0138-Btrfs-progs-bugfix-for-scrubbing-single-devices.patch
|
||||
#
|
||||
Patch250: btrfs-progs-fix-open_ctree_usage_segfaults.patch
|
||||
Patch251: btrfs-mkfs-update-disclaimer.patch
|
||||
Source252: btrfs-man-update
|
||||
Patch253: btrfs-reorder-commands-help
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@ -176,6 +196,8 @@ Utilities needed to create and maintain btrfs file systems under Linux.
|
||||
%patch145 -p1
|
||||
%patch146 -p1
|
||||
%patch147 -p1
|
||||
%patch181 -p1
|
||||
%patch182 -p1
|
||||
%patch150 -p1
|
||||
%patch151 -p1
|
||||
# other fixes
|
||||
@ -204,6 +226,25 @@ Utilities needed to create and maintain btrfs file systems under Linux.
|
||||
%patch170 -p1
|
||||
%patch171 -p1
|
||||
%patch172 -p1
|
||||
%patch173 -p1
|
||||
%patch174 -p1
|
||||
%patch175 -p1
|
||||
%patch176 -p1
|
||||
%patch177 -p1
|
||||
%patch178 -p1
|
||||
%patch179 -p1
|
||||
%patch180 -p1
|
||||
%patch183 -p1
|
||||
%patch184 -p1
|
||||
%patch185 -p1
|
||||
%patch186 -p1
|
||||
%patch187 -p1
|
||||
%patch188 -p1
|
||||
%patch189 -p1
|
||||
%patch190 -p1
|
||||
%patch191 -p1
|
||||
%patch192 -p1
|
||||
%patch193 -p1
|
||||
%patch250 -p1
|
||||
%patch251 -p1
|
||||
#%patch252 -p1
|
||||
@ -214,16 +255,17 @@ make %{?_smp_mflags} CFLAGS="%{optflags}" all btrfs-convert \
|
||||
btrfs-zero-log btrfs-select-super btrfs-image btrfstune \
|
||||
btrfs-find-root btrfs-restore btrfs-dump-super
|
||||
|
||||
patch -p1 < %{S:252}
|
||||
|
||||
%install
|
||||
make install DESTDIR=${RPM_BUILD_ROOT} prefix=%{_prefix} bindir=%{_sbindir} mandir=%{_mandir}
|
||||
install -m 0755 -d ${RPM_BUILD_ROOT}/%{_sbindir}
|
||||
install -m 0755 -d ${RPM_BUILD_ROOT}/%{_bindir}
|
||||
# add btrfs- prefix to generic names
|
||||
# move some utilities out of /usr/sbin
|
||||
mv ${RPM_BUILD_ROOT}/%{_sbindir}/{btrfs-show,btrfs-vol,btrfsctl} ${RPM_BUILD_ROOT}/%{_bindir}
|
||||
mv ${RPM_BUILD_ROOT}/%{_sbindir}/{btrfs-map-logical,btrfs-debug-tree} ${RPM_BUILD_ROOT}/%{_bindir}
|
||||
mv ${RPM_BUILD_ROOT}/%{_sbindir}/btrfs-map-logical ${RPM_BUILD_ROOT}/%{_bindir}
|
||||
# remove obsolete utilites
|
||||
rm ${RPM_BUILD_ROOT}/%{_sbindir}/{btrfs-show,btrfs-vol,btrfsctl}
|
||||
rm ${RPM_BUILD_ROOT}/%{_mandir}/man8/btrfs-show.*
|
||||
rm ${RPM_BUILD_ROOT}/%{_mandir}/man8/btrfsctl.*
|
||||
# mkinitrd rescue utilities
|
||||
install -m 0755 btrfs-zero-log ${RPM_BUILD_ROOT}/%{_sbindir}
|
||||
install -m 0755 btrfs-select-super ${RPM_BUILD_ROOT}/%{_sbindir}
|
||||
@ -244,6 +286,7 @@ ln -s %{_sbindir}/btrfsck ${RPM_BUILD_ROOT}/sbin
|
||||
ln -s %{_sbindir}/btrfs-restore ${RPM_BUILD_ROOT}/sbin
|
||||
ln -s %{_sbindir}/btrfs-find-root ${RPM_BUILD_ROOT}/sbin
|
||||
ln -s %{_sbindir}/btrfs-dump-super ${RPM_BUILD_ROOT}/sbin
|
||||
ln -s %{_sbindir}/btrfs-debug-tree ${RPM_BUILD_ROOT}/sbin
|
||||
ln -s %{_sbindir}/mkfs.btrfs ${RPM_BUILD_ROOT}/sbin
|
||||
#EndUsrMerge
|
||||
# command line options are not compatible (bnc#599224)
|
||||
@ -272,6 +315,7 @@ install -m 0755 %{S:2} ${RPM_BUILD_ROOT}/usr/sbin/
|
||||
/sbin/btrfs-find-root
|
||||
/sbin/btrfs-dump-super
|
||||
/sbin/mkfs.btrfs
|
||||
/sbin/btrfs-debug-tree
|
||||
#EndUsrMerge
|
||||
%{_sbindir}/btrfs
|
||||
%{_sbindir}/btrfs-zero-log
|
||||
@ -285,20 +329,15 @@ install -m 0755 %{S:2} ${RPM_BUILD_ROOT}/usr/sbin/
|
||||
%{_sbindir}/btrfs-dump-super
|
||||
%{_sbindir}/fsck.btrfs
|
||||
%{_sbindir}/mkfs.btrfs
|
||||
%{_sbindir}/btrfs-debug-tree
|
||||
/usr/sbin/btrfs-dev-clear-sb
|
||||
/lib/mkinitrd/scripts/boot-btrfs.sh
|
||||
# other
|
||||
/usr/bin/btrfs-map-logical
|
||||
/usr/bin/btrfs-debug-tree
|
||||
# obsolete
|
||||
/usr/bin/btrfs-show
|
||||
/usr/bin/btrfs-vol
|
||||
/usr/bin/btrfsctl
|
||||
%_mandir/man8/btrfs-image.8.gz
|
||||
%_mandir/man8/btrfs-show.8.gz
|
||||
%_mandir/man8/btrfsck.8.gz
|
||||
%_mandir/man8/btrfsctl.8.gz
|
||||
%_mandir/man8/mkfs.btrfs.8.gz
|
||||
%_mandir/man8/btrfs.8.gz
|
||||
%_mandir/man8/btrfs-convert.8.gz
|
||||
|
||||
%changelog
|
||||
|
@ -7,7 +7,7 @@ Index: btrfs-progs-v0.19-116-g13eced9/version.sh
|
||||
# Released under the GNU GPLv2
|
||||
|
||||
-v="Btrfs v0.19"
|
||||
+v="v0.19+"
|
||||
+v="v0.19+20120406"
|
||||
|
||||
which git &> /dev/null
|
||||
if [ $? == 0 -a -d .git ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user