diff options
Diffstat (limited to 'fs/aio.c')
-rw-r--r-- | fs/aio.c | 20 |
1 files changed, 4 insertions, 16 deletions
@@ -215,9 +215,7 @@ static const struct address_space_operations aio_ctx_aops; | |||
215 | 215 | ||
216 | static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) | 216 | static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) |
217 | { | 217 | { |
218 | struct qstr this = QSTR_INIT("[aio]", 5); | ||
219 | struct file *file; | 218 | struct file *file; |
220 | struct path path; | ||
221 | struct inode *inode = alloc_anon_inode(aio_mnt->mnt_sb); | 219 | struct inode *inode = alloc_anon_inode(aio_mnt->mnt_sb); |
222 | if (IS_ERR(inode)) | 220 | if (IS_ERR(inode)) |
223 | return ERR_CAST(inode); | 221 | return ERR_CAST(inode); |
@@ -226,27 +224,17 @@ static struct file *aio_private_file(struct kioctx *ctx, loff_t nr_pages) | |||
226 | inode->i_mapping->private_data = ctx; | 224 | inode->i_mapping->private_data = ctx; |
227 | inode->i_size = PAGE_SIZE * nr_pages; | 225 | inode->i_size = PAGE_SIZE * nr_pages; |
228 | 226 | ||
229 | path.dentry = d_alloc_pseudo(aio_mnt->mnt_sb, &this); | 227 | file = alloc_file_pseudo(inode, aio_mnt, "[aio]", |
230 | if (!path.dentry) { | 228 | O_RDWR, &aio_ring_fops); |
231 | iput(inode); | ||
232 | return ERR_PTR(-ENOMEM); | ||
233 | } | ||
234 | path.mnt = mntget(aio_mnt); | ||
235 | |||
236 | d_instantiate(path.dentry, inode); | ||
237 | file = alloc_file(&path, O_RDWR, &aio_ring_fops); | ||
238 | if (IS_ERR(file)) | 229 | if (IS_ERR(file)) |
239 | path_put(&path); | 230 | iput(inode); |
240 | return file; | 231 | return file; |
241 | } | 232 | } |
242 | 233 | ||
243 | static struct dentry *aio_mount(struct file_system_type *fs_type, | 234 | static struct dentry *aio_mount(struct file_system_type *fs_type, |
244 | int flags, const char *dev_name, void *data) | 235 | int flags, const char *dev_name, void *data) |
245 | { | 236 | { |
246 | static const struct dentry_operations ops = { | 237 | struct dentry *root = mount_pseudo(fs_type, "aio:", NULL, NULL, |
247 | .d_dname = simple_dname, | ||
248 | }; | ||
249 | struct dentry *root = mount_pseudo(fs_type, "aio:", NULL, &ops, | ||
250 | AIO_RING_MAGIC); | 238 | AIO_RING_MAGIC); |
251 | 239 | ||
252 | if (!IS_ERR(root)) | 240 | if (!IS_ERR(root)) |