/[fuse-comp]/fuse-comp.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /fuse-comp.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 10 by dpavlin, Sun Jul 8 21:03:26 2007 UTC revision 12 by dpavlin, Mon Jul 9 10:35:02 2007 UTC
# Line 127  sub file_copy { Line 127  sub file_copy {
127  sub x_open {  sub x_open {
128          my ($file) = shift;          my ($file) = shift;
129          my ($mode) = shift;          my ($mode) = shift;
130    
131            if ( $file eq '/.debug' ) {
132                    my $path = $mount->{from} . '/.debug';
133                    open( my $debug, '>', $path ) || die "can't open $path: $!";
134                    my $dump = dump( $pending );
135                    print $debug "pending = $dump\n";
136                    close($debug);
137                    $pending->{'/.debug'}->{path} = $path;
138                    warn "## created dump $path $dump\n";
139                    return 0;
140            }
141    
142          $pending->{$file}->{open}++;          $pending->{$file}->{open}++;
143    
144          my $mode_desc = {          my $mode_desc = {
# Line 151  sub x_open { Line 163  sub x_open {
163          }          }
164          warn ">>> open abs path: $path ", -s $path, " bytes\n";          warn ">>> open abs path: $path ", -s $path, " bytes\n";
165          return -$! unless sysopen($fh , $path, $mode);          return -$! unless sysopen($fh , $path, $mode);
166            close($fh);
167    
168          $pending->{$file}->{path} = $path;          $pending->{$file}->{path} = $path;
169          return 0;          return 0;
# Line 161  sub x_read { Line 174  sub x_read {
174          my ($rv) = -ENOSYS();          my ($rv) = -ENOSYS();
175          my $path = fixup( $file );          my $path = fixup( $file );
176    
177            confess "no pending file $file ", dump( $pending ) unless defined( $pending->{$file} );
178    
179          return -ENOENT() unless -e $path;          return -ENOENT() unless -e $path;
180    
181          my $fh = new IO::File;          my $fh = new IO::File;
# Line 179  sub x_write { Line 194  sub x_write {
194          my $rv;          my $rv;
195          my $path = fixup($file);          my $path = fixup($file);
196    
197            confess "no pending file $file ", dump( $pending ) unless defined( $pending->{$file} );
198    
199          return -ENOENT() unless -e $path;          return -ENOENT() unless -e $path;
200    
201          my $fh = new IO::File;          my $fh = new IO::File;
# Line 188  sub x_write { Line 205  sub x_write {
205                  warn "## ", $pending->{$file}->{path}, " $off ",length( $buf ), "\n" if $debug;                  warn "## ", $pending->{$file}->{path}, " $off ",length( $buf ), "\n" if $debug;
206          }          }
207          $rv = -ENOSYS() unless $rv;          $rv = -ENOSYS() unless $rv;
208            close($fh);
209          return length($buf);          return length($buf);
210  }  }
211    

Legend:
Removed from v.10  
changed lines
  Added in v.12

  ViewVC Help
Powered by ViewVC 1.1.26