IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 2, 2007, 10:53:42 AM (19 years ago)
Author:
jhoblitt
Message:

add volume.available field and logic to use it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Nebulous-Server/lib/Nebulous/Server.pm

    r13130 r13131  
    11# Copyright (c) 2004  Joshua Hoblitt
    22#
    3 # $Id: Server.pm,v 1.30 2007-05-02 20:14:45 jhoblitt Exp $
     3# $Id: Server.pm,v 1.31 2007-05-02 20:53:42 jhoblitt Exp $
    44
    55package Nebulous::Server;
     
    10221022}
    10231023
    1024 #  select *, total - used as free, (used / total) * 100 as perused from mount;
    10251024
    10261025sub _get_storage_volume
     
    10511050        if ( $name ) {
    10521051            $query = $db->prepare_cached( $sql->get_storage_volume_byname );
    1053             $rows = $query->execute(0.95, $name);
     1052            # %free, name, avaiable, allocate
     1053            $rows = $query->execute(0.95, $name, 1, 1);
    10541054            unless ($rows > 0) {
    10551055                $query->finish;
     
    10631063        } else {
    10641064            $query = $db->prepare_cached( $sql->get_storage_volume );
    1065             $rows = $query->execute(0.95);
     1065            # %free, avaiable, allocate
     1066            $rows = $query->execute(0.95, 1, 1);
    10661067            # there has to be atleast one storage volume
    10671068            unless ($rows > 0) {
Note: See TracChangeset for help on using the changeset viewer.