Lines Matching full:file
13 #include <linux/file.h>
33 * User space expects anonymous inodes to have no file type in st_mode.
134 static struct file *__anon_inode_getfile(const char *name, in __anon_inode_getfile()
141 struct file *file; in __anon_inode_getfile() local
150 file = ERR_CAST(inode); in __anon_inode_getfile()
156 file = ERR_PTR(-ENODEV); in __anon_inode_getfile()
166 file = alloc_file_pseudo(inode, anon_inode_mnt, name, in __anon_inode_getfile()
168 if (IS_ERR(file)) in __anon_inode_getfile()
171 file->f_mapping = inode->i_mapping; in __anon_inode_getfile()
173 file->private_data = priv; in __anon_inode_getfile()
175 return file; in __anon_inode_getfile()
181 return file; in __anon_inode_getfile()
185 * anon_inode_getfile - creates a new file instance by hooking it up to an
187 * of the file
189 * @name: [in] name of the "class" of the new file
190 * @fops: [in] file operations for the new file
191 * @priv: [in] private data for the new file (will be file's private_data)
194 * Creates a new file by hooking it on a single inode. This is useful for files
197 * hence saving memory and avoiding code duplication for the file/inode/dentry
198 * setup. Returns the newly created file* or an error pointer.
200 struct file *anon_inode_getfile(const char *name, in anon_inode_getfile()
209 * anon_inode_getfile_fmode - creates a new file instance by hooking it up to an
211 * of the file
213 * @name: [in] name of the "class" of the new file
214 * @fops: [in] file operations for the new file
215 * @priv: [in] private data for the new file (will be file's private_data)
219 * Creates a new file by hooking it on a single inode. This is useful for files
222 * hence saving memory and avoiding code duplication for the file/inode/dentry
223 * setup. Allows setting the fmode. Returns the newly created file* or an error
226 struct file *anon_inode_getfile_fmode(const char *name, in anon_inode_getfile_fmode()
230 struct file *file; in anon_inode_getfile_fmode() local
232 file = __anon_inode_getfile(name, fops, priv, flags, NULL, false); in anon_inode_getfile_fmode()
233 if (!IS_ERR(file)) in anon_inode_getfile_fmode()
234 file->f_mode |= f_mode; in anon_inode_getfile_fmode()
236 return file; in anon_inode_getfile_fmode()
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 the newly created file* or an error pointer.
267 struct file *anon_inode_create_getfile(const char *name, in anon_inode_create_getfile()
284 struct file *file; in __anon_inode_getfd() local
291 file = __anon_inode_getfile(name, fops, priv, flags, context_inode, in __anon_inode_getfd()
293 if (IS_ERR(file)) { in __anon_inode_getfd()
294 error = PTR_ERR(file); in __anon_inode_getfd()
297 fd_install(fd, file); in __anon_inode_getfd()
307 * anon_inode_getfd - creates a new file instance by hooking it up to
309 * the "class" of the file
311 * @name: [in] name of the "class" of the new file
312 * @fops: [in] file operations for the new file
313 * @priv: [in] private data for the new file (will be file's private_data)
316 * Creates a new file by hooking it on a single inode. This is
320 * memory use and avoiding code duplication for the file/inode/dentry
321 * setup. Returns a newly created file descriptor or an error code.
335 * @name: [in] name of the "class" of the new file
336 * @fops: [in] file operations for the new file
337 * @priv: [in] private data for the new file (will be file's private_data)
342 * Create a new anonymous inode and file pair. This can be done for two
354 * Returns a newly created file descriptor or an error code.