| 129 | } |
| 130 | |
| 131 | static int dfs_tmpfs_mount(struct dfs_mnt *mnt, |
| 132 | unsigned long rwflag, |
| 133 | const void *data) |
| 134 | { |
| 135 | struct tmpfs_sb *superblock; |
| 136 | |
| 137 | superblock = rt_calloc(1, sizeof(struct tmpfs_sb)); |
| 138 | if (superblock) |
| 139 | { |
| 140 | superblock->df_size = sizeof(struct tmpfs_sb); |
| 141 | superblock->magic = TMPFS_MAGIC; |
| 142 | |
| 143 | superblock->root.name[0] = '/'; |
| 144 | superblock->root.sb = superblock; |
| 145 | superblock->root.type = TMPFS_TYPE_DIR; |
| 146 | dfs_vfs_init_node(&superblock->root.node); |
| 147 | |
| 148 | rt_spin_lock_init(&superblock->lock); |
| 149 | |
| 150 | mnt->data = superblock; |
| 151 | } |
| 152 | else |
| 153 | { |
| 154 | return -1; |
| 155 | } |
| 156 | |
| 157 | return RT_EOK; |
| 158 | } |
| 159 | |
| 160 | static int dfs_tmpfs_unmount(struct dfs_mnt *mnt) |
| 161 | { |
nothing calls this directly
no test coverage detected