aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/file.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-06-09 09:40:05 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2018-07-12 10:04:23 -0400
commitd93aa9d82aea80b80f225dbf9c7986df444d8106 (patch)
tree887b5626f375e6745e034e227eb0c583fbefad99 /include/linux/file.h
parentdbae8f2ca2f0586f4b80201c78ff0aed2a012ab5 (diff)
new wrapper: alloc_file_pseudo()
takes inode, vfsmount, name, O_... flags and file_operations and either returns a new struct file (in which case inode reference we held is consumed) or returns ERR_PTR(), in which case no refcounts are altered. converted aio_private_file() and sock_alloc_file() to it Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/file.h')
-rw-r--r--include/linux/file.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/file.h b/include/linux/file.h
index aed45d69811e..5b25388f2f79 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -17,9 +17,12 @@ extern void fput(struct file *);
17struct file_operations; 17struct file_operations;
18struct vfsmount; 18struct vfsmount;
19struct dentry; 19struct dentry;
20struct inode;
20struct path; 21struct path;
21extern struct file *alloc_file(const struct path *, int flags, 22extern struct file *alloc_file(const struct path *, int flags,
22 const struct file_operations *fop); 23 const struct file_operations *fop);
24extern struct file *alloc_file_pseudo(struct inode *, struct vfsmount *,
25 const char *, int flags, const struct file_operations *);
23 26
24static inline void fput_light(struct file *file, int fput_needed) 27static inline void fput_light(struct file *file, int fput_needed)
25{ 28{