id3fsd verbosity: -v => sql, -vv => fuse debugging
[id3fs.git] / lib / ID3FS / Fuse.pm
index 50e7060..14304f7 100644 (file)
@@ -18,7 +18,7 @@ sub new
     $self->{db}=shift;
     $self->{source}=shift;
     $self->{mountpoint}=Cwd::abs_path(shift);
-    $self->{debug}=shift;
+    $self->{verbose}=shift;
     $self->{perms} = S_IRUSR() | S_IXUSR() | S_IRGRP() | S_IXGRP() | S_IROTH() | S_IXOTH();
 
     return $self;
@@ -30,7 +30,7 @@ sub run
     Fuse::main(
        mountpoint  => $self->{mountpoint},
        threaded    => 0,
-       debug       => $self->{debug},
+       debug       => ($self->{verbose} > 1),
        mountopts   => "allow_other,ro",
        getattr     => sub { $self->getattr(@_); },
        readlink    => sub { $self->readlink(@_); },
@@ -65,7 +65,7 @@ sub getattr
 {
     my($self, $filename)=@_;
 #    print "**GETATTR: $filename\n";
-    my $path=ID3FS::Path->new($self->{db}, $filename);
+    my $path=ID3FS::Path->new($self->{db}, $filename, $self->{verbose});
     my $last_update=$self->{db}->last_update();
     return(-ENOENT()) unless($path->isvalid());
     my($dev,$ino,$nlink)=(0,0,1);
@@ -83,7 +83,7 @@ sub readlink
 {
     my($self,$filename)=@_;
 #    print "**READLINK: $filename\n";
-    my $path=ID3FS::Path->new($self->{db}, $filename);
+    my $path=ID3FS::Path->new($self->{db}, $filename, $self->{verbose});
     return(-EINVAL()) unless($path->isfile());
     return $path->dest($self->{mountpoint});
 }
@@ -92,7 +92,7 @@ sub getdir
 {
     my($self, $filename)=@_;
 #    print "**GETDIR: $filename\n";
-    my $path=ID3FS::Path->new($self->{db}, $filename);
+    my $path=ID3FS::Path->new($self->{db}, $filename, $self->{verbose});
     return(-ENOENT()) unless($path->isvalid());
     return(-ENOTDIR()) unless($path->isdir());
     my @dents=();