13 #include <linux/poll.h>
14 #include <linux/sched.h>
18 #include <linux/module.h>
19 #include <linux/kernel.h>
20 #include <linux/magic.h>
23 #include <asm/uaccess.h>
26 static struct inode *anon_inode_inode;
39 .d_dname = anon_inodefs_dname,
46 static int anon_set_page_dirty(
struct page *
page)
52 .set_page_dirty = anon_set_page_dirty,
68 inode->
i_fop = &anon_inode_fops;
88 int flags,
const char *dev_name,
void *
data)
95 anon_inode_inode = anon_inode_mkinode(s);
96 if (IS_ERR(anon_inode_inode)) {
99 root = ERR_CAST(anon_inode_inode);
106 .name =
"anon_inodefs",
107 .mount = anon_inodefs_mount,
129 void *
priv,
int flags)
136 if (IS_ERR(anon_inode_inode))
139 if (fops->
owner && !try_module_get(fops->
owner))
159 ihold(anon_inode_inode);
179 module_put(fops->
owner);
180 return ERR_PTR(error);
201 void *
priv,
int flags)
213 error = PTR_ERR(file);
214 goto err_put_unused_fd;
226 static int __init anon_inode_init(
void)
233 anon_inode_mnt =
kern_mount(&anon_inode_fs_type);
234 if (IS_ERR(anon_inode_mnt)) {
235 error = PTR_ERR(anon_inode_mnt);
236 goto err_unregister_filesystem;
240 err_unregister_filesystem: