Index: trunk/Nebulous/bin/neb-df
===================================================================
--- trunk/Nebulous/bin/neb-df	(revision 13023)
+++ trunk/Nebulous/bin/neb-df	(revision 13041)
@@ -3,5 +3,5 @@
 # Copyright (C) 2005  Joshua Hoblitt
 #
-# $Id: neb-df,v 1.1 2007-04-25 19:52:49 jhoblitt Exp $
+# $Id: neb-df,v 1.2 2007-04-26 20:27:33 jhoblitt Exp $
 
 use strict;
@@ -47,22 +47,14 @@
 my $sql = Nebulous::Server::SQL->new();
 
-# get a list of Nebulous volume names
-my $query = $dbh->prepare("SELECT * FROM volume");
+# ask the db to generate the table of mounted Nebulous volume 
+$dbh->do("call getmountedvol()");
+
+# suck that table into an AoH
+my $query = $dbh->prepare("SELECT * FROM mountedvol");
 $query->execute();
 
-my $mount_query = $dbh->prepare("SELECT *, INSTR(?, mountpoint) = 1 as substring FROM mount ORDER BY substring DESC, LENGTH(mountpoint) DESC LIMIT 1");
-
 my @stats;
-
-# use the list of Nebulous volume names to look for the corresponding
-# mountpoint
-while (my $volume_row = $query->fetchrow_hashref) {
-    $mount_query->execute($volume_row->{path});
-    my $mount_row = $mount_query->fetchrow_hashref;
-
-    # assemble a hash that combines the neb volume info with the filesystem
-    # info
-    my $vol = {%{$volume_row}, %{$mount_row}};
-    push @stats, $vol;
+while (my $mountedvol = $query->fetchrow_hashref) {
+    push @stats, $mountedvol;
 }
 
