Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tag: 0.09_4
Commits on May 16, 2010
  1. @gerph

    Addition of file handles on open files

    gerph authored committed
    Sat May 15 16:36:47 2010: Request 57517 was acted upon.
    Transaction: Ticket created by gerph
           Queue: Fuse
         Subject: Addition of file handles on open files
       Broken in: 0.09_3
        Severity: (no value)
           Owner: Nobody
      Requestors: gerph@gerph.org
          Status: new
     Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=57517 >
    
    Hiya,
    
    Whilst trying to write a filesystem using the Fuse module, I found it
    surprising that there were no 'file handles' available when you opened
    a file. The only way you can know what file was referenced is by its
    name, which is not useful if your filesystem is intended to return
    different results for each file opened. It turned out in my case to not
    matter, but consider a FS which returned a different story every time
    you opened it. Or, more practically, a FS which returned the contents
    of the latest checked in file - and whilst you were operating on the
    file the latest checked in file changed. There are ways around this -
    files becoming invariant whilst it has any open instances of itself or
    similar - but these are not ideal.
    
    The way that Fuse appears to do this is that the filesystem updates a
    property ('fh') in the fuse_file_info structure on open, to contain the
    context for the opened file. I've put together a change which allows
    you to return a second parameter from open containing this value, which
    is then passed to all the functions which operate on open files (read,
    write, flush, release). Because we're retaining a reference to the SV
    that was returned (and is otherwise unused in the perl) we also
    increment the refcount on open, and decrement it on release - I think
    that's all that's necessary to prevent a leak, but I've never done any
    XS work before this so I can't be certain.
    
    I'd expect that under normal circumstances you'd open a file, set up a
    hashref containing properties for the file that you've opened and use
    'return (0, $handle);' to return it. If you don't return a handle, the
    old behaviour remains - undef will be passed to the implementation in
    place of the handle (which the implementation wasn't expecting so won't
    care about).
    
    In addition, I've also added the ability to set the 'direct_io',
    'keepcache' and 'nonseekable' properties by changing a hashref which is
    passed to the 'open' call.
    
    The archive I've attached contains the Fuse.pm and Fuse.xs files in
    their entirity, together with the diffs from 0.09_3. There is also a
    rudimentary example FS, based on the example one in the Fuse
    distribution, which shows the file handle to be working. It seems to be
    working in my more complex MythTV filesystem that I'm still trying to
    make useful.
    
    I couldn't actually test the nonseekable property as the fuse I have
    seems to be 2.4, so I don't have that property available to me here -
    I've just followed what the documentation says should be available.
    
    I've not added anything to the tests, because I'm not sure how to do
    that really, but I hope that the change to add the file handles is
    useful.
Commits on May 11, 2010
  1. remove version number

    authored
Commits on May 10, 2010
  1. @kost

    documentation fix

    kost authored committed
Commits on Mar 19, 2008
  1. another try to fix files larger than 2Gb: for this we pop

    authored
    float from stack since long is limited to 4Gb
    
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@123 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Mar 16, 2008
  1. cpan target to push latest verison out

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@122 6e4b0b00-1209-0410-87b2-b275959b5705
  2. update latest Changes

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@121 6e4b0b00-1209-0410-87b2-b275959b5705
  3. version bump [0.09_2]

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@120 6e4b0b00-1209-0410-87b2-b275959b5705
  4. expose and fix 2Gb file bug, RT #32639, RT #33903

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@119 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Jan 21, 2008
  1. fuse_get_context documentation patch from jaslong

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@118 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Jan 7, 2008
  1. update from Reuben Thomas: fixes a bug in mkdir (failed to tag, so newly

    authored
    created dir was not visible in the filtered fs), and makes error reporting a
    little better (if tag routine returns an error, that is propagated).        
    
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@117 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Dec 6, 2007
  1. Added contributed filesystem described in e-mail message below:

    authored
    From: Reuben Thomas <rrt@sc3d.org>
    To: dpavlin@rot13.org
    Subject: Contribution of sample FS to Fuse
    
    Hi,
    
    I'm just putting the finishing touches to an FS I wrote with Fuse, which
    was invaluable, as I couldn't contemplate writing it in C (it's just not
    important enough for that much pain!).
    
    I've called it filter_attr_t.pl. It is just loopback_t.pl, augmented with a
    function and a little logic so that only files that possess extended
    attribute given at mount time are visible. Further, if you try to write to
    a file that exists but is not tagged (and hence invisible), you get
    -EEXIST, and if you try to unlink a tagged file, it is merely untagged
    rather than actually unlinked.
    
    My use for this is to use the backup program Unison, which synchronises two
    directory trees, to synch my PDA and my home directory, while excluding
    most of the files in my home dir (which would simply not fit in my PDA's
    16Mb of file space!). I was amazed to find I couldn't see a FUSE fs which
    would do this already, and I was nearly in despair when I remembered Fuse,
    and, sure enough, it looked a lot easier than writing a FUSE fs in C.
    
    Of course, the example code was also invaluable, as without it I would have
    taken much longer to write the code, and I wouldn't have known some of the
    traps.
    
    So, a big thank you, and I attach the current version.
    
    --
    http://rrt.sc3d.org/ | Slow Pedestrian Crossing (Anon)
    
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@116 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Nov 15, 2007
  1. added Chris, bump version to 0.09

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@113 6e4b0b00-1209-0410-87b2-b275959b5705
  2. patch from Chris Dolan via rt.cpan.org #30631

    authored
    This patch gets Fuse.pm to half-work on MacOSX with the current release
    of MacFuse (v1.1.0).  By half-work, I mean that all of the directory
    actions and file read actions work, but anything that involves writing a
    file fails.  This appears to be because the latest MacFUSE implements
    FUSE 2.6, which prefers to call CREATE instead of MKNOD.  Nonetheless,
    recommend that something like this patch be included because it makes
    read-only filesystems usable on Darwin systems.  Some of my changes
    (like kill() instead of system("kill")) are improvements on any system.
    												    I've tested only on my PowerPC G5 iMac running 10.4.
    
    I intend to also try MacFUSE v0.4 via Fink, but that version is                                     
    reportedly less stable than the latest MacFUSE.                                                     
    
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@112 6e4b0b00-1209-0410-87b2-b275959b5705
  3. calls mount instread of cat /proc/mountpoints to make it less Linux s…

    authored
    …pecific
    
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@111 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Jan 20, 2007
  1. one more define (_FILE_OFFSET_BITS=64) on darwin

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@110 6e4b0b00-1209-0410-87b2-b275959b5705
  2. support for MacFUSE implementation for Mac OS X from http://code.goog…

    authored
    …le.com/p/macfuse/
    
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@109 6e4b0b00-1209-0410-87b2-b275959b5705
  3. Changes from Marc to implement fuse_get_context():

    authored
    * an XS function to get the data
    * a mention of it in Fuse.pm so it can be exported properly
    * a pretty ugly hack to example.pl, which is how I tested it.
    
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@108 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Dec 3, 2006
  1. fixes for Andrew for dh-make-perl which uses fakeroot

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@107 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Nov 29, 2006
  1. bump version to 0.08, added Changes for this version

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@106 6e4b0b00-1209-0410-87b2-b275959b5705
  2. fix to test helper as proposed by ANDREWC@cpan.org (rt.cpan.org #17695)

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@105 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Nov 9, 2006
  1. warn about required permissions also

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@104 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Oct 19, 2006
  1. make CPANPLUS happy and don't report errors if fuse isn't installed

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@103 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Aug 29, 2006
  1. fix path to local svn

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@102 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Aug 22, 2006
  1. patch from Mark Glines to allow Fuse to be run from a non-master thread

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@101 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Jul 30, 2006
  1. changes from Nick Waterman <laptop@noseynick.com> to fix race conditi…

    authored
    …on in
    
    test/s/mount.t
    
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@100 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on Jun 6, 2006
  1. CPAN release 0.07

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@95 6e4b0b00-1209-0410-87b2-b275959b5705
  2. use mount_fusefs on FreeBSD to get fuse version

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@94 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on May 29, 2006
  1. Fix ISO C90 warnings

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@93 6e4b0b00-1209-0410-87b2-b275959b5705
  2. Mark Glines fixed problem with newer fuse versions

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@92 6e4b0b00-1209-0410-87b2-b275959b5705
Commits on May 23, 2006
  1. bump version

    authored
    git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@91 6e4b0b00-1209-0410-87b2-b275959b5705
Something went wrong with that request. Please try again.