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,
141 struct file *file;
150 file = ERR_CAST(inode);
156 file = ERR_PTR(-ENODEV);
166 file = alloc_file_pseudo(inode, anon_inode_mnt, name,
168 if (IS_ERR(file))
171 file->f_mapping = inode->i_mapping;
173 file->private_data = priv;
175 return file;
181 return file;
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,
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,
230 struct file *file;
232 file = __anon_inode_getfile(name, fops, priv, flags, NULL, false);
233 if (!IS_ERR(file))
234 file->f_mode |= f_mode;
236 return file;
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,
284 struct file *file;
291 file = __anon_inode_getfile(name, fops, priv, flags, context_inode,
293 if (IS_ERR(file)) {
294 error = PTR_ERR(file);
297 fd_install(fd, file);
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.