Lines Matching refs:sb
75 static struct inode *kernfs_fh_get_inode(struct super_block *sb, in kernfs_fh_get_inode() argument
78 struct kernfs_super_info *info = kernfs_info(sb); in kernfs_fh_get_inode()
88 inode = kernfs_get_inode(sb, kn); in kernfs_fh_get_inode()
101 static struct dentry *kernfs_fh_to_dentry(struct super_block *sb, struct fid *fid, in kernfs_fh_to_dentry() argument
104 return generic_fh_to_dentry(sb, fid, fh_len, fh_type, in kernfs_fh_to_dentry()
108 static struct dentry *kernfs_fh_to_parent(struct super_block *sb, struct fid *fid, in kernfs_fh_to_parent() argument
111 return generic_fh_to_parent(sb, fid, fh_len, fh_type, in kernfs_fh_to_parent()
135 struct kernfs_root *kernfs_root_from_sb(struct super_block *sb) in kernfs_root_from_sb() argument
137 if (sb->s_op == &kernfs_sops) in kernfs_root_from_sb()
138 return kernfs_info(sb)->root; in kernfs_root_from_sb()
173 struct super_block *sb) in kernfs_node_dentry() argument
178 BUG_ON(sb->s_op != &kernfs_sops); in kernfs_node_dentry()
180 dentry = dget(sb->s_root); in kernfs_node_dentry()
213 static int kernfs_fill_super(struct super_block *sb, struct kernfs_fs_context *kfc) in kernfs_fill_super() argument
215 struct kernfs_super_info *info = kernfs_info(sb); in kernfs_fill_super()
219 info->sb = sb; in kernfs_fill_super()
221 sb->s_iflags |= SB_I_NOEXEC | SB_I_NODEV; in kernfs_fill_super()
222 sb->s_blocksize = PAGE_SIZE; in kernfs_fill_super()
223 sb->s_blocksize_bits = PAGE_SHIFT; in kernfs_fill_super()
224 sb->s_magic = kfc->magic; in kernfs_fill_super()
225 sb->s_op = &kernfs_sops; in kernfs_fill_super()
226 sb->s_xattr = kernfs_xattr_handlers; in kernfs_fill_super()
228 sb->s_export_op = &kernfs_export_ops; in kernfs_fill_super()
229 sb->s_time_gran = 1; in kernfs_fill_super()
232 sb->s_shrink.seeks = 0; in kernfs_fill_super()
236 inode = kernfs_get_inode(sb, info->root->kn); in kernfs_fill_super()
249 sb->s_root = root; in kernfs_fill_super()
250 sb->s_d_op = &kernfs_dops; in kernfs_fill_super()
254 static int kernfs_test_super(struct super_block *sb, struct fs_context *fc) in kernfs_test_super() argument
256 struct kernfs_super_info *sb_info = kernfs_info(sb); in kernfs_test_super()
262 static int kernfs_set_super(struct super_block *sb, struct fs_context *fc) in kernfs_set_super() argument
267 return set_anon_super_fc(sb, fc); in kernfs_set_super()
276 const void *kernfs_super_ns(struct super_block *sb) in kernfs_super_ns() argument
278 struct kernfs_super_info *info = kernfs_info(sb); in kernfs_super_ns()
295 struct super_block *sb; in kernfs_get_tree() local
308 sb = sget_fc(fc, kernfs_test_super, kernfs_set_super); in kernfs_get_tree()
309 if (IS_ERR(sb)) in kernfs_get_tree()
310 return PTR_ERR(sb); in kernfs_get_tree()
312 if (!sb->s_root) { in kernfs_get_tree()
313 struct kernfs_super_info *info = kernfs_info(sb); in kernfs_get_tree()
317 error = kernfs_fill_super(sb, kfc); in kernfs_get_tree()
319 deactivate_locked_super(sb); in kernfs_get_tree()
322 sb->s_flags |= SB_ACTIVE; in kernfs_get_tree()
329 fc->root = dget(sb->s_root); in kernfs_get_tree()
348 void kernfs_kill_sb(struct super_block *sb) in kernfs_kill_sb() argument
350 struct kernfs_super_info *info = kernfs_info(sb); in kernfs_kill_sb()
360 kill_anon_super(sb); in kernfs_kill_sb()