Changeset 20134
- Timestamp:
- Oct 13, 2008, 4:56:30 PM (18 years ago)
- Location:
- trunk/Nebulous-Server
- Files:
-
- 2 edited
-
Changes (modified) (1 diff)
-
bin/nebdiskd (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous-Server/Changes
r20091 r20134 30 30 DBH itself; cleanup Nebulous::Server->db() 31 31 - add Nebulous::Server->swap_objects() method 32 - change nebdiskd to not do things that might imply a table level lock on 33 the mount table 32 34 33 35 0.15 Thu Sep 11 13:00:59 HST 2008 -
trunk/Nebulous-Server/bin/nebdiskd
r19886 r20134 3 3 # Copyright (C) 2007 Joshua Hoblitt 4 4 # 5 # $Id: nebdiskd,v 1.1 1 2008-10-03 21:56:36jhoblitt Exp $5 # $Id: nebdiskd,v 1.12 2008-10-14 02:56:30 jhoblitt Exp $ 6 6 7 7 use strict; … … 124 124 125 125 eval { 126 # empty the mount table 127 $dbh->do("DELETE FROM mount"); 128 print "flushed mount table\n" if $debug; 129 130 # repopulate the mount table with all valid mounts that we are 131 # supposed to be watching 132 my $query = $dbh->prepare_cached("INSERT INTO mount VALUES(?, ?, ?)"); 126 my $r_query = $dbh->prepare_cached("REPLACE INTO mount VALUES(?, ?, ?)"); 127 my $d_query = $dbh->prepare_cached("DELETE FROM mount WHERE mountpoint = ?"); 133 128 134 129 # determine valid mountpoints … … 139 134 eval { 140 135 unless (is_mountpoint($mnt)) { 141 print "$mnt is not a valid mountpoint\n" if $debug; 142 next; 136 die "$mnt is not a valid mountpoint\n"; 143 137 } 144 138 }; 145 139 if ($@) { 146 print "$mnt is not a valid mountpoint\n" if $debug; 140 print $@ if $debug; 141 $d_query->execute($mnt); 147 142 next; 148 143 } … … 157 152 } 158 153 159 $ query->execute($mnt, @$dev_info{qw( blocks used )});154 $r_query->execute($mnt, @$dev_info{qw( blocks used )}); 160 155 print "adding $mnt to db\n" if $debug; 161 156
Note:
See TracChangeset
for help on using the changeset viewer.
