1. 10 11月, 2015 1 次提交
  2. 01 7月, 2015 1 次提交
  3. 22 7月, 2014 1 次提交
    • A
      fuse: add FUSE_NO_OPEN_SUPPORT flag to INIT · d7afaec0
      Andrew Gallagher 提交于
      Here some additional changes to set a capability flag so that clients can
      detect when it's appropriate to return -ENOSYS from open.
      
      This amends the following commit introduced in 3.14:
      
        7678ac50  fuse: support clients that don't implement 'open'
      
      However we can only add the flag to 3.15 and later since there was no
      protocol version update in 3.14.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      Cc: <stable@vger.kernel.org> # v3.15+
      d7afaec0
  4. 28 4月, 2014 3 次提交
  5. 02 4月, 2014 1 次提交
  6. 01 5月, 2013 1 次提交
  7. 17 4月, 2013 1 次提交
  8. 07 2月, 2013 2 次提交
  9. 04 2月, 2013 1 次提交
  10. 01 2月, 2013 1 次提交
  11. 24 1月, 2013 1 次提交
    • A
      fuse: implement NFS-like readdirplus support · 0b05b183
      Anand V. Avati 提交于
      This patch implements readdirplus support in FUSE, similar to NFS.
      The payload returned in the readdirplus call contains
      'fuse_entry_out' structure thereby providing all the necessary inputs
      for 'faking' a lookup() operation on the spot.
      
      If the dentry and inode already existed (for e.g. in a re-run of ls -l)
      then just the inode attributes timeout and dentry timeout are refreshed.
      
      With a simple client->network->server implementation of a FUSE based
      filesystem, the following performance observations were made:
      
      Test: Performing a filesystem crawl over 20,000 files with
      
      sh# time ls -lR /mnt
      
      Without readdirplus:
      Run 1: 18.1s
      Run 2: 16.0s
      Run 3: 16.2s
      
      With readdirplus:
      Run 1: 4.1s
      Run 2: 3.8s
      Run 3: 3.8s
      
      The performance improvement is significant as it avoided 20,000 upcalls
      calls (lookup). Cache consistency is no worse than what already is.
      Signed-off-by: NAnand V. Avati <avati@redhat.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      0b05b183
  12. 13 10月, 2012 1 次提交
  13. 18 7月, 2012 3 次提交
  14. 25 4月, 2012 1 次提交
  15. 12 4月, 2012 1 次提交
  16. 13 12月, 2011 2 次提交
    • J
      FUSE: Notifying the kernel of deletion. · 451d0f59
      John Muir 提交于
      Allows a FUSE file-system to tell the kernel when a file or directory is
      deleted. If the specified dentry has the specified inode number, the kernel will
      unhash it.
      
      The current 'fuse_notify_inval_entry' does not cause the kernel to clean up
      directories that are in use properly, and as a result the users of those
      directories see incorrect semantics from the file-system. The error condition
      seen when 'fuse_notify_inval_entry' is used to notify of a deleted directory is
      avoided when 'fuse_notify_delete' is used instead.
      
      The following scenario demonstrates the difference:
      1. User A chdirs into 'testdir' and starts reading 'testfile'.
      2. User B rm -rf 'testdir'.
      3. User B creates 'testdir'.
      4. User C chdirs into 'testdir'.
      
      If you run the above within the same machine on any file-system (including fuse
      file-systems), there is no problem: user C is able to chdir into the new
      testdir. The old testdir is removed from the dentry tree, but still open by user
      A.
      
      If operations 2 and 3 are performed via the network such that the fuse
      file-system uses one of the notify functions to tell the kernel that the nodes
      are gone, then the following error occurs for user C while user A holds the
      original directory open:
      
      muirj@empacher:~> ls /test/testdir
      ls: cannot access /test/testdir: No such file or directory
      
      The issue here is that the kernel still has a dentry for testdir, and so it is
      requesting the attributes for the old directory, while the file-system is
      responding that the directory no longer exists.
      
      If on the other hand, if the file-system can notify the kernel that the
      directory is deleted using the new 'fuse_notify_delete' function, then the above
      ls will find the new directory as expected.
      Signed-off-by: NJohn Muir <john@jmuir.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      451d0f59
    • M
      fuse: support ioctl on directories · b18da0c5
      Miklos Szeredi 提交于
      Multiplexing filesystems may want to support ioctls on the underlying
      files and directores (e.g. FS_IOC_{GET,SET}FLAGS).
      
      Ioctl support on directories was missing so add it now.
      Reported-by: NAntonio SJ Musumeci <bile@landofbile.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      b18da0c5
  17. 08 8月, 2011 1 次提交
    • M
      fuse: fix flock · 37fb3a30
      Miklos Szeredi 提交于
      Commit a9ff4f87 "fuse: support BSD locking semantics" overlooked a
      number of issues with supporing flock locks over existing POSIX
      locking infrastructure:
      
        - it's not backward compatible, passing flock(2) calls to userspace
          unconditionally (if userspace sets FUSE_POSIX_LOCKS)
      
        - it doesn't cater for the fact that flock locks are automatically
          unlocked on file release
      
        - it doesn't take into account the fact that flock exclusive locks
          (write locks) don't need an fd opened for write.
      
      The last one invalidates the original premise of the patch that flock
      locks can be emulated with POSIX locks.
      
      This patch fixes the first two issues.  The last one needs to be fixed
      in userspace if the filesystem assumed that a write lock will happen
      only on a file operned for write (as in the case of the current fuse
      library).
      Reported-by: NSebastian Pipping <webmaster@hartwork.org>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      37fb3a30
  18. 08 12月, 2010 2 次提交
    • M
      fuse: fix ioctl ABI · 1baa26b2
      Miklos Szeredi 提交于
      In kernel ABI version 7.16 and later FUSE_IOCTL_RETRY reply from a
      unrestricted IOCTL request shall return with an array of 'struct
      fuse_ioctl_iovec' instead of 'struct iovec'.  This fixes the ABI
      ambiguity of 32bit vs. 64bit.
      Reported-by: N"ccmail111" <ccmail111@yahoo.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      CC: Tejun Heo <tj@kernel.org>
      1baa26b2
    • M
      fuse: allow batching of FORGET requests · 02c048b9
      Miklos Szeredi 提交于
      Terje Malmedal reports that a fuse filesystem with 32 million inodes
      on a machine with lots of memory can take up to 30 minutes to process
      FORGET requests when all those inodes are evicted from the icache.
      
      To solve this, create a BATCH_FORGET request that allows up to about
      8000 FORGET requests to be sent in a single message.
      
      This request is only sent if userspace supports interface version 7.16
      or later, otherwise fall back to sending individual FORGET messages.
      Reported-by: NTerje Malmedal <terje.malmedal@usit.uio.no>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      02c048b9
  19. 12 7月, 2010 2 次提交
    • M
      fuse: add retrieve request · 2d45ba38
      Miklos Szeredi 提交于
      Userspace filesystem can request data to be retrieved from the inode's
      mapping.  This request is synchronous and the retrieved data is queued
      as a new request.  If the write to the fuse device returns an error
      then the retrieve request was not completed and a reply will not be
      sent.
      
      Only present pages are returned in the retrieve reply.  Retrieving
      stops when it finds a non-present page and only data prior to that is
      returned.
      
      This request doesn't change the dirty state of pages.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      2d45ba38
    • M
      fuse: add store request · a1d75f25
      Miklos Szeredi 提交于
      Userspace filesystem can request data to be stored in the inode's
      mapping.  This request is synchronous and has no reply.  If the write
      to the fuse device returns an error then the store request was not
      fully completed (but may have updated some pages).
      
      If the stored data overflows the current file size, then the size is
      extended, similarly to a write(2) on the filesystem.
      
      Pages which have been completely stored are marked uptodate.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      a1d75f25
  20. 25 5月, 2010 1 次提交
    • M
      fuse: support splice() writing to fuse device · dd3bb14f
      Miklos Szeredi 提交于
      Allow userspace filesystem implementation to use splice() to write to
      the fuse device.  The semantics of using splice() are:
      
       1) buffer the message header and data in a temporary pipe
       2) with a *single* splice() call move the message from the temporary pipe
          to the fuse device
      
      The READ reply message has the most interesting use for this, since
      now the data from an arbitrary file descriptor (which could be a
      regular file, a block device or a socket) can be tranferred into the
      fuse device without having to go through a userspace buffer.  It will
      also allow zero copy moving of pages.
      
      One caveat is that the protocol on the fuse device requires the length
      of the whole message to be written into the header.  But the length of
      the data transferred into the temporary pipe may not be known in
      advance.  The current library implementation works around this by
      using vmplice to write the header and modifying the header after
      splicing the data into the pipe (error handling omitted):
      
      	struct fuse_out_header out;
      
      	iov.iov_base = &out;
      	iov.iov_len = sizeof(struct fuse_out_header);
      	vmsplice(pip[1], &iov, 1, 0);
      	len = splice(input_fd, input_offset, pip[1], NULL, len, 0);
      	/* retrospectively modify the header: */
      	out.len = len + sizeof(struct fuse_out_header);
      	splice(pip[0], NULL, fuse_chan_fd(req->ch), NULL, out.len, flags);
      
      This works since vmsplice only saves a pointer to the data, it does
      not copy the data itself.
      
      Since pipes are currently limited to 16 pages and messages need to be
      spliced atomically, the length of the data is limited to 15 pages (or
      60kB for 4k pages).
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      dd3bb14f
  21. 09 7月, 2009 1 次提交
  22. 07 7月, 2009 1 次提交
  23. 01 7月, 2009 2 次提交
    • J
      fuse: invalidation reverse calls · 3b463ae0
      John Muir 提交于
      Add notification messages that allow the filesystem to invalidate VFS
      caches.
      
      Two notifications are added:
      
       1) inode invalidation
      
         - invalidate cached attributes
         - invalidate a range of pages in the page cache (this is optional)
      
       2) dentry invalidation
      
         - try to invalidate a subtree in the dentry cache
      
      Care must be taken while accessing the 'struct super_block' for the
      mount, as it can go away while an invalidation is in progress.  To
      prevent this, introduce a rw-semaphore, that is taken for read during
      the invalidation and taken for write in the ->kill_sb callback.
      
      Cc: Csaba Henk <csaba@gluster.com>
      Cc: Anand Avati <avati@zresearch.com>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      3b463ae0
    • M
      fuse: allow umask processing in userspace · e0a43ddc
      Miklos Szeredi 提交于
      This patch lets filesystems handle masking the file mode on creation.
      This is needed if filesystem is using ACLs.
      
       - The CREATE, MKDIR and MKNOD requests are extended with a "umask"
         parameter.
      
       - A new FUSE_DONT_MASK flag is added to the INIT request/reply.  With
         this the filesystem may request that the create mode is not masked.
      
      CC: Jean-Pierre André <jean-pierre.andre@wanadoo.fr>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      e0a43ddc
  24. 09 6月, 2009 1 次提交
    • T
      CUSE: implement CUSE - Character device in Userspace · 151060ac
      Tejun Heo 提交于
      CUSE enables implementing character devices in userspace.  With recent
      additions of ioctl and poll support, FUSE already has most of what's
      necessary to implement character devices.  All CUSE has to do is
      bonding all those components - FUSE, chardev and the driver model -
      nicely.
      
      When client opens /dev/cuse, kernel starts conversation with
      CUSE_INIT.  The client tells CUSE which device it wants to create.  As
      the previous patch made fuse_file usable without associated
      fuse_inode, CUSE doesn't create super block or inodes.  It attaches
      fuse_file to cdev file->private_data during open and set ff->fi to
      NULL.  The rest of the operation is almost identical to FUSE direct IO
      case.
      
      Each CUSE device has a corresponding directory /sys/class/cuse/DEVNAME
      (which is symlink to /sys/devices/virtual/class/DEVNAME if
      SYSFS_DEPRECATED is turned off) which hosts "waiting" and "abort"
      among other things.  Those two files have the same meaning as the FUSE
      control files.
      
      The only notable lacking feature compared to in-kernel implementation
      is mmap support.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      151060ac
  25. 02 12月, 2008 1 次提交
    • M
      fuse: update interface version · 1f55ed06
      Miklos Szeredi 提交于
      Change interface version to 7.11 after adding the IOCTL and POLL
      messages.
      
      Also clean up the <linux/fuse.h> header a bit:
        - update copyright date to 2008
        - fix checkpatch warning:
            WARNING: Use #include <linux/types.h> instead of <asm/types.h>
        - remove FUSE_MAJOR define, which is not being used any more
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      1f55ed06
  26. 26 11月, 2008 4 次提交
    • T
      fuse: implement poll support · 95668a69
      Tejun Heo 提交于
      Implement poll support.  Polled files are indexed using kh in a RB
      tree rooted at fuse_conn->polled_files.
      
      Client should send FUSE_NOTIFY_POLL notification once after processing
      FUSE_POLL which has FUSE_POLL_SCHEDULE_NOTIFY set.  Sending
      notification unconditionally after the latest poll or everytime file
      content might have changed is inefficient but won't cause malfunction.
      
      fuse_file_poll() can sleep and requires patches from the following
      thread which allows f_op->poll() to sleep.
      
        http://thread.gmane.org/gmane.linux.kernel/726176Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      95668a69
    • T
      fuse: implement unsolicited notification · 8599396b
      Tejun Heo 提交于
      Clients always used to write only in response to read requests.  To
      implement poll efficiently, clients should be able to issue
      unsolicited notifications.  This patch implements basic notification
      support.
      
      Zero fuse_out_header.unique is now accepted and considered unsolicited
      notification and the error field contains notification code.  This
      patch doesn't implement any actual notification.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      8599396b
    • T
      fuse: implement ioctl support · 59efec7b
      Tejun Heo 提交于
      Generic ioctl support is tricky to implement because only the ioctl
      implementation itself knows which memory regions need to be read
      and/or written.  To support this, fuse client can request retry of
      ioctl specifying memory regions to read and write.  Deep copying
      (nested pointers) can be implemented by retrying multiple times
      resolving one depth of dereference at a time.
      
      For security and cleanliness considerations, ioctl implementation has
      restricted mode where the kernel determines data transfer directions
      and sizes using the _IOC_*() macros on the ioctl command.  In this
      mode, retry is not allowed.
      
      For all FUSE servers, restricted mode is enforced.  Unrestricted ioctl
      will be used by CUSE.
      
      Plese read the comment on top of fs/fuse/file.c::fuse_file_do_ioctl()
      for more information.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      59efec7b
    • T
      fuse: move FUSE_MINOR to miscdevice.h · 193da609
      Tejun Heo 提交于
      Move FUSE_MINOR to miscdevice.h.  While at it, de-uglify the file.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      193da609
  27. 16 10月, 2008 2 次提交