Displaying 2 results from an estimated 2 matches for "xfs_datablocks".
2015 Oct 27
1
[PATCHv2] Added xfs support to vfs_minimum_size.
..._xfs_repair (const char *device,
return r;
}
+
+int64_t
+xfs_minimum_size (const char *path)
+{
+ CLEANUP_FREE guestfs_int_xfsinfo *info = do_xfs_info (path);
+
+ if (info == NULL)
+ return -1;
+
+ // XFS does not support shrinking.
+ if (INT64_MAX / info->xfs_blocksize < info->xfs_datablocks) {
+ reply_with_error ("filesystem size too big: overflow");
+ return -1;
+ }
+ return info->xfs_blocksize * info->xfs_datablocks;
+}
diff --git a/generator/actions.ml b/generator/actions.ml
index 8832410..d8af08d 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml...
2015 Oct 24
3
[PATCH] Added xfs support for vfs_min_size.
...660,15 @@ do_xfs_repair (const char *device,
return r;
}
+
+int64_t
+xfs_minimum_size (const char *path)
+{
+ CLEANUP_FREE guestfs_int_xfsinfo *info = do_xfs_info (path);
+
+ if (info == NULL)
+ return -1;
+
+ // XFS does not support shrinking.
+ return info->xfs_blocksize * info->xfs_datablocks;
+}
diff --git a/generator/actions.ml b/generator/actions.ml
index 8832410..d8af08d 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -12765,6 +12765,10 @@ To read the UUID on a filesystem, call C<guestfs_vfs_uuid>." };
[["mkfs"; "btrfs"; "...