History

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse

Pull fuse updates from Miklos Szeredi: "The biggest part of this pull request is a patch series from Maxim Patlasov to optimize scatter-gather direct IO. There's also the addition of a "readdirplus" API, poll events and various fixes and cleanups. There's a one line change outside of fuse to mm/filemap.c which makes the argument of iov_iter_single_seg_count() const, required by Maxim's patches." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse: (22 commits) fuse: allow control of adaptive readdirplus use Synchronize fuse header with one used in library fuse: send poll events fuse: don't WARN when nlink is zero fuse: avoid out-of-scope stack access fuse: bump version for READDIRPLUS FUSE: Adapt readdirplus to application usage patterns Do not use RCU for current process credentials fuse: cleanup fuse_direct_io() fuse: optimize __fuse_direct_io() fuse: optimize fuse_get_user_pages() fuse: pass iov[] to fuse_get_user_pages() mm: minor cleanup of iov_iter_single_seg_count() fuse: use req->page_descs[] for argpages cases fuse: add per-page descriptor <offset, length> to fuse_req fuse: rework fuse_do_ioctl() fuse: rework fuse_perform_write() fuse: rework fuse_readpages() fuse: rework fuse_retrieve() fuse: categorize fuse_get_req() ...

Linus Torvalds committed 13 years ago

Commit c4bc7052 parents 2608e3d 634734b9 files · +609 −180Browse files

Showing the changes to include/uapi/linux (1 of 9 files). Show all

Unified · Split

include/uapi/linux/fuse.h+57−3
@@ -1,9 +1,35 @@
11 /*
2− FUSE: Filesystem in Userspace
2+ This file defines the kernel interface of FUSE
33 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
44
55 This program can be distributed under the terms of the GNU GPL.
66 See the file COPYING.
7+
8+ This -- and only this -- header file may also be distributed under
9+ the terms of the BSD Licence as follows:
10+
11+ Copyright (C) 2001-2007 Miklos Szeredi. All rights reserved.
12+
13+ Redistribution and use in source and binary forms, with or without
14+ modification, are permitted provided that the following conditions
15+ are met:
16+ 1. Redistributions of source code must retain the above copyright
17+ notice, this list of conditions and the following disclaimer.
18+ 2. Redistributions in binary form must reproduce the above copyright
19+ notice, this list of conditions and the following disclaimer in the
20+ documentation and/or other materials provided with the distribution.
21+
22+ THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25+ ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
26+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32+ SUCH DAMAGE.
733 */
834
935 /*
@@ -60,12 +86,25 @@ · 50 unmodified lines
6086 *
6187 * 7.20
6288 * - add FUSE_AUTO_INVAL_DATA
89+ *
90+ * 7.21
91+ * - add FUSE_READDIRPLUS
92+ * - send the requested events in POLL request
6393 */
6494
6595 #ifndef _LINUX_FUSE_H
6696 #define _LINUX_FUSE_H
6797
98+#ifdef __linux__
6899 #include <linux/types.h>
100+#else
101+#include <stdint.h>
102+#define __u64 uint64_t
103+#define __s64 int64_t
104+#define __u32 uint32_t
105+#define __s32 int32_t
106+#define __u16 uint16_t
107+#endif
69108
70109 /*
71110 * Version negotiation:
@@ -91,7 +130,7 @@ · 19 unmodified lines
91130 #define FUSE_KERNEL_VERSION 7
92131
93132 /** Minor version number of this interface */
94−#define FUSE_KERNEL_MINOR_VERSION 20
133+#define FUSE_KERNEL_MINOR_VERSION 21
95134
96135 /** The node ID of the root inode */
97136 #define FUSE_ROOT_ID 1
@@ -179,6 +218,8 @@ struct fuse_file_lock { · 81 unmodified lines
179218 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
180219 * FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories
181220 * FUSE_AUTO_INVAL_DATA: automatically invalidate cached pages
221+ * FUSE_DO_READDIRPLUS: do READDIRPLUS (READDIR+LOOKUP in one)
222+ * FUSE_READDIRPLUS_AUTO: adaptive readdirplus
182223 */
183224 #define FUSE_ASYNC_READ (1 << 0)
184225 #define FUSE_POSIX_LOCKS (1 << 1)
@@ -193,6 +234,8 @@ struct fuse_file_lock { · 8 unmodified lines
193234 #define FUSE_FLOCK_LOCKS (1 << 10)
194235 #define FUSE_HAS_IOCTL_DIR (1 << 11)
195236 #define FUSE_AUTO_INVAL_DATA (1 << 12)
237+#define FUSE_DO_READDIRPLUS (1 << 13)
238+#define FUSE_READDIRPLUS_AUTO (1 << 14)
196239
197240 /**
198241 * CUSE INIT request/reply flags
@@ -299,6 +342,7 @@ enum fuse_opcode { · 100 unmodified lines
299342 FUSE_NOTIFY_REPLY = 41,
300343 FUSE_BATCH_FORGET = 42,
301344 FUSE_FALLOCATE = 43,
345+ FUSE_READDIRPLUS = 44,
302346
303347 /* CUSE specific operations */
304348 CUSE_INIT = 4096,
@@ -580,7 +624,7 @@ struct fuse_poll_in { · 275 unmodified lines
580624 __u64 fh;
581625 __u64 kh;
582626 __u32 flags;
583− __u32 padding;
627+ __u32 events;
584628 };
585629
586630 struct fuse_poll_out {
@@ -630,6 +674,16 @@ struct fuse_dirent { · 43 unmodified lines
630674 #define FUSE_DIRENT_SIZE(d) \
631675 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
632676
677+struct fuse_direntplus {
678+ struct fuse_entry_out entry_out;
679+ struct fuse_dirent dirent;
680+};
681+
682+#define FUSE_NAME_OFFSET_DIRENTPLUS \
683+ offsetof(struct fuse_direntplus, dirent.name)
684+#define FUSE_DIRENTPLUS_SIZE(d) \
685+ FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET_DIRENTPLUS + (d)->dirent.namelen)
686+
633687 struct fuse_notify_inval_inode_out {
634688 __u64 ino;
635689 __s64 off;