| 141 | #endif |
| 142 | |
| 143 | static int devtmpfs_mount(struct dfs_mnt *mnt, unsigned long rwflag, const void *data) |
| 144 | { |
| 145 | struct devtmpfs_sb *superblock; |
| 146 | |
| 147 | superblock = rt_calloc(1, sizeof(struct devtmpfs_sb)); |
| 148 | if (superblock) |
| 149 | { |
| 150 | superblock->df_size = sizeof(struct devtmpfs_sb); |
| 151 | superblock->magic = TMPFS_MAGIC; |
| 152 | |
| 153 | superblock->root.name[0] = '/'; |
| 154 | superblock->root.sb = superblock; |
| 155 | superblock->root.type = TMPFS_TYPE_DIR; |
| 156 | superblock->root.mode = S_IFDIR | (S_IRUSR | S_IRGRP | S_IROTH) | (S_IXUSR | S_IXGRP | S_IXOTH); |
| 157 | dfs_vfs_init_node(&superblock->root.node); |
| 158 | |
| 159 | rt_spin_lock_init(&superblock->lock); |
| 160 | |
| 161 | mnt->data = superblock; |
| 162 | } |
| 163 | else |
| 164 | { |
| 165 | return -RT_ERROR; |
| 166 | } |
| 167 | |
| 168 | return RT_EOK; |
| 169 | } |
| 170 | |
| 171 | static int devtmpfs_unmount(struct dfs_mnt *mnt) |
| 172 | { |
nothing calls this directly
no test coverage detected