/[fuse_dbi]/fuse-couchdb/DBI.pm
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-couchdb/DBI.pm

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

revision 23 by dpavlin, Sat Oct 2 16:54:42 2004 UTC revision 24 by dpavlin, Fri Oct 8 20:07:12 2004 UTC
# Line 64  my $ctime_start; Line 64  my $ctime_start;
64  sub read_filenames;  sub read_filenames;
65  sub fuse_module_loaded;  sub fuse_module_loaded;
66    
67    # evil, evil way to solve this. It makes this module non-reentrant. But, since
68    # fuse calls another copy of this script for each mount anyway, this shouldn't
69    # be a problem.
70    my $fuse_self;
71    
72  sub mount {  sub mount {
73          my $class = shift;          my $class = shift;
74          my $self = {};          my $self = {};
# Line 77  sub mount { Line 82  sub mount {
82          carp "mount needs 'mount' as mountpoint" unless ($arg->{'mount'});          carp "mount needs 'mount' as mountpoint" unless ($arg->{'mount'});
83    
84          # save (some) arguments in self          # save (some) arguments in self
85          $self->{$_} = $arg->{$_} foreach (qw(mount));          foreach (qw(mount invalidate)) {
86                    $self->{$_} = $arg->{$_};
87                    $fuse_self->{$_} = $arg->{$_};
88            }
89    
90          foreach (qw(filenames read update)) {          foreach (qw(filenames read update)) {
91                  carp "mount needs '$_' SQL" unless ($arg->{$_});                  carp "mount needs '$_' SQL" unless ($arg->{$_});
# Line 143  sub umount { Line 151  sub umount {
151          return 1;          return 1;
152  }  }
153    
154    #$SIG{'INT'} = sub {
155    #       print STDERR "umount called by SIG INT\n";
156    #       umount;
157    #};
158    
159    sub DESTROY {
160            my $self = shift;
161            print STDERR "umount called by DESTROY\n";
162            $self->umount;
163    }
164    
165  =head2 fuse_module_loaded  =head2 fuse_module_loaded
166    
167  Checks if C<fuse> module is loaded in kernel.  Checks if C<fuse> module is loaded in kernel.
# Line 348  sub update_db { Line 367  sub update_db {
367                          return 0;                          return 0;
368                  }                  }
369                  print "updated '$file' [",$files{$file}{id},"]\n";                  print "updated '$file' [",$files{$file}{id},"]\n";
370    
371                    $fuse_self->{'invalidate'}->() if (ref $fuse_self->{'invalidate'});
372          }          }
373          return 1;          return 1;
374  }  }

Legend:
Removed from v.23  
changed lines
  Added in v.24

  ViewVC Help
Powered by ViewVC 1.1.26