Lines Matching full:file

13 #include <linux/file.h>
78 static struct file *__anon_inode_getfile(const char *name, in __anon_inode_getfile()
85 struct file *file; in __anon_inode_getfile() local
93 file = ERR_CAST(inode); in __anon_inode_getfile()
99 file = ERR_PTR(-ENODEV); in __anon_inode_getfile()
109 file = alloc_file_pseudo(inode, anon_inode_mnt, name, in __anon_inode_getfile()
111 if (IS_ERR(file)) in __anon_inode_getfile()
114 file->f_mapping = inode->i_mapping; in __anon_inode_getfile()
116 file->private_data = priv; in __anon_inode_getfile()
118 return file; in __anon_inode_getfile()
124 return file; in __anon_inode_getfile()
128 * anon_inode_getfile - creates a new file instance by hooking it up to an
130 * of the file
132 * @name: [in] name of the "class" of the new file
133 * @fops: [in] file operations for the new file
134 * @priv: [in] private data for the new file (will be file's private_data)
137 * Creates a new file by hooking it on a single inode. This is useful for files
140 * hence saving memory and avoiding code duplication for the file/inode/dentry
141 * setup. Returns the newly created file* or an error pointer.
143 struct file *anon_inode_getfile(const char *name, in anon_inode_getfile()
157 * @name: [in] name of the "class" of the new file
158 * @fops: [in] file operations for the new file
159 * @priv: [in] private data for the new file (will be file's private_data)
164 * Create a new anonymous inode and file pair. This can be done for two
176 * Returns the newly created file* or an error pointer.
178 struct file *anon_inode_create_getfile(const char *name, in anon_inode_create_getfile()
195 struct file *file; in __anon_inode_getfd() local
202 file = __anon_inode_getfile(name, fops, priv, flags, context_inode, in __anon_inode_getfd()
204 if (IS_ERR(file)) { in __anon_inode_getfd()
205 error = PTR_ERR(file); in __anon_inode_getfd()
208 fd_install(fd, file); in __anon_inode_getfd()
218 * anon_inode_getfd - creates a new file instance by hooking it up to
220 * the "class" of the file
222 * @name: [in] name of the "class" of the new file
223 * @fops: [in] file operations for the new file
224 * @priv: [in] private data for the new file (will be file's private_data)
227 * Creates a new file by hooking it on a single inode. This is
231 * memory use and avoiding code duplication for the file/inode/dentry
232 * setup. Returns a newly created file descriptor or an error code.
246 * @name: [in] name of the "class" of the new file
247 * @fops: [in] file operations for the new file
248 * @priv: [in] private data for the new file (will be file's private_data)
253 * Create a new anonymous inode and file pair. This can be done for two
265 * Returns a newly created file descriptor or an error code.