summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--daemon/ext2.c21
-rw-r--r--generator/generator_actions.ml13
-rw-r--r--src/MAX_PROC_NR2
3 files changed, 35 insertions, 1 deletions
diff --git a/daemon/ext2.c b/daemon/ext2.c
index 725352e3..85ce3165 100644
--- a/daemon/ext2.c
+++ b/daemon/ext2.c
@@ -266,6 +266,27 @@ do_resize2fs_size (const char *device, int64_t size)
}
int
+do_resize2fs_M (const char *device)
+{
+ char *err;
+ int r;
+
+ char prog[] = "resize2fs";
+ if (e2prog (prog) == -1)
+ return -1;
+
+ r = command (NULL, &err, prog, "-M" , device, NULL);
+ if (r == -1) {
+ reply_with_error ("%s", err);
+ free (err);
+ return -1;
+ }
+
+ free (err);
+ return 0;
+}
+
+int
do_e2fsck_f (const char *device)
{
char *err;
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index ccaf10a7..50c33a8f 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -5675,6 +5675,19 @@ is no extended attribute named C<name>, this returns an error.
See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>.");
+ ("resize2fs_M", (RErr, [Device "device"], []), 281, [],
+ [],
+ "resize an ext2, ext3 or ext4 filesystem to the minimum size",
+ "\
+This command is the same as C<guestfs_resize2fs>, but the filesystem
+is resized to its minimum size. This works like the C<-M> option
+to the C<resize2fs> command.
+
+To get the resulting size of the filesystem you should call
+C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count>
+values. These two numbers, multiplied together, give the
+resulting size of the minimal filesystem in bytes.");
+
]
let all_functions = non_daemon_functions @ daemon_functions
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR
index 1b1c1312..1473a88f 100644
--- a/src/MAX_PROC_NR
+++ b/src/MAX_PROC_NR
@@ -1 +1 @@
-280
+281