aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 12:03:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 12:03:54 -0500
commitc4bc705e45d91f900f7ec2e23a458280b084ae91 (patch)
tree54dc459057ddbcd33321d255b0a94f213dc43910 /include
parent2608e3d0fa63b892f37a9f1921c2d2b37c7933c1 (diff)
parent634734b63ac39e137a1c623ba74f3e062b6577db (diff)
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() ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/fs.h2
-rw-r--r--include/uapi/linux/fuse.h60
2 files changed, 58 insertions, 4 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 7617ee04f066..7d2e893ec3d1 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -301,7 +301,7 @@ size_t iov_iter_copy_from_user(struct page *page,
301 struct iov_iter *i, unsigned long offset, size_t bytes); 301 struct iov_iter *i, unsigned long offset, size_t bytes);
302void iov_iter_advance(struct iov_iter *i, size_t bytes); 302void iov_iter_advance(struct iov_iter *i, size_t bytes);
303int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes); 303int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes);
304size_t iov_iter_single_seg_count(struct iov_iter *i); 304size_t iov_iter_single_seg_count(const struct iov_iter *i);
305 305
306static inline void iov_iter_init(struct iov_iter *i, 306static inline void iov_iter_init(struct iov_iter *i,
307 const struct iovec *iov, unsigned long nr_segs, 307 const struct iovec *iov, unsigned long nr_segs,
diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h
index d8c713e148e3..4c43b4448792 100644
--- a/include/uapi/linux/fuse.h
+++ b/include/uapi/linux/fuse.h
@@ -1,9 +1,35 @@
1/* 1/*
2 FUSE: Filesystem in Userspace 2 This file defines the kernel interface of FUSE
3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu> 3 Copyright (C) 2001-2008 Miklos Szeredi <miklos@szeredi.hu>
4 4
5 This program can be distributed under the terms of the GNU GPL. 5 This program can be distributed under the terms of the GNU GPL.
6 See the file COPYING. 6 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.
7*/ 33*/
8 34
9/* 35/*
@@ -60,12 +86,25 @@
60 * 86 *
61 * 7.20 87 * 7.20
62 * - add FUSE_AUTO_INVAL_DATA 88 * - add FUSE_AUTO_INVAL_DATA
89 *
90 * 7.21
91 * - add FUSE_READDIRPLUS
92 * - send the requested events in POLL request
63 */ 93 */
64 94
65#ifndef _LINUX_FUSE_H 95#ifndef _LINUX_FUSE_H
66#define _LINUX_FUSE_H 96#define _LINUX_FUSE_H
67 97
98#ifdef __linux__
68#include <linux/types.h> 99#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
69 108
70/* 109/*
71 * Version negotiation: 110 * Version negotiation:
@@ -91,7 +130,7 @@
91#define FUSE_KERNEL_VERSION 7 130#define FUSE_KERNEL_VERSION 7
92 131
93/** Minor version number of this interface */ 132/** Minor version number of this interface */
94#define FUSE_KERNEL_MINOR_VERSION 20 133#define FUSE_KERNEL_MINOR_VERSION 21
95 134
96/** The node ID of the root inode */ 135/** The node ID of the root inode */
97#define FUSE_ROOT_ID 1 136#define FUSE_ROOT_ID 1
@@ -179,6 +218,8 @@ struct fuse_file_lock {
179 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks 218 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
180 * FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories 219 * FUSE_HAS_IOCTL_DIR: kernel supports ioctl on directories
181 * FUSE_AUTO_INVAL_DATA: automatically invalidate cached pages 220 * FUSE_AUTO_INVAL_DATA: automatically invalidate cached pages
221 * FUSE_DO_READDIRPLUS: do READDIRPLUS (READDIR+LOOKUP in one)
222 * FUSE_READDIRPLUS_AUTO: adaptive readdirplus
182 */ 223 */
183#define FUSE_ASYNC_READ (1 << 0) 224#define FUSE_ASYNC_READ (1 << 0)
184#define FUSE_POSIX_LOCKS (1 << 1) 225#define FUSE_POSIX_LOCKS (1 << 1)
@@ -193,6 +234,8 @@ struct fuse_file_lock {
193#define FUSE_FLOCK_LOCKS (1 << 10) 234#define FUSE_FLOCK_LOCKS (1 << 10)
194#define FUSE_HAS_IOCTL_DIR (1 << 11) 235#define FUSE_HAS_IOCTL_DIR (1 << 11)
195#define FUSE_AUTO_INVAL_DATA (1 << 12) 236#define FUSE_AUTO_INVAL_DATA (1 << 12)
237#define FUSE_DO_READDIRPLUS (1 << 13)
238#define FUSE_READDIRPLUS_AUTO (1 << 14)
196 239
197/** 240/**
198 * CUSE INIT request/reply flags 241 * CUSE INIT request/reply flags
@@ -299,6 +342,7 @@ enum fuse_opcode {
299 FUSE_NOTIFY_REPLY = 41, 342 FUSE_NOTIFY_REPLY = 41,
300 FUSE_BATCH_FORGET = 42, 343 FUSE_BATCH_FORGET = 42,
301 FUSE_FALLOCATE = 43, 344 FUSE_FALLOCATE = 43,
345 FUSE_READDIRPLUS = 44,
302 346
303 /* CUSE specific operations */ 347 /* CUSE specific operations */
304 CUSE_INIT = 4096, 348 CUSE_INIT = 4096,
@@ -580,7 +624,7 @@ struct fuse_poll_in {
580 __u64 fh; 624 __u64 fh;
581 __u64 kh; 625 __u64 kh;
582 __u32 flags; 626 __u32 flags;
583 __u32 padding; 627 __u32 events;
584}; 628};
585 629
586struct fuse_poll_out { 630struct fuse_poll_out {
@@ -630,6 +674,16 @@ struct fuse_dirent {
630#define FUSE_DIRENT_SIZE(d) \ 674#define FUSE_DIRENT_SIZE(d) \
631 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) 675 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
632 676
677struct 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
633struct fuse_notify_inval_inode_out { 687struct fuse_notify_inval_inode_out {
634 __u64 ino; 688 __u64 ino;
635 __s64 off; 689 __s64 off;