Lines Matching full:file

12 #include <linux/file.h>
69 * anon_inode_getfile - creates a new file instance by hooking it up to an
71 * of the file
73 * @name: [in] name of the "class" of the new file
74 * @fops: [in] file operations for the new file
75 * @priv: [in] private data for the new file (will be file's private_data)
78 * Creates a new file by hooking it on a single inode. This is useful for files
81 * hence saving memory and avoiding code duplication for the file/inode/dentry
82 * setup. Returns the newly created file* or an error pointer.
84 struct file *anon_inode_getfile(const char *name, in anon_inode_getfile()
90 struct file *file; in anon_inode_getfile() local
121 file = alloc_file(&path, OPEN_FMODE(flags), fops); in anon_inode_getfile()
122 if (!file) in anon_inode_getfile()
124 file->f_mapping = anon_inode_inode->i_mapping; in anon_inode_getfile()
126 file->f_pos = 0; in anon_inode_getfile()
127 file->f_flags = flags & (O_ACCMODE | O_NONBLOCK); in anon_inode_getfile()
128 file->f_version = 0; in anon_inode_getfile()
129 file->private_data = priv; in anon_inode_getfile()
131 return file; in anon_inode_getfile()
142 * anon_inode_getfd - creates a new file instance by hooking it up to an
144 * of the file
146 * @name: [in] name of the "class" of the new file
147 * @fops: [in] file operations for the new file
148 * @priv: [in] private data for the new file (will be file's private_data)
151 * Creates a new file by hooking it on a single inode. This is useful for files
154 * hence saving memory and avoiding code duplication for the file/inode/dentry
161 struct file *file; in anon_inode_getfd() local
168 file = anon_inode_getfile(name, fops, priv, flags); in anon_inode_getfd()
169 if (IS_ERR(file)) { in anon_inode_getfd()
170 error = PTR_ERR(file); in anon_inode_getfd()
173 fd_install(fd, file); in anon_inode_getfd()