Skip Menu |

This queue is for tickets about the Fuse CPAN distribution.

Report information
The Basics
Id: 50000
Status: resolved
Priority: 0/
Queue: Fuse

People
Owner: DPAVLIN [...] cpan.org
Requestors: dsokol [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Feature request: fuseopts
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 );
Subject: fuse_opts.patch
Index: Fuse.pm =================================================================== RCS file: /cvsroot/fuse/perl/Fuse.pm,v retrieving revision 1.22 diff -u -r1.22 Fuse.pm --- Fuse-0.09_3/Fuse.pm 19 Mar 2008 19:40:36 -0000 1.22 +++ Fuse-0.09_3/Fuse.pm 13 Apr 2009 18:48:18 -0000 @@ -83,8 +83,8 @@ 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})) { Index: Fuse.xs =================================================================== RCS file: /cvsroot/fuse/perl/Fuse.xs,v retrieving revision 1.24 diff -u -r1.24 Fuse.xs --- Fuse-0.09_3/Fuse.xs 19 Mar 2008 19:40:36 -0000 1.24 +++ Fuse-0.09_3/Fuse.xs 13 Apr 2009 18:48:18 -0000 @@ -1,3 +1,7 @@ +/* + * vim:ts=8:noet + */ + #include "EXTERN.h" #include "perl.h" #include "XSUB.h" @@ -840,10 +844,11 @@ 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; } @@ -862,8 +867,9 @@ } mountpoint = SvPV_nolen(ST(2)); mountopts = SvPV_nolen(ST(3)); + if (SvCUR(ST(4))) fuseopts = SvPV_nolen(ST(4)); for(i=0;i<N_CALLBACKS;i++) { - SV *var = ST(i+4); + SV *var = ST(i+5); /* allow symbolic references, or real code references. */ if(SvOK(var) && (SvPOK(var) || (SvROK(var) && SvTYPE(SvRV(var)) == SVt_PVCV))) { void **tmp1 = (void**)&_available_ops, **tmp2 = (void**)&fops; @@ -893,20 +899,25 @@ fuse_opt_free_args(&margs); croak("out of memory\n"); } + if (fuse_opt_add_arg(&fargs, "") == -1) { + fuse_opt_free_args(&fargs); + croak("out of memory\n"); + } + if (fuseopts && + (fuse_opt_add_arg(&fargs, "-o") == -1 || + fuse_opt_add_arg(&fargs, fuseopts) == -1)) { + fuse_opt_free_args(&fargs); + croak("out of memory\n"); + } + if (debug && (fuse_opt_add_arg(&fargs, "-d") == -1)) { + fuse_opt_free_args(&fargs); + croak("out of memory\n"); + } + fd = fuse_mount(mountpoint,&margs); fuse_opt_free_args(&margs); if(fd < 0) croak("could not mount fuse filesystem!\n"); - if (debug) { - if ( fuse_opt_add_arg(&fargs, "") == -1 || - fuse_opt_add_arg(&fargs, "-d") == -1) { - fuse_opt_free_args(&fargs); - croak("out of memory\n"); - } - } else { - if (fuse_opt_add_arg(&fargs, "") == -1) - croak("out of memory\n"); - } if(threaded) { fuse_loop_mt(fuse_new(fd,&fargs,&fops,sizeof(fops)));
committed to development branch http://github.com/dpavlin/perl-fuse/commits/rt-50000-fuseopts in it's current state, it doesn't pass make test
Subject: Re: [rt.cpan.org #50000] Feature request: fuseopts
Date: Sat, 29 May 2010 10:45:49 +0300
To: bug-Fuse [...] rt.cpan.org
From: Denis Sokolovsky <denis.sokolovsky [...] gmail.com>
2010/5/17 Dobrica Pavlinusic via RT <bug-Fuse@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50000 > > > committed to development branch > > http://github.com/dpavlin/perl-fuse/commits/rt-50000-fuseopts > > in it's current state, it doesn't pass make test
Can you describe problem in more details. Because on my workstation all ok - http://pastie.org/982876 -- Denis Sokolovsky
Subject: Re: [rt.cpan.org #50000] Feature request: fuseopts
Date: Sat, 29 May 2010 11:02:18 +0300
To: bug-Fuse [...] rt.cpan.org
From: Denis Sokolovsky <denis.sokolovsky [...] gmail.com>
2010/5/17 Dobrica Pavlinusic via RT <bug-Fuse@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50000 > > > committed to development branch > > http://github.com/dpavlin/perl-fuse/commits/rt-50000-fuseopts > > in it's current state, it doesn't pass make test
I also download sources from git, checked out branch with fuseopts, compile it and have all test passed: All tests successful. Files=21, Tests=338, 15 wallclock secs ( 0.13 usr 0.05 sys + 0.87 cusr 6.32 csys = 7.37 CPU) Result: PASS -- Denis Sokolovsky
Instead of implementing a separate arglist, we've folded the 'margs' and 'fargs' arglists together into a single arglist. The irrelevant arguments are ignored, so you don't have to worry about things like mount options needing to be in both places. That makes all mount options (e.g., 'big_writes') work correctly. This change went in as of the 0.12 release. Does that work as a solution for you?