Commit Graph

437 Commits

Author SHA1 Message Date
Miklos Szeredi
6f77e7de6f Check protocol version before sending notifications
Check protocol version before sending notifications and return -ENOSYS if a
particular notification is not supported.
2012-04-10 16:01:00 +02:00
Miklos Szeredi
fd4ffa53df Interpret octal escape codes in options
Requested by Jan Engelhardt
2012-01-27 16:42:33 +01:00
Miklos Szeredi
9318a6b947 Revert "Add mmap() and munmap() methods to low level API"
This partially reverts commit 4b2157c44e.

Remove mmap/munmap suppor as this missed the interface changes for Linux-3.3
(API version 7.18).

Only revert the mmap/munmap bits and leave the retrieve_reply API fix in place
as well as the optimization in fuse_send_data_iov_fallback().
2012-01-24 14:32:28 +01:00
Anatol Pomozov
66003c2631 Disable symbol versions on MacOSX
MacOSX uses MachO binary format that does not support symbols.

This change comes from fuse4x project (fuse implementation for macosx).
2012-01-13 13:43:05 +01:00
Miklos Szeredi
6c4cc1e64d Remove unnecessary mutex unlock at the end of multithreaded event loop 2012-01-02 18:15:05 +01:00
Miklos Szeredi
3c4f7e194e Free request in fuse_reply_data()
Fix memory leak caused by a missing fuse_request_free() in fuse_reply_data().
2011-12-09 16:07:55 +01:00
Miklos Szeredi
4dc7e675bb Don't unhash name in FORGET
This resulted in ENOENT being returned for unlinked but still open files if the
kernel sent a FORGET request for the parent directory.

Discovered with fs_racer in LTP.
2011-12-09 16:07:55 +01:00
Miklos Szeredi
bfc49cefc4 Fix hang in wait_on_path()
Ville Silventoinen reported that fs_racer in LTP triggered a hang in
wait_on_path().  This bug was caused by try_get_path() not resetting "ticket" on
permanent failure.
2011-12-09 16:07:55 +01:00
Emmanuel Dreyfus
1bf98cf7bc FUSE_NODE_SLAB buildfix
When FUSE_NODE_SLAB is not defined, the build fails because of undefined
functions. Attached patch fixes the problem.
2011-12-08 13:44:19 +01:00
John Muir
5a44747054 libfuse: Notifying the kernel of deletion.
libfuse part to allow 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.

Signed-off-by: John Muir <john@jmuir.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
2011-12-07 12:23:58 +01:00
Miklos Szeredi
4b2157c44e Add mmap() and munmap() methods to low level API
Currently this is only useful for CUSE.  Also update retrieve_reply()
method.
2011-12-06 18:06:18 +01:00
Miklos Szeredi
e3f95263a7 Add support for ioctl on directories
Reported by Antonio SJ Musumeci
2011-12-05 15:21:28 +01:00
Miklos Szeredi
6b12905b10 Make lock argument of fuse_reply_lock const
Low level API: lock argument of fuse_reply_lock should have a
'const' qualifier.

Reported by Shachar Sharon
2011-12-05 13:31:42 +01:00
Miklos Szeredi
42d5c66b0b Reply with ENOMEM in case of failure to allocate request
Reply to request with ENOMEM in case of failure to allocate request
structure.  Otherwise the task issuing the request will just freeze up
until the filesystem daemon is killed.  Reported by Stephan Kulow
2011-10-23 10:07:20 +02:00
Anatol Pomozov
7728b36a83 Replace daemon() function with fork()
daemon() is a BSD-ism. Although it is available on many platforms
it is not a standard function. Some platforms (e.g. MacOSX) deprecated
it.

It is safer just to use fork() function that is a part of POSIX.
2011-09-23 13:28:51 +02:00
Miklos Szeredi
0131407f4e Don't ignore --disable-mtab
If configured with --disable-mtab then don't call mount(8) from
libfuse to update the mtab.

Reported by: James Sierp
2011-08-31 12:55:06 +02:00
therealneworld@gmail.com
394380fe50 add lru for remember option
Use LRU list for cleaning up the cache if the "remember=T" option was
given.
2011-08-24 18:01:17 +02:00
Miklos Szeredi
8edeaa3f29 Add ->flock() operation to low and high level interfaces
This fixes problems with emulating flock() with POSIX locking.
Reported by Sebastian Pipping.

As with lock/setlk/getlk most filesystems don't need to implement
this, as the kernel takes care of file locking.  The only reason to
implement locking operations is for network filesystems which want
file locking to work between clients.
2011-07-06 12:12:01 +02:00
therealneworld@gmail.com
94c2b63955 add "remember" option
This works similar to "noforget" except that eventually the node will
be allowed to expire from the cache.
2011-06-02 14:27:02 +02:00
Miklos Szeredi
4a9f6ab480 Check if splice/vmsplice are supported 2011-05-27 12:12:31 +02:00
Reuben Hawkins
54f93a7a1d Spell checking comments, etc...
...with the help of vim :set spell

modified:   FAQ
modified:   include/fuse.h
modified:   include/fuse_common.h
modified:   include/fuse_opt.h
modified:   lib/fuse_kern_chan.c
modified:   util/fusermount.c
2011-05-25 11:30:43 +02:00
Miklos Szeredi
49e85dee59 Fix ioctl ABI
Fix the ambiguity of ioctl ABI on the kernel/userspace boundary
for 32bit vs. 64bit userspace
2011-05-19 15:36:20 +02:00
Miklos Szeredi
7819846300 Add ->forget_multi() operation
Add ->forget_multi() operation to the lowlevel API.  The filesystem
may implement this to process multiple forget requests in one call
2011-05-19 15:30:01 +02:00
Miklos Szeredi
d915a6b4a8 Allow batching of forget requests
This allows forget requests to be processed faster and doesn't require
a modification to fuse filesystems.  Reported by Terje Malmedal
2011-05-19 15:26:37 +02:00
Miklos Szeredi
9c526a7a54 Fix splice_read 2011-05-19 15:09:43 +02:00
Miklos Szeredi
a785697e03 Disable splice by default
Disable splice by default, add "splice_read", "splice_write" and
"splice_move" options.  Keep the "no_splice_*" variants, which can
disable splice even if the filesystem explicitly enables it.
2011-05-19 14:49:26 +02:00
Miklos Szeredi
d84fc1f429 Don't hide output of /bin/mount 2011-05-19 13:03:56 +02:00
Max Krasnyansky
9ca8283f6f libfuse: Added support for auto_unmount option
This change adds support for "auto_unmount" option to libfuse.
auto_umount option unmounts the fs automatically on application
termination, whether normal or not (segfault, etc).

When auto_unmount option is specified libfuse will alway use
fusermount for mounting the fs. This change is selfcontained but
for complete functionaly it requires auto_unmount support in
fusermount tool.
2011-04-15 15:10:04 -07:00
Laszlo Papp
20c31c48b4 Fix a potential null pointer dereference issue 2011-03-30 19:34:59 +02:00
Laszlo Papp
db5d46976b Fix a potential resource leak (newargv) 2011-03-30 19:34:58 +02:00
Laszlo Papp
c470934043 Initialize an allocated, but uninitialized memory 2011-03-30 19:34:58 +02:00
Laszlo Papp
9deaced060 Initialize the variable properly before passing to any function 2011-03-30 19:34:58 +02:00
Miklos Szeredi
2d96d62d3b Remove unnecessary variable assignment 2011-03-30 19:34:58 +02:00
Miklos Szeredi
7fdc732a19 Fix use after free if fuse_reply...() returned ENOENT 2011-03-30 19:34:58 +02:00
Laszlo Papp
3a48e06de9 Fix a possible resource leak (free the old up) 2011-03-30 19:34:58 +02:00
Laszlo Papp
2621a3a467 Fix a potential resource leak 2011-03-30 19:34:58 +02:00
Laszlo Papp
87a0a37be9 Use the return value for error check 2011-03-30 19:34:58 +02:00
Laszlo Papp
b812c4c406 Check the return value after an open syscall 2011-03-30 19:34:58 +02:00
Laszlo Papp
b0ceaa0670 Check the negative return value after an open syscall 2011-03-30 19:34:58 +02:00
Miklos Szeredi
337a2e4b24 Add -onoforget to help output 2011-02-17 14:22:38 +01:00
Miklos Szeredi
71b1c37a66 libfuse: fuse_session_loop_mt() shouldn't pause when exiting worker threads
In fuse_session_loop_mt() don't pause when exiting the worker threads.
The pause() was added in 2.2.1 to prevent segfault on pthread_cancel()
on an exited, detached thread.  Now worker threads are not detached
and pthread_cancel() should work fine even after the thread exited.
Reported by Boris Protopopov
2011-02-02 12:18:38 +01:00
Miklos Szeredi
cbd3a2a840 fusermount: only allow mount and umount if util-linux suppports --no-canonicalize
Remove "legacy" util-linux support as missing --no-canonicalize cannot
be worked around in fuse.
2011-01-31 16:33:22 +01:00
Miklos Szeredi
c958643e37 Fix warning in hash calculation
Fix the following warning:

  fuse.c:436: warning: this decimal constant is unsigned only in ISO C90
2011-01-31 12:18:06 +01:00
Miklos Szeredi
6646f6bed3 Highlevel lib: add slab allocation for node cache
This will allow the memory used by the filesystem to grow and shrink
depending on how many inodes are currently cached.
2010-12-20 18:50:13 +01:00
Miklos Szeredi
8a92fde75d inline short names
In the high level library store names shorter than 32 characters
inside "struct node".  Longer names are allocated as previously.
2010-12-20 18:50:13 +01:00
Miklos Szeredi
94c28cc658 Highlevel lib: allow hash tables to shrink
Allow hash tables to shrink as well as grow.
2010-12-20 18:50:13 +01:00
Miklos Szeredi
8ff63b9e9b Highlevel lib: use dynamically resized hash table
Use dynamically resized hash table for looking up by name and node ID.

The chosen implementation is linear hashing, which features gradual
rehashing when while the size of the table increases.
2010-12-13 15:46:37 +01:00
Miklos Szeredi
6332203885 add read_buf method to high level API
Add a new read_buf() method to the highlevel API.  This allows
returning a generic buffer from the read method, which in turn allows
zero copy reads.
2010-11-10 11:41:21 +01:00
Miklos Szeredi
df31f2b11e add write_buf method to high level API
Add new write_buf() method to the highlevel API.  Similarly to the
lowlevel write_buf() method, this allows implementing zero copy
writes.
2010-11-10 11:41:21 +01:00
Miklos Szeredi
4367f2df50 fuse_buf_copy: check if buffers are the same
When copying fuse buffers, check if the source and destination are the
same and omit the copy as appropriate.  Also check if the source and
destination memory regions overlap and use memmove in that case.
2010-11-10 11:41:21 +01:00