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()
152 * anon_inode_getfile_fmode - creates a new file instance by hooking it up to an
154 * of the file
156 * @name: [in] name of the "class" of the new file
157 * @fops: [in] file operations for the new file
158 * @priv: [in] private data for the new file (will be file's private_data)
162 * Creates a new file by hooking it on a single inode. This is useful for files
165 * hence saving memory and avoiding code duplication for the file/inode/dentry
166 * setup. Allows setting the fmode. Returns the newly created file* or an error
169 struct file *anon_inode_getfile_fmode(const char *name, in anon_inode_getfile_fmode()
173 struct file *file; in anon_inode_getfile_fmode() local
175 file = __anon_inode_getfile(name, fops, priv, flags, NULL, false); in anon_inode_getfile_fmode()
176 if (!IS_ERR(file)) in anon_inode_getfile_fmode()
177 file->f_mode |= f_mode; in anon_inode_getfile_fmode()
179 return file; in anon_inode_getfile_fmode()
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)
196 * Create a new anonymous inode and file pair. This can be done for two
208 * Returns the newly created file* or an error pointer.
210 struct file *anon_inode_create_getfile(const char *name, in anon_inode_create_getfile()
227 struct file *file; in __anon_inode_getfd() local
234 file = __anon_inode_getfile(name, fops, priv, flags, context_inode, in __anon_inode_getfd()
236 if (IS_ERR(file)) { in __anon_inode_getfd()
237 error = PTR_ERR(file); in __anon_inode_getfd()
240 fd_install(fd, file); in __anon_inode_getfd()
250 * anon_inode_getfd - creates a new file instance by hooking it up to
252 * the "class" of the file
254 * @name: [in] name of the "class" of the new file
255 * @fops: [in] file operations for the new file
256 * @priv: [in] private data for the new file (will be file's private_data)
259 * Creates a new file by hooking it on a single inode. This is
263 * memory use and avoiding code duplication for the file/inode/dentry
264 * setup. Returns a newly created file descriptor or an error code.
278 * @name: [in] name of the "class" of the new file
279 * @fops: [in] file operations for the new file
280 * @priv: [in] private data for the new file (will be file's private_data)
285 * Create a new anonymous inode and file pair. This can be done for two
297 * Returns a newly created file descriptor or an error code.