On Sat, Feb 21, 2015 at 08:23:20PM +0800, Chen Hanxiao wrote:
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
daemon/btrfs.c | 24 ++++++++++++++++++++++++
generator/actions.ml | 15 +++++++++++++++
src/MAX_PROC_NR | 2 +-
3 files changed, 40 insertions(+), 1 deletion(-)
diff --git a/daemon/btrfs.c b/daemon/btrfs.c
index a129e2e..ea2f1f1 100644
--- a/daemon/btrfs.c
+++ b/daemon/btrfs.c
@@ -2141,3 +2141,27 @@ do_btrfstune_S_disable (const char *device)
return 0;
}
+
+int
+do_btrfstune_r (const char *device)
+{
+ const size_t MAX_ARGS = 64;
+ const char *argv[MAX_ARGS];
+ size_t i = 0;
+ CLEANUP_FREE char *err = NULL;
+ CLEANUP_FREE char *out = NULL;
+ int r;
+
+ ADD_ARG (argv, i, str_btrfstune);
+ ADD_ARG (argv, i, "-r");
+ ADD_ARG (argv, i, device);
+ ADD_ARG (argv, i, NULL);
+
+ r = commandv (&out, &err, argv);
+ if (r == -1) {
+ reply_with_error ("%s: %s", device, err);
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/generator/actions.ml b/generator/actions.ml
index 3c906a4..661ba9a 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -12565,6 +12565,21 @@ so that you can use it tto build other filesystems." };
Warning: This is dangerous, clearing the seeding flag
may cause the derived device not to be mountable!" };
+ { defaults with
+ name = "btrfstune_r";
+ style = RErr, [Device "device"], [];
+ proc_nr = Some 456;
+ optional = Some "btrfs"; camel_name = "BTRFSTuneR";
+ tests = [
+ InitPartition, Always, TestRun (
+ [["mkfs_btrfs"; "/dev/sda1"; ""; "";
"NOARG"; ""; "NOARG"; "NOARG"; "";
""];
+ ["btrfstune_r"; "/dev/sda1"]]), []
+ ];
+
+ shortdesc = "enable extended inode refs";
+ longdesc = "\
+ This will Enable extended inode refs." };
^^^^
Some extra spaces here.
Is it better to call this something like btrfstune_enable_extended_inode_refs?
(Wow, too long :-!)
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW