perl-fuse.git
12 years agoDocumentation cleanups.
Derrik Pates [Mon, 12 Mar 2012 20:55:11 +0000 (14:55 -0600)]
Documentation cleanups.

Correct docs for open(), utimens() and ioctl() ops to match up with
code changes.

Add a blurb explaining what removexattr() does.

Add an extra newline in the release() doc section to fully separate
two things that should be actually separate.

12 years agoSupport more accurate timestamps for utimens().
Derrik Pates [Sun, 4 Mar 2012 18:05:57 +0000 (11:05 -0700)]
Support more accurate timestamps for utimens().

Added an option to Fuse::main(), specifically "utimens_as_array",
that causes timestamps to be passed as arrays containing the UNIX
timestamp (seconds since the epoch), followed by the number of
nanoseconds, instead of as a floating-point value, for better
precision. However, I've noticed that when (on Linux, at least)
you "touch" a file, which ends up with utimensat() getting passed
a NULL value for the timestamp array, the resulting timestamp that
utimens() gets always has a "0" for the nanosecond field. I think
that's a FUSE misfunction.

12 years agoLion compat for -lfuse_ino64 hack.
Derrik Pates [Sat, 3 Mar 2012 04:42:38 +0000 (21:42 -0700)]
Lion compat for -lfuse_ino64 hack.

12 years agoDon't override the include path if empty.
Derrik Pates [Sat, 3 Mar 2012 04:25:01 +0000 (21:25 -0700)]
Don't override the include path if empty.

12 years agoAdded a mention about sub-second times to getattr documentation.
Derrik Pates [Fri, 2 Mar 2012 14:12:26 +0000 (07:12 -0700)]
Added a mention about sub-second times to getattr documentation.

12 years agoRewrite timestamp handling to support different representations.
Derrik Pates [Fri, 2 Mar 2012 05:56:46 +0000 (22:56 -0700)]
Rewrite timestamp handling to support different representations.

Instead of just allowing sub-second resolution times to be passed
as the fractional part of a floating point value, also support passing
times as an array ref, with separate second and nanosecond portions.
Decided to do this because the floating point representation can lose
precision (it's represented internally as a double). It tends to get
squirrelly around about a tenth of a microsecond.

12 years agoUpdated Changes and fixed a couple indents.
Derrik Pates [Thu, 1 Mar 2012 17:28:47 +0000 (10:28 -0700)]
Updated Changes and fixed a couple indents.

12 years agoAdd fix for RT #71271.
Derrik Pates [Thu, 1 Mar 2012 06:32:40 +0000 (23:32 -0700)]
Add fix for RT #71271.

Seems that my utimens() addition inspired someone to notice the
lack of support in other codepaths for sub-second time resolution.
This fix takes the fractional portion of any mtime/ctime/atime
values and converts it into the appropriate nanosecond value, and
assigns that to the correct location in the "struct stat". Tested
on Linux 3.0 (Ubuntu 11.10), FreeBSD 8.2, NetBSD 5.1 and MacOS X
10.6 (Snow Leopard).

12 years agoCode cleanups.
Derrik Pates [Wed, 29 Feb 2012 00:20:24 +0000 (17:20 -0700)]
Code cleanups.

More perl-izing using list assignment and declaration.

Added more comments to clarify purpose of parts of code.

Tweaked layout a bit to match up better with the original C version
(mostly declaration/calling/assignment order bits here and there).

Separated %fuseargs declare/init from setting the 'mountpoint' element,
to better handle parsing options out before grabbing the mount point.

12 years agoInline POD fixups, and change =head1 poll() to =head3.
Derrik Pates [Wed, 29 Feb 2012 00:14:42 +0000 (17:14 -0700)]
Inline POD fixups, and change =head1 poll() to =head3.

12 years agoFix a typo in documentation: Separeted -> Separated
Bastien ROUCARIES [Wed, 11 Jan 2012 11:02:54 +0000 (12:02 +0100)]
Fix a typo in documentation: Separeted -> Separated

12 years agoFix a typo in documentation: trunctation -> truncation
Romain Beauxis [Tue, 10 Jan 2012 14:09:06 +0000 (15:09 +0100)]
Fix a typo in documentation: trunctation -> truncation

12 years agoThe current list of major changes to the code.
Derrik Pates [Tue, 25 Oct 2011 14:27:01 +0000 (08:27 -0600)]
The current list of major changes to the code.

Not intended for release yet, but just to keep track.

12 years agoMerge remote-tracking branch 'ktdreyer/master'
Derrik Pates [Tue, 25 Oct 2011 14:23:27 +0000 (08:23 -0600)]
Merge remote-tracking branch 'ktdreyer/master'

12 years agoRemove some print statements, and handle options for debug output and threads.
Derrik Pates [Tue, 25 Oct 2011 14:14:58 +0000 (08:14 -0600)]
Remove some print statements, and handle options for debug output and threads.

12 years agoset license metadata (LGPL)
Ken Dreyer [Mon, 24 Oct 2011 03:34:40 +0000 (21:34 -0600)]
set license metadata (LGPL)

12 years agoAppears that Filesys::Statvfs on OS X actually does return f_namelen.
Derrik Pates [Sun, 14 Aug 2011 03:10:52 +0000 (21:10 -0600)]
Appears that Filesys::Statvfs on OS X actually does return f_namelen.

12 years agoUpdate MANIFEST with new ioctl/poll test scripts.
Derrik Pates [Wed, 10 Aug 2011 02:31:44 +0000 (20:31 -0600)]
Update MANIFEST with new ioctl/poll test scripts.

12 years agoOkay, nevermind, can't do that that way at all...
Derrik Pates [Wed, 10 Aug 2011 02:24:43 +0000 (20:24 -0600)]
Okay, nevermind, can't do that that way at all...

12 years agoFix a typo, and call fuse_version after 'bootstrap' is done.
Derrik Pates [Wed, 10 Aug 2011 02:22:46 +0000 (20:22 -0600)]
Fix a typo, and call fuse_version after 'bootstrap' is done.

12 years agoRemove a couple commented lines.
Derrik Pates [Wed, 10 Aug 2011 02:12:38 +0000 (20:12 -0600)]
Remove a couple commented lines.

Remove lines that were being used to diagnose a problem.

12 years agoUse FUSE_IOCTL_COMPAT from the Fuse module.
Derrik Pates [Wed, 10 Aug 2011 02:10:39 +0000 (20:10 -0600)]
Use FUSE_IOCTL_COMPAT from the Fuse module.

12 years agoAdding working but somewhat preliminary poll() support.
Derrik Pates [Wed, 10 Aug 2011 02:00:03 +0000 (20:00 -0600)]
Adding working but somewhat preliminary poll() support.

This is my current-state support for poll() (my three-quarter-assed
implementation of it anyway). I attempted to implement the poll handle
as an object, but ran into threading problems with that, so it evolved
in a slightly different direction.

Also had to add a small hack in S_fh_store_handle(), as when it
tried to use mg->mg_ptr to make the filehandle, the fsel.pl example
file ended up with all the file descriptors lost but the one. I'm not
currently sure why that's so; I've never seen that happen before, but
it seems to be threading related, as if I disable the 'threaded' flag
to Fuse::main(), it works. I think it may be an undiagnosed threading
interaction...

12 years agoAllow 'nonseekable' for open/create on Fuse 2.8.
Derrik Pates [Wed, 10 Aug 2011 01:56:09 +0000 (19:56 -0600)]
Allow 'nonseekable' for open/create on Fuse 2.8.

12 years agoAdded some ioctl-specific symbols.
Derrik Pates [Wed, 10 Aug 2011 01:55:45 +0000 (19:55 -0600)]
Added some ioctl-specific symbols.

12 years agoNo, '=' is not the same as 'eq', try harder.
Derrik Pates [Wed, 10 Aug 2011 01:41:17 +0000 (19:41 -0600)]
No, '=' is not the same as 'eq', try harder.

12 years agoMake these more compatible with their C counterparts.
Derrik Pates [Wed, 10 Aug 2011 01:40:21 +0000 (19:40 -0600)]
Make these more compatible with their C counterparts.

12 years agoUse a few more Perl-isms.
Derrik Pates [Wed, 3 Aug 2011 00:07:10 +0000 (18:07 -0600)]
Use a few more Perl-isms.

12 years agoCast the 'cmd' argument as unsigned.
Derrik Pates [Tue, 2 Aug 2011 19:33:42 +0000 (13:33 -0600)]
Cast the 'cmd' argument as unsigned.

12 years agoFix handling of XATTR_{CREATE,REPLACE} once and for all.
Derrik Pates [Tue, 2 Aug 2011 19:26:18 +0000 (13:26 -0600)]
Fix handling of XATTR_{CREATE,REPLACE} once and for all.

Okay, seems I missed a prior change that made the XATTR_CREATE and
XATTR_REPLACE functions not included when __FreeBSD__ is defined (which
also includes OS X). Also, the macros that define the symbols when
FreeBSD or NetBSD is used instead of including <sys/xattr.h> didn't
account correctly for OS X's __FreeBSD__ having a value of 10. This
corrects that.

12 years agoEnable threading in the fioc.pl ioctl example.
Derrik Pates [Tue, 2 Aug 2011 16:35:32 +0000 (10:35 -0600)]
Enable threading in the fioc.pl ioctl example.

12 years agoRemove import causing dup symbol warnings, and drop () from Carp import.
Derrik Pates [Tue, 2 Aug 2011 13:49:34 +0000 (07:49 -0600)]
Remove import causing dup symbol warnings, and drop () from Carp import.

12 years ago'unless' confused things and made this work wrong. Fixed.
Derrik Pates [Tue, 2 Aug 2011 13:46:17 +0000 (07:46 -0600)]
'unless' confused things and made this work wrong. Fixed.

12 years agoRemove more unnecessary lines.
Derrik Pates [Tue, 2 Aug 2011 05:45:23 +0000 (23:45 -0600)]
Remove more unnecessary lines.

12 years agoRemove the todo about the test path, I think that's fixed now.
Derrik Pates [Tue, 2 Aug 2011 04:57:49 +0000 (22:57 -0600)]
Remove the todo about the test path, I think that's fixed now.

12 years agoOnly allow non-pkgconfig path on NetBSD (for refuse).
Derrik Pates [Tue, 2 Aug 2011 04:57:18 +0000 (22:57 -0600)]
Only allow non-pkgconfig path on NetBSD (for refuse).

12 years agoFix up ioctl read path so we don't fprintf() error unnecessarily.
Derrik Pates [Tue, 2 Aug 2011 04:55:40 +0000 (22:55 -0600)]
Fix up ioctl read path so we don't fprintf() error unnecessarily.

Avoid fprintf()'ing an error after the Perl code has already
returned an error, in the case where we're not returning data because
we're returning an error code.

12 years agoRemove some debug output that's not needed anymore.
Derrik Pates [Tue, 2 Aug 2011 04:54:31 +0000 (22:54 -0600)]
Remove some debug output that's not needed anymore.

12 years agoHandle the ioctl call returns better.
Derrik Pates [Tue, 2 Aug 2011 04:53:53 +0000 (22:53 -0600)]
Handle the ioctl call returns better.

12 years agoUse asm/ioctl.ph instead of my home-cooked ioctl business.
Derrik Pates [Tue, 2 Aug 2011 04:37:49 +0000 (22:37 -0600)]
Use asm/ioctl.ph instead of my home-cooked ioctl business.

12 years agoAdded examples for ioctl functionality. Currently linux dependent.
Derrik Pates [Tue, 2 Aug 2011 03:13:36 +0000 (21:13 -0600)]
Added examples for ioctl functionality. Currently linux dependent.

12 years agoAdd ioctl docs, and newlines in other needed places.
Derrik Pates [Tue, 2 Aug 2011 03:12:55 +0000 (21:12 -0600)]
Add ioctl docs, and newlines in other needed places.

12 years agoA couple more cleanups to the ioctl wrapper.
Derrik Pates [Tue, 2 Aug 2011 03:12:37 +0000 (21:12 -0600)]
A couple more cleanups to the ioctl wrapper.

12 years agoGot my directions flipped around for the ioctl data handling.
Derrik Pates [Tue, 2 Aug 2011 02:25:59 +0000 (20:25 -0600)]
Got my directions flipped around for the ioctl data handling.

12 years agoAdding FUSE 2.8 specific operation 'ioctl'.
Derrik Pates [Mon, 1 Aug 2011 17:51:43 +0000 (11:51 -0600)]
Adding FUSE 2.8 specific operation 'ioctl'.

Not sure if this will actually work yet, but it builds cleanly, and from
my reading of docs and examples, this *seems* like the right way to
implement the ioctl() call wrapper. (I'd already had this mostly
implemented and disabled, but wasn't sure it was ready for prime time.
We'll find out.)

12 years agoUse the smaller size multiplier only for OS X.
Derrik Pates [Mon, 1 Aug 2011 16:46:22 +0000 (10:46 -0600)]
Use the smaller size multiplier only for OS X.

12 years agoMerge branch 'master' of github.com:dpavlin/perl-fuse
Derrik Pates [Mon, 1 Aug 2011 16:36:33 +0000 (10:36 -0600)]
Merge branch 'master' of github.com:dpavlin/perl-fuse

12 years agoReplace system() calls for 'touch' and friends with Perl ops for same.
Derrik Pates [Mon, 1 Aug 2011 16:33:27 +0000 (10:33 -0600)]
Replace system() calls for 'touch' and friends with Perl ops for same.

If we don't need specific command functionality, we should use Perl calls
to effect the desired result. That way, we depend less on command specific
functionality, and invite less opportunity for platform-specific command
options giving us trouble.

12 years agobump version to 0.14
Dobrica Pavlinusic [Mon, 1 Aug 2011 15:45:06 +0000 (17:45 +0200)]
bump version to 0.14

12 years agoChange mknod test to use Unix::Mknod and POSIX::mkfifo().
Derrik Pates [Sun, 31 Jul 2011 03:48:57 +0000 (21:48 -0600)]
Change mknod test to use Unix::Mknod and POSIX::mkfifo().

Instead of using system() to call executables (and depend on mknod
and mkfifo command syntax), use Unix::Mknod's mknod() function
and POSIX's mkfifo() function to make device and named pipe nodes,
and use Unix::Mknod's makedev() to combine major/minor numbers
appropriately instead of depending on knowing (or guessing)
the shift distance for the device major number.

12 years agoAdditional Changes item.
Derrik Pates [Fri, 29 Jul 2011 19:39:00 +0000 (13:39 -0600)]
Additional Changes item.

12 years agoOkay, seems the #defines are *not* necessary for 5.8.9, but this is...
Derrik Pates [Fri, 29 Jul 2011 19:25:51 +0000 (13:25 -0600)]
Okay, seems the #defines are *not* necessary for 5.8.9, but this is...

12 years agoPerl 5.8.9 worked before this update; 5.8.8 did not. Account for that.
Derrik Pates [Fri, 29 Jul 2011 19:12:50 +0000 (13:12 -0600)]
Perl 5.8.9 worked before this update; 5.8.8 did not. Account for that.

12 years agoDecrease the file size used in getattr.t by a factor of 1024.
Derrik Pates [Fri, 29 Jul 2011 18:52:14 +0000 (12:52 -0600)]
Decrease the file size used in getattr.t by a factor of 1024.

This issue has caused the getattr test to take... well, hours on my
MacBook. This is because the kernel is busy allocating disk pages for
all the empty space prior to the space character that's put into the
file, because the HFS+ filesystem doesn't support sparse files.

12 years agoREADME update, and use full path to mount when checking mounted FSes.
Derrik Pates [Fri, 29 Jul 2011 18:39:55 +0000 (12:39 -0600)]
README update, and use full path to mount when checking mounted FSes.

12 years agoSummary of 0.14 candidate changes.
Derrik Pates [Fri, 29 Jul 2011 17:49:45 +0000 (11:49 -0600)]
Summary of 0.14 candidate changes.

12 years agoOn Perl 5.8, lchown() sometimes ends up with leaked errno; declare $! local.
Derrik Pates [Fri, 29 Jul 2011 17:28:20 +0000 (11:28 -0600)]
On Perl 5.8, lchown() sometimes ends up with leaked errno; declare $! local.

12 years agoOn Perl 5.8, importing Unix::Mknod doesn't import symbols by default.
Derrik Pates [Fri, 29 Jul 2011 17:17:15 +0000 (11:17 -0600)]
On Perl 5.8, importing Unix::Mknod doesn't import symbols by default.

12 years agoReplace all tests that require knowing syscall numbers.
Derrik Pates [Fri, 29 Jul 2011 16:53:27 +0000 (10:53 -0600)]
Replace all tests that require knowing syscall numbers.

Since tests that need syscall.pm or sys/syscall.pm, et al., always
fail on the CPAN testing systems for one of several reasons (causing
"make test" to fail because loopback.pl can't even create plain
files without it), I'm adopting the *BSD arrangement for handling
mknod() in loopback.pl, and using the Lchown module to do lchown()
instead of trying to lookup a syscall number for it. Also changed
the statfs test to do the same, as I'd already written code to
use Filesys::Statvfs instead of trying to track down the
statfs/statvfs/statvfs1 syscall number, and worry about packing
the arguments the right way. Also changed Makefile.PL to provide
per-platform explanations of what to install for FUSE support, and
moved the "-g -ggdb" options into the OPTIMIZE parameter to
WriteMakefile(). Also made a note of testing against CentOS 5.6,
due to its use of Perl 5.8, as opposed to everything else I'd
tested against prior.

12 years agoChanged clone_params_{new,del} to Perl_clone_params_{new,del}.
Derrik Pates [Sat, 23 Jul 2011 03:07:34 +0000 (21:07 -0600)]
Changed clone_params_{new,del} to Perl_clone_params_{new,del}.

Referenced the sources for Perl 5.13.2 and Perl 5.14.1; seems both use
this function name syntax, with no #define aliases to the prior-used
naming conventions. Not sure what up there.

12 years agoMerge branch 'master' of github.com:dpavlin/perl-fuse
Derrik Pates [Sat, 23 Jul 2011 02:10:14 +0000 (20:10 -0600)]
Merge branch 'master' of github.com:dpavlin/perl-fuse

12 years agoChanges to improve compatibility with Perl 5.8.
Derrik Pates [Sat, 23 Jul 2011 02:09:18 +0000 (20:09 -0600)]
Changes to improve compatibility with Perl 5.8.

12 years agoMerge branch 'master' of github.com:dpavlin/perl-fuse
Dobrica Pavlinusic [Mon, 4 Jul 2011 08:05:55 +0000 (10:05 +0200)]
Merge branch 'master' of github.com:dpavlin/perl-fuse

12 years agoVarious changes to tests and Makefile.
Derrik Pates [Sun, 3 Jul 2011 18:07:59 +0000 (12:07 -0600)]
Various changes to tests and Makefile.

Merged all loopback scripts into a single variant; now threads are
enabled by passing --use-threads to loopback.pl instead of having a
separate script variant, and use of Filesys::Statvfs instead of
bogus filler statfs() data is enabled with --use-real-statfs. Also,
loopback now fork()s itself away into a daemon, rather than depending
on external infrastructure to do it; --pidfile can be passed to create
a PID file.

Altered test/helper.pm and test/s/mount.t to use new loopback.pl semantics.

Altered test/statfs.t to optionally use Filesys::Statvfs's statvfs()
instead of raw syscalls and pack masks, if the option is available
to us. If not available, it will try to use syscalls instead.

Cleanups to Makefile to put different options where they belong,
rather than e.g., abusing the 'OBJECT' list to specify libraries
and such. Works with all platforms.

Updates to README and MANIFEST.

12 years ago0.13 release with FreeBSD, NetBSD and OS X support
Dobrica Pavlinusic [Sun, 3 Jul 2011 17:56:23 +0000 (19:56 +0200)]
0.13 release with FreeBSD, NetBSD and OS X support

12 years agoMake the code work without USE_ITHREADS. FreeBSD's default Perl build
Derrik Pates [Wed, 29 Jun 2011 01:08:27 +0000 (19:08 -0600)]
Make the code work without USE_ITHREADS. FreeBSD's default Perl build
doesn't enable threads (it can be enabled), so let's try to be a bit
more accepting.

12 years agoMerge branch 'master' of github.com:dpavlin/perl-fuse
Derrik Pates [Tue, 28 Jun 2011 02:12:57 +0000 (20:12 -0600)]
Merge branch 'master' of github.com:dpavlin/perl-fuse

12 years agoNetBSD 5.1, not 5.0.
Derrik Pates [Tue, 28 Jun 2011 01:56:58 +0000 (19:56 -0600)]
NetBSD 5.1, not 5.0.

12 years agoNetBSD 5.1, not 5.0.
Derrik Pates [Tue, 28 Jun 2011 01:04:18 +0000 (19:04 -0600)]
NetBSD 5.1, not 5.0.

12 years agoUpdates to README.
Derrik Pates [Fri, 24 Jun 2011 17:37:25 +0000 (11:37 -0600)]
Updates to README.

12 years agoSmall pack mask change for 32-bit Linux compatibility.
Derrik Pates [Fri, 24 Jun 2011 16:55:43 +0000 (10:55 -0600)]
Small pack mask change for 32-bit Linux compatibility.

12 years agoChanges to statfs.t to work better with 32-bit versions of NetBSD.
Derrik Pates [Fri, 24 Jun 2011 16:28:26 +0000 (10:28 -0600)]
Changes to statfs.t to work better with 32-bit versions of NetBSD.

12 years agoMultiple changes for better *BSD compatibility, including:
Derrik Pates [Fri, 24 Jun 2011 13:36:53 +0000 (07:36 -0600)]
Multiple changes for better *BSD compatibility, including:

- For OS X/Darwin, use alternate function argument lists that add an
  extra parameter for the setxattr() and getxattr() call wrappers. This
  eliminates some compile-time warnings, and makes sure the call stack
  isn't getting unbalanced when those calls are made.
- For OS X/Darwin, force the use of -lfuse_ino64 on OS X 10.6 (Snow
  Leopard); FUSE filesystems won't work at all otherwise due to changes
  in the inode structure definition, and the pkgconfig files don't check
  for this.
- For OS X/Darwin, don't set the PERL_DL_NONLAZY=1 environment variable
  during "make test"; MacFuse builds their libfuse with a reference to
  _iconv, but doesn't link in -liconv at build time, and due to
  differences in their dynamic linker, linking -liconv into our library
  doesn't get that symbol into its namespace, so tests fail completely
  on OS X due to the unsatisfied link symbol when RTLD_NOW is passed to
  dlopen().
- Enabled alternate mknod handling for NetBSD and OS X/Darwin in
  addition to FreeBSD in the example code.
- Synchronized all changes (except enabling threading) from
  examples/loopback_t.pl to examples/loopback.pl.
- Reenabled threading use for OS X/Darwin in tests; testing on my
  MacBook running OS X 10.6.7 always passes with it enabled (though
  does not with threading disabled, which probably needs some
  diagnosing).
- In the mknod() test, use a different major number shift value (24
  instead of 8) for OS X/Darwin.
- In the statfs() test, use sys/syscall.ph instead of syscall.ph (works
  on Linux and all *BSDs, though NetBSD and OS X/Darwin perls don't h2ph
  the system headers at install time).
- In the statfs() test, altered the Linux pack mask for the statfs()
  syscall, added masks for FreeBSD and OS X/Darwin, and added statvfs1()
  call semantics for NetBSD, so this test will work on all supported
  platforms (though the FreeBSD pack mask may not work on non-64bit
  FreeBSDs, need to test that).
- In the statfs() test, ignore f_namelen field for NetBSD and
  OS X/Darwin. OS X/Darwin doesn't even have such a field, and NetBSD
  seems to not handle it right for PUFFS filesystems.
- In the symlink() test, use 'cp -R' on NetBSD instead of 'cp -a', since
  NetBSD's 'cp' doesn't know the '-a' option.

13 years agoCircumvent buggy negation of assigned $!.
Bojan Petrovic [Tue, 24 May 2011 21:00:43 +0000 (05:00 +0800)]
Circumvent buggy negation of assigned $!.

Loopback fs fails to create a new file every other time on FreeBSD.
This happens because of a Perl bug which occurs when $! is set from Perl
(as in x_mknod()), and then negated after a failed syscall (as in
x_getattr()). See http://www.perlmonks.org/?node_id=906466.

13 years agoHandle pipe creation in mknod() on FreeBSD.
Bojan Petrovic [Sat, 21 May 2011 20:17:06 +0000 (04:17 +0800)]
Handle pipe creation in mknod() on FreeBSD.

Additional special case is introduced in mknod() callback for the test
loopback fs. Pipes on FreeBSD are created through POSIX::mkfifo,
although they could be created by "mkfifo" command or syscall.  In the
"test/mknod.t", initial named pipe is now created by executing "mkfifo".

13 years agoMerge pull request #7 from ALPHA-60/master
Derrik Pates [Sat, 21 May 2011 19:09:53 +0000 (12:09 -0700)]
Merge pull request #7 from ALPHA-60/master

FreeBSD fixes

13 years agoWhen testing, check if '/proc/mounts' exists. (by Bojan Petrovic)
Derrik Pates [Sat, 21 May 2011 18:53:41 +0000 (12:53 -0600)]
When testing, check if '/proc/mounts' exists. (by Bojan Petrovic)

On FreeBSD, even if procfs is mounted under '/proc', there is no
'/proc/mounts' file.  Instead on relying on the existence of '/proc'
directory, we check if the '/proc/mounts' file exists. Otherwise, tests
cannot even start on FreeBSD.

13 years agoMerge remote-tracking branch 'dpavlin/master'
Bojan Petrovic [Sat, 21 May 2011 18:31:40 +0000 (20:31 +0200)]
Merge remote-tracking branch 'dpavlin/master'

Conflicts:
Fuse.xs

13 years agoHandle mknod() differently when running FreeBSD, as its mknod syscall doesn't
Derrik Pates [Sat, 21 May 2011 18:07:15 +0000 (12:07 -0600)]
Handle mknod() differently when running FreeBSD, as its mknod syscall doesn't
create plain files at all.

13 years agoFor FreeBSD and NetBSD, define XATTR_{CREATE,REPLACE}, since there is no
Derrik Pates [Sat, 21 May 2011 17:20:53 +0000 (11:20 -0600)]
For FreeBSD and NetBSD, define XATTR_{CREATE,REPLACE}, since there is no
<sys/xattr.h> for us to use to reference the values.

13 years agoWhen testing, check if '/proc/mounts' exists.
Bojan Petrovic [Sat, 21 May 2011 08:47:50 +0000 (10:47 +0200)]
When testing, check if '/proc/mounts' exists.

On FreeBSD, even if procfs is mounted under '/proc', there is no
'/proc/mounts' file.  Instead on relying on the existence of '/proc'
directory, we check if the '/proc/mounts' file exists. Otherwise, tests
cannot even start on FreeBSD.

13 years agoDo not include 'xattr.h' on FreeBSD.
Bojan Petrovic [Sat, 21 May 2011 08:42:44 +0000 (10:42 +0200)]
Do not include 'xattr.h' on FreeBSD.

The build will break if this file is included, or if XATTR_CREATE
and XATTR_REPLACE constants are used.

13 years agodocument changes for version 0.12
Dobrica Pavlinusic [Fri, 20 May 2011 13:38:44 +0000 (15:38 +0200)]
document changes for version 0.12

13 years agoCheck that the option string is not an empty string. If it is, don't add
Derrik Pates [Thu, 19 May 2011 19:42:49 +0000 (13:42 -0600)]
Check that the option string is not an empty string. If it is, don't add
"-o" and an empty mountopts to the argument list.

13 years agoScrewed up parentheses balance with last commit. Oops. Fixed.
Derrik Pates [Thu, 19 May 2011 18:52:02 +0000 (12:52 -0600)]
Screwed up parentheses balance with last commit. Oops. Fixed.

13 years agoFound an error message that was using the old offset value; fixed to
Derrik Pates [Thu, 19 May 2011 18:07:35 +0000 (12:07 -0600)]
Found an error message that was using the old offset value; fixed to
use the new, correct one.

13 years agoMake sure the first element in the args list is an empty string always;
Derrik Pates [Thu, 19 May 2011 18:02:40 +0000 (12:02 -0600)]
Make sure the first element in the args list is an empty string always;
didn't think about the fact that if no "mountopts" is given, but "debug"
is true, there won't be one.

13 years agoUpdate the readdir example to use the new syntax, so it'll actually work.
Derrik Pates [Thu, 19 May 2011 17:10:09 +0000 (11:10 -0600)]
Update the readdir example to use the new syntax, so it'll actually work.

13 years agoRemove inclusion of Data::Dumper. Remove incorrect duplicate documentation
Derrik Pates [Thu, 19 May 2011 16:41:49 +0000 (10:41 -0600)]
Remove inclusion of Data::Dumper. Remove incorrect duplicate documentation
for readdir().

13 years agoMove XATTR_{CREATE,REPLACE} into the XS code, so we can get the
Derrik Pates [Thu, 19 May 2011 15:08:48 +0000 (09:08 -0600)]
Move XATTR_{CREATE,REPLACE} into the XS code, so we can get the
definitions of the constants from sys/xattr.h instead of setting them
to arbitrary platform-specific constant values.

13 years agoRemove a couple of unnecessary '#if FUSE_VERSION >= 24' blocks in the
Derrik Pates [Thu, 19 May 2011 15:02:23 +0000 (09:02 -0600)]
Remove a couple of unnecessary '#if FUSE_VERSION >= 24' blocks in the
_PLfuse_create implementation. If the create() wrapper is supported
(as of FUSE 2.5), we know those lines necessarily have to work, so
the conditional is pointless.

13 years agoAlign groups of hv_{fetch,store} calls. Compare to NULL, instead of assuming
Derrik Pates [Thu, 19 May 2011 06:29:04 +0000 (00:29 -0600)]
Align groups of hv_{fetch,store} calls. Compare to NULL, instead of assuming
NULL is 0 (most arches it is, but it's not necessary a universal constant).
Also make the hash building code in _PLfuse_create() consistent with
the code in _PLfuse_open().

13 years agoAssorted minor cleanups. Restore 'symlink' fops member. Better handle
Derrik Pates [Wed, 18 May 2011 17:57:29 +0000 (11:57 -0600)]
Assorted minor cleanups. Restore 'symlink' fops member. Better handle
NULL file arguments for functions that can operate on file/directory
handles.

13 years agoAdd return checking to several asprintf()s used for non 64-bit
Derrik Pates [Wed, 18 May 2011 17:20:35 +0000 (11:20 -0600)]
Add return checking to several asprintf()s used for non 64-bit
architectures. Also, abbreviate several unnecessary 4-line 'if (rv) ...'
blocks to a single line with a ternary operator, as it's cleaner and
(IMO) easier to read.

13 years agoVoid cast some hv_store calls to get rid of warnings.
Derrik Pates [Wed, 18 May 2011 17:13:54 +0000 (11:13 -0600)]
Void cast some hv_store calls to get rid of warnings.

13 years agoExport the 'private_data' member of the fuse_context struct as
Derrik Pates [Wed, 18 May 2011 17:10:58 +0000 (11:10 -0600)]
Export the 'private_data' member of the fuse_context struct as
'private', if any is set (via the init() function). Also, export the
'umask' member if built against FUSE 2.8 or later.

13 years agoImplement additional FUSE operations.
Derrik Pates [Wed, 18 May 2011 17:03:42 +0000 (11:03 -0600)]
Implement additional FUSE operations.

Implement all of the following:
 - opendir
 - releasedir
 - fsyncdir
 - init
 - destroy
 - access
 - create
 - ftruncate
 - fgetattr
 - lock
 - utimens
 - bmap

Also replace the deficient readdir() operation with my own, which
allows for significantly greater efficiency, and supports directory
handles (as can be returned from opendir()). Also also, instead of
using static initialization of fields to zero out the fops structure,
call memset() in the INIT block of perl_fuse_main().

13 years agoFold margs and fargs together into args; this fixes the handling of
Derrik Pates [Wed, 18 May 2011 16:39:59 +0000 (10:39 -0600)]
Fold margs and fargs together into args; this fixes the handling of
the '-o big_writes' mount option, which previously did not work
at all.

13 years agoHandle getdir entries in order passed. Currently they are handed to the
Derrik Pates [Wed, 18 May 2011 15:58:51 +0000 (09:58 -0600)]
Handle getdir entries in order passed. Currently they are handed to the
filler call in reverse order; this is kind of a pain in the butt.

13 years agoAdded support for 'nullpath_ok' option to fuse_main().
Derrik Pates [Wed, 18 May 2011 15:53:28 +0000 (09:53 -0600)]
Added support for 'nullpath_ok' option to fuse_main().