[pve-devel] [PATCH pve-storage 3/3] zfs : add volume_blocksize_info

Alexandre Derumier aderumier at odiso.com
Fri Jun 29 16:40:13 CEST 2018


---
 PVE/Storage/ZFSPoolPlugin.pm | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/PVE/Storage/ZFSPoolPlugin.pm b/PVE/Storage/ZFSPoolPlugin.pm
index 32e53aa..9af7803 100644
--- a/PVE/Storage/ZFSPoolPlugin.pm
+++ b/PVE/Storage/ZFSPoolPlugin.pm
@@ -464,6 +464,20 @@ sub volume_size_info {
     die "Could not get zfs volume size\n";
 }
 
+sub volume_blocksize_info {
+    my ($class, $scfg, $storeid, $volname, $timeout) = @_;
+
+    my (undef, $vname, undef, undef, undef, undef, $format) =
+        $class->parse_volname($volname);
+
+    my $attr = 'volblocksize';
+    my $text = $class->zfs_request($scfg, undef, 'get', '-Hp', $attr, "$scfg->{pool}/$vname");
+    if ($text =~ /\s$attr\s(\d+)\s/) {
+	return $1;
+    }
+    return undef;
+}
+
 sub volume_snapshot {
     my ($class, $scfg, $storeid, $volname, $snap) = @_;
 
-- 
2.11.0




More information about the pve-devel mailing list