diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-14 14:42:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-14 14:42:26 -0400 |
commit | 41d9884c44237cd66e2bdbc412028b29196b344c (patch) | |
tree | 7a386f6de2f07c01f87f3a16965c9bb8b40f63c1 /include | |
parent | 63345b4794aef4ebe16502cfe35b02bc9822d763 (diff) | |
parent | dae3794fd603b92dcbac2859fe0bc7fe129a5188 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull more vfs stuff from Al Viro:
"O_TMPFILE ABI changes, Oleg's fput() series, misc cleanups, including
making simple_lookup() usable for filesystems with non-NULL s_d_op,
which allows us to get rid of quite a bit of ugliness"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
sunrpc: now we can just set ->s_d_op
cgroup: we can use simple_lookup() now
efivarfs: we can use simple_lookup() now
make simple_lookup() usable for filesystems that set ->s_d_op
configfs: don't open-code d_alloc_name()
__rpc_lookup_create_exclusive: pass string instead of qstr
rpc_create_*_dir: don't bother with qstr
llist: llist_add() can use llist_add_batch()
llist: fix/simplify llist_add() and llist_add_batch()
fput: turn "list_head delayed_fput_list" into llist_head
fs/file_table.c:fput(): add comment
Safer ABI for O_TMPFILE
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/fs.h | 2 | ||||
-rw-r--r-- | include/linux/llist.h | 19 | ||||
-rw-r--r-- | include/linux/sunrpc/rpc_pipe_fs.h | 4 | ||||
-rw-r--r-- | include/uapi/asm-generic/fcntl.h | 8 |
4 files changed, 14 insertions, 19 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index a35b10e9a680..981874773e85 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/stat.h> | 10 | #include <linux/stat.h> |
11 | #include <linux/cache.h> | 11 | #include <linux/cache.h> |
12 | #include <linux/list.h> | 12 | #include <linux/list.h> |
13 | #include <linux/llist.h> | ||
13 | #include <linux/radix-tree.h> | 14 | #include <linux/radix-tree.h> |
14 | #include <linux/rbtree.h> | 15 | #include <linux/rbtree.h> |
15 | #include <linux/init.h> | 16 | #include <linux/init.h> |
@@ -768,6 +769,7 @@ struct file { | |||
768 | */ | 769 | */ |
769 | union { | 770 | union { |
770 | struct list_head fu_list; | 771 | struct list_head fu_list; |
772 | struct llist_node fu_llist; | ||
771 | struct rcu_head fu_rcuhead; | 773 | struct rcu_head fu_rcuhead; |
772 | } f_u; | 774 | } f_u; |
773 | struct path f_path; | 775 | struct path f_path; |
diff --git a/include/linux/llist.h b/include/linux/llist.h index a5199f6d0e82..cdaa7f023899 100644 --- a/include/linux/llist.h +++ b/include/linux/llist.h | |||
@@ -142,6 +142,9 @@ static inline struct llist_node *llist_next(struct llist_node *node) | |||
142 | return node->next; | 142 | return node->next; |
143 | } | 143 | } |
144 | 144 | ||
145 | extern bool llist_add_batch(struct llist_node *new_first, | ||
146 | struct llist_node *new_last, | ||
147 | struct llist_head *head); | ||
145 | /** | 148 | /** |
146 | * llist_add - add a new entry | 149 | * llist_add - add a new entry |
147 | * @new: new entry to be added | 150 | * @new: new entry to be added |
@@ -151,18 +154,7 @@ static inline struct llist_node *llist_next(struct llist_node *node) | |||
151 | */ | 154 | */ |
152 | static inline bool llist_add(struct llist_node *new, struct llist_head *head) | 155 | static inline bool llist_add(struct llist_node *new, struct llist_head *head) |
153 | { | 156 | { |
154 | struct llist_node *entry, *old_entry; | 157 | return llist_add_batch(new, new, head); |
155 | |||
156 | entry = head->first; | ||
157 | for (;;) { | ||
158 | old_entry = entry; | ||
159 | new->next = entry; | ||
160 | entry = cmpxchg(&head->first, old_entry, new); | ||
161 | if (entry == old_entry) | ||
162 | break; | ||
163 | } | ||
164 | |||
165 | return old_entry == NULL; | ||
166 | } | 158 | } |
167 | 159 | ||
168 | /** | 160 | /** |
@@ -178,9 +170,6 @@ static inline struct llist_node *llist_del_all(struct llist_head *head) | |||
178 | return xchg(&head->first, NULL); | 170 | return xchg(&head->first, NULL); |
179 | } | 171 | } |
180 | 172 | ||
181 | extern bool llist_add_batch(struct llist_node *new_first, | ||
182 | struct llist_node *new_last, | ||
183 | struct llist_head *head); | ||
184 | extern struct llist_node *llist_del_first(struct llist_head *head); | 173 | extern struct llist_node *llist_del_first(struct llist_head *head); |
185 | 174 | ||
186 | #endif /* LLIST_H */ | 175 | #endif /* LLIST_H */ |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index a7b422b33eda..aa5b582cc471 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
@@ -73,12 +73,12 @@ extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *, | |||
73 | extern int rpc_queue_upcall(struct rpc_pipe *, struct rpc_pipe_msg *); | 73 | extern int rpc_queue_upcall(struct rpc_pipe *, struct rpc_pipe_msg *); |
74 | 74 | ||
75 | struct rpc_clnt; | 75 | struct rpc_clnt; |
76 | extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *); | 76 | extern struct dentry *rpc_create_client_dir(struct dentry *, const char *, struct rpc_clnt *); |
77 | extern int rpc_remove_client_dir(struct dentry *); | 77 | extern int rpc_remove_client_dir(struct dentry *); |
78 | 78 | ||
79 | struct cache_detail; | 79 | struct cache_detail; |
80 | extern struct dentry *rpc_create_cache_dir(struct dentry *, | 80 | extern struct dentry *rpc_create_cache_dir(struct dentry *, |
81 | struct qstr *, | 81 | const char *, |
82 | umode_t umode, | 82 | umode_t umode, |
83 | struct cache_detail *); | 83 | struct cache_detail *); |
84 | extern void rpc_remove_cache_dir(struct dentry *); | 84 | extern void rpc_remove_cache_dir(struct dentry *); |
diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h index 06632beaa6d5..05ac354e124d 100644 --- a/include/uapi/asm-generic/fcntl.h +++ b/include/uapi/asm-generic/fcntl.h | |||
@@ -84,10 +84,14 @@ | |||
84 | #define O_PATH 010000000 | 84 | #define O_PATH 010000000 |
85 | #endif | 85 | #endif |
86 | 86 | ||
87 | #ifndef O_TMPFILE | 87 | #ifndef __O_TMPFILE |
88 | #define O_TMPFILE 020000000 | 88 | #define __O_TMPFILE 020000000 |
89 | #endif | 89 | #endif |
90 | 90 | ||
91 | /* a horrid kludge trying to make sure that this will fail on old kernels */ | ||
92 | #define O_TMPFILE (__O_TMPFILE | O_DIRECTORY | O_RDWR) | ||
93 | #define O_TMPFILE_MASK (__O_TMPFILE | O_DIRECTORY | O_CREAT | O_ACCMODE) | ||
94 | |||
91 | #ifndef O_NDELAY | 95 | #ifndef O_NDELAY |
92 | #define O_NDELAY O_NONBLOCK | 96 | #define O_NDELAY O_NONBLOCK |
93 | #endif | 97 | #endif |