Lines Matching refs:superblock
103 struct tmpfs_sb *superblock; in _free_subdir() local
119 superblock = file->sb; in _free_subdir()
120 RT_ASSERT(superblock != NULL); in _free_subdir()
122 rt_spin_lock(&superblock->lock); in _free_subdir()
124 rt_spin_unlock(&superblock->lock); in _free_subdir()
135 struct tmpfs_sb *superblock; in dfs_tmpfs_mount() local
137 superblock = rt_calloc(1, sizeof(struct tmpfs_sb)); in dfs_tmpfs_mount()
138 if (superblock) in dfs_tmpfs_mount()
140 superblock->df_size = sizeof(struct tmpfs_sb); in dfs_tmpfs_mount()
141 superblock->magic = TMPFS_MAGIC; in dfs_tmpfs_mount()
143 superblock->root.name[0] = '/'; in dfs_tmpfs_mount()
144 superblock->root.sb = superblock; in dfs_tmpfs_mount()
145 superblock->root.type = TMPFS_TYPE_DIR; in dfs_tmpfs_mount()
146 dfs_vfs_init_node(&superblock->root.node); in dfs_tmpfs_mount()
148 rt_spin_lock_init(&superblock->lock); in dfs_tmpfs_mount()
150 mnt->data = superblock; in dfs_tmpfs_mount()
162 struct tmpfs_sb *superblock; in dfs_tmpfs_unmount() local
165 superblock = (struct tmpfs_sb *)mnt->data; in dfs_tmpfs_unmount()
166 RT_ASSERT(superblock != NULL); in dfs_tmpfs_unmount()
169 _free_subdir(&(superblock->root)); in dfs_tmpfs_unmount()
170 rt_free(superblock); in dfs_tmpfs_unmount()
177 struct tmpfs_sb *superblock; in dfs_tmpfs_statfs() local
179 superblock = (struct tmpfs_sb *)mnt->data; in dfs_tmpfs_statfs()
180 RT_ASSERT(superblock != NULL); in dfs_tmpfs_statfs()
184 buf->f_blocks = (superblock->df_size + 511) / 512; in dfs_tmpfs_statfs()
194 struct tmpfs_sb *superblock; in dfs_tmpfs_ioctl() local
199 superblock = d_file->sb; in dfs_tmpfs_ioctl()
200 RT_ASSERT(superblock != NULL); in dfs_tmpfs_ioctl()
201 RT_UNUSED(superblock); in dfs_tmpfs_ioctl()
229 struct tmpfs_file *dfs_tmpfs_lookup(struct tmpfs_sb *superblock, in dfs_tmpfs_lookup() argument
243 return &(superblock->root); in dfs_tmpfs_lookup()
247 curfile = &superblock->root; in dfs_tmpfs_lookup()
261 rt_spin_lock(&superblock->lock); in dfs_tmpfs_lookup()
271 rt_spin_unlock(&superblock->lock); in dfs_tmpfs_lookup()
280 rt_spin_unlock(&superblock->lock); in dfs_tmpfs_lookup()
284 rt_spin_unlock(&superblock->lock); in dfs_tmpfs_lookup()
316 struct tmpfs_sb *superblock; in _dfs_tmpfs_write() local
320 superblock = d_file->sb; in _dfs_tmpfs_write()
321 RT_ASSERT(superblock != NULL); in _dfs_tmpfs_write()
333 rt_spin_lock(&superblock->lock); in _dfs_tmpfs_write()
334 superblock->df_size += (*pos - d_file->size + count); in _dfs_tmpfs_write()
335 rt_spin_unlock(&superblock->lock); in _dfs_tmpfs_write()
468 struct tmpfs_sb *superblock; in dfs_tmpfs_stat() local
470 superblock = (struct tmpfs_sb *)dentry->mnt->data; in dfs_tmpfs_stat()
471 d_file = dfs_tmpfs_lookup(superblock, dentry->pathname, &size); in dfs_tmpfs_stat()
501 struct tmpfs_sb *superblock; in dfs_tmpfs_getdents() local
507 superblock = d_file->sb; in dfs_tmpfs_getdents()
508 RT_ASSERT(superblock != RT_NULL); in dfs_tmpfs_getdents()
509 RT_UNUSED(superblock); in dfs_tmpfs_getdents()
557 struct tmpfs_sb *superblock; in dfs_tmpfs_unlink() local
560 superblock = (struct tmpfs_sb *)dentry->mnt->data; in dfs_tmpfs_unlink()
561 RT_ASSERT(superblock != NULL); in dfs_tmpfs_unlink()
563 d_file = dfs_tmpfs_lookup(superblock, dentry->pathname, &size); in dfs_tmpfs_unlink()
567 rt_spin_lock(&superblock->lock); in dfs_tmpfs_unlink()
569 rt_spin_unlock(&superblock->lock); in dfs_tmpfs_unlink()
592 struct tmpfs_sb *superblock; in dfs_tmpfs_rename() local
597 superblock = (struct tmpfs_sb *)old_dentry->mnt->data; in dfs_tmpfs_rename()
598 RT_ASSERT(superblock != NULL); in dfs_tmpfs_rename()
600 d_file = dfs_tmpfs_lookup(superblock, new_dentry->pathname, &size); in dfs_tmpfs_rename()
604 d_file = dfs_tmpfs_lookup(superblock, old_dentry->pathname, &size); in dfs_tmpfs_rename()
622 p_file = dfs_tmpfs_lookup(superblock, parent_path, &size); in dfs_tmpfs_rename()
625 rt_spin_lock(&superblock->lock); in dfs_tmpfs_rename()
627 rt_spin_unlock(&superblock->lock); in dfs_tmpfs_rename()
631 rt_spin_lock(&superblock->lock); in dfs_tmpfs_rename()
633 rt_spin_unlock(&superblock->lock); in dfs_tmpfs_rename()
644 struct tmpfs_sb *superblock; in _dfs_tmpfs_lookup() local
652 superblock = (struct tmpfs_sb *)dentry->mnt->data; in _dfs_tmpfs_lookup()
654 d_file = dfs_tmpfs_lookup(superblock, dentry->pathname, &size); in _dfs_tmpfs_lookup()
687 struct tmpfs_sb *superblock; in dfs_tmpfs_create_vnode() local
697 superblock = (struct tmpfs_sb *)dentry->mnt->data; in dfs_tmpfs_create_vnode()
698 RT_ASSERT(superblock != NULL); in dfs_tmpfs_create_vnode()
719 p_file = dfs_tmpfs_lookup(superblock, parent_path, &size); in dfs_tmpfs_create_vnode()
736 superblock->df_size += sizeof(struct tmpfs_file); in dfs_tmpfs_create_vnode()
743 d_file->sb = superblock; in dfs_tmpfs_create_vnode()
760 rt_spin_lock(&superblock->lock); in dfs_tmpfs_create_vnode()
762 rt_spin_unlock(&superblock->lock); in dfs_tmpfs_create_vnode()
828 struct tmpfs_sb *superblock = RT_NULL; in dfs_tmpfs_truncate() local
834 superblock = d_file->sb; in dfs_tmpfs_truncate()
835 RT_ASSERT(superblock != RT_NULL); in dfs_tmpfs_truncate()
844 rt_spin_lock(&superblock->lock); in dfs_tmpfs_truncate()
845 superblock->df_size = offset; in dfs_tmpfs_truncate()
846 rt_spin_unlock(&superblock->lock); in dfs_tmpfs_truncate()