Lines Matching defs:file
13 #include <linux/file.h>
78 static struct file *__anon_inode_getfile(const char *name,
85 struct file *file;
93 file = ERR_CAST(inode);
99 file = ERR_PTR(-ENODEV);
109 file = alloc_file_pseudo(inode, anon_inode_mnt, name,
111 if (IS_ERR(file))
114 file->f_mapping = inode->i_mapping;
116 file->private_data = priv;
118 return file;
124 return file;
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,
160 * @name: [in] name of the "class" of the new file
161 * @fops: [in] file operations for the new file
162 * @priv: [in] private data for the new file (will be file's private_data)
168 * reference to it is not held. Returns the newly created file* or an error
171 struct file *anon_inode_getfile_secure(const char *name,
187 struct file *file;
194 file = __anon_inode_getfile(name, fops, priv, flags, context_inode,
196 if (IS_ERR(file)) {
197 error = PTR_ERR(file);
200 fd_install(fd, file);
210 * anon_inode_getfd - creates a new file instance by hooking it up to
212 * the "class" of the file
214 * @name: [in] name of the "class" of the new file
215 * @fops: [in] file operations for the new file
216 * @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
223 * memory use and avoiding code duplication for the file/inode/dentry
224 * setup. Returns a newly created file descriptor or an error code.
239 * @name: [in] name of the "class" of the new file
240 * @fops: [in] file operations for the new file
241 * @priv: [in] private data for the new file (will be file's private_data)