summaryrefslogtreecommitdiffstats
path: root/fs/anon_inodes.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-10-09 10:26:28 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-11-09 00:16:28 -0500
commit078d8e624c1837aa8ad65e58054a4a40d7ac46d2 (patch)
tree4fa10d13a053a1431d1f833b5b558a6ca2e01f34 /fs/anon_inodes.c
parent71ad7490c1f32bd7829df76360f9fa17829868f3 (diff)
... and kill anon_inode_getfile_private()
it's a seriously misguided API, now fortunately without users. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/anon_inodes.c')
-rw-r--r--fs/anon_inodes.c66
1 files changed, 0 insertions, 66 deletions
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index 22f9698a1214..24084732b1d0 100644
--- a/fs/anon_inodes.c
+++ b/fs/anon_inodes.c
@@ -63,72 +63,6 @@ static struct file_system_type anon_inode_fs_type = {
63}; 63};
64 64
65/** 65/**
66 * anon_inode_getfile_private - creates a new file instance by hooking it up to an
67 * anonymous inode, and a dentry that describe the "class"
68 * of the file
69 *
70 * @name: [in] name of the "class" of the new file
71 * @fops: [in] file operations for the new file
72 * @priv: [in] private data for the new file (will be file's private_data)
73 * @flags: [in] flags
74 *
75 *
76 * Similar to anon_inode_getfile, but each file holds a single inode.
77 *
78 */
79struct file *anon_inode_getfile_private(const char *name,
80 const struct file_operations *fops,
81 void *priv, int flags)
82{
83 struct qstr this;
84 struct path path;
85 struct file *file;
86 struct inode *inode;
87
88 if (fops->owner && !try_module_get(fops->owner))
89 return ERR_PTR(-ENOENT);
90
91 inode = alloc_anon_inode(anon_inode_mnt->mnt_sb);
92 if (IS_ERR(inode)) {
93 file = ERR_PTR(-ENOMEM);
94 goto err_module;
95 }
96
97 /*
98 * Link the inode to a directory entry by creating a unique name
99 * using the inode sequence number.
100 */
101 file = ERR_PTR(-ENOMEM);
102 this.name = name;
103 this.len = strlen(name);
104 this.hash = 0;
105 path.dentry = d_alloc_pseudo(anon_inode_mnt->mnt_sb, &this);
106 if (!path.dentry)
107 goto err_module;
108
109 path.mnt = mntget(anon_inode_mnt);
110
111 d_instantiate(path.dentry, inode);
112
113 file = alloc_file(&path, OPEN_FMODE(flags), fops);
114 if (IS_ERR(file))
115 goto err_dput;
116
117 file->f_mapping = inode->i_mapping;
118 file->f_flags = flags & (O_ACCMODE | O_NONBLOCK);
119 file->private_data = priv;
120
121 return file;
122
123err_dput:
124 path_put(&path);
125err_module:
126 module_put(fops->owner);
127 return file;
128}
129EXPORT_SYMBOL_GPL(anon_inode_getfile_private);
130
131/**
132 * anon_inode_getfile - creates a new file instance by hooking it up to an 66 * anon_inode_getfile - creates a new file instance by hooking it up to an
133 * anonymous inode, and a dentry that describe the "class" 67 * anonymous inode, and a dentry that describe the "class"
134 * of the file 68 * of the file