X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=gearman%2Fzfs.pl;h=7ed765afd20974e99ea94b41b356337853b467ef;hb=eaaf66c7ab6e529345899e4cfa8d21f30aa93084;hp=a07488ea891a810f6af0585feff81ddb63eaf90f;hpb=c91f89bb3058cf3a7b431444bec825865b48f584;p=cloudstore.git diff --git a/gearman/zfs.pl b/gearman/zfs.pl index a07488e..7ed765a 100755 --- a/gearman/zfs.pl +++ b/gearman/zfs.pl @@ -35,9 +35,11 @@ sub zfs { my $name = $ENV{ZSLICE}; $name =~ s/\W+/_/g; -$worker->register_function( $name . '_quota_get' => sub { zfs( -"zfs get -H -p -o value userused\@u%s $ENV{ZSLICE}" => $_[0] -) } ); +$worker->register_function( $name . '_quota_get' => sub { + my $used = zfs( "zfs get -H -p -o value userused\@u%s $ENV{ZSLICE}" => $_[0] ); + my $quota = zfs( "zfs get -H -p -o value userquota\@u%s $ENV{ZSLICE}" => $_[0] ); + return "$used $quota"; +} ); $worker->register_function( $name . '_quota_set' => sub { zfs( "zfs set userquota\@u%s=%s $ENV{ZSLICE}" => $_[0]