From: Denis Sokolovsky Date: Mon, 17 May 2010 16:41:03 +0000 (+0200) Subject: fuseopts, RT #50000 X-Git-Url: http://git.rot13.org/?p=perl-fuse.git;a=commitdiff_plain;h=refs%2Fheads%2Frt-50000-fuseopts fuseopts, RT #50000 Thu Sep 24 18:39:05 2009: Request 50000 was acted upon. Transaction: Ticket created by DSOKOL Queue: Fuse Subject: Feature request: fuseopts Broken in: (no value) Severity: Wishlist Owner: Nobody Requestors: dsokol@cpan.org Status: new Ticket Please add "fuseopts" as acceptable parameter for Fuse::main. This gives ability to use fuse more finely. Example of usage: Fuse::main( mountpoint => XXX->config('MountPoint'), debug => XXX->config{'Debug'}, threaded => 0, mountopts => "allow_other,fsname=XXX", fuseopts => "direct_io,entry_timeout=0.1", @hooks ); --- diff --git a/Fuse.pm b/Fuse.pm index dc8d8e3..f156df6 100755 --- a/Fuse.pm +++ b/Fuse.pm @@ -83,8 +83,8 @@ sub main { my $tmp = 0; my %mapping = map { $_ => $tmp++ } @names; my %optmap = map { $_ => 1 } @validOpts; - my @otherargs = qw(debug threaded mountpoint mountopts); - my %otherargs = (debug=>0, threaded=>0, mountpoint=>"", mountopts=>""); + my @otherargs = qw(debug threaded mountpoint mountopts fuseopts); + my %otherargs = (debug=>0, threaded=>0, mountpoint=>"", mountopts=>"", fuseopts=>""); while(my $name = shift) { my ($subref) = shift; if(exists($otherargs{$name})) { diff --git a/Fuse.xs b/Fuse.xs index a5cc6c7..6203eca 100755 --- a/Fuse.xs +++ b/Fuse.xs @@ -1,3 +1,7 @@ +/* + * vim:ts=8:noet + */ + #include "EXTERN.h" #include "perl.h" #include "XSUB.h" @@ -909,10 +913,11 @@ perl_fuse_main(...) int i, fd, debug, threaded; char *mountpoint; char *mountopts; + char *fuseopts = NULL; struct fuse_args margs = FUSE_ARGS_INIT(0, NULL); struct fuse_args fargs = FUSE_ARGS_INIT(0, NULL); INIT: - if(items != 29) { + if(items != 30) { fprintf(stderr,"Perl<->C inconsistency or internal error\n"); XSRETURN_UNDEF; } @@ -931,8 +936,9 @@ perl_fuse_main(...) } mountpoint = SvPV_nolen(ST(2)); mountopts = SvPV_nolen(ST(3)); + if (SvCUR(ST(4))) fuseopts = SvPV_nolen(ST(4)); for(i=0;i