Lines Matching refs:sb

25 static int kernfs_sop_remount_fs(struct super_block *sb, int *flags, char *data)  in kernfs_sop_remount_fs()  argument
27 struct kernfs_root *root = kernfs_info(sb)->root; in kernfs_sop_remount_fs()
87 static struct inode *kernfs_fh_get_inode(struct super_block *sb, in kernfs_fh_get_inode() argument
90 struct kernfs_super_info *info = kernfs_info(sb); in kernfs_fh_get_inode()
100 inode = kernfs_get_inode(sb, kn); in kernfs_fh_get_inode()
113 static struct dentry *kernfs_fh_to_dentry(struct super_block *sb, struct fid *fid, in kernfs_fh_to_dentry() argument
116 return generic_fh_to_dentry(sb, fid, fh_len, fh_type, in kernfs_fh_to_dentry()
120 static struct dentry *kernfs_fh_to_parent(struct super_block *sb, struct fid *fid, in kernfs_fh_to_parent() argument
123 return generic_fh_to_parent(sb, fid, fh_len, fh_type, in kernfs_fh_to_parent()
147 struct kernfs_root *kernfs_root_from_sb(struct super_block *sb) in kernfs_root_from_sb() argument
149 if (sb->s_op == &kernfs_sops) in kernfs_root_from_sb()
150 return kernfs_info(sb)->root; in kernfs_root_from_sb()
185 struct super_block *sb) in kernfs_node_dentry() argument
190 BUG_ON(sb->s_op != &kernfs_sops); in kernfs_node_dentry()
192 dentry = dget(sb->s_root); in kernfs_node_dentry()
225 static int kernfs_fill_super(struct super_block *sb, unsigned long magic) in kernfs_fill_super() argument
227 struct kernfs_super_info *info = kernfs_info(sb); in kernfs_fill_super()
231 info->sb = sb; in kernfs_fill_super()
233 sb->s_iflags |= SB_I_NOEXEC | SB_I_NODEV; in kernfs_fill_super()
234 sb->s_blocksize = PAGE_SIZE; in kernfs_fill_super()
235 sb->s_blocksize_bits = PAGE_SHIFT; in kernfs_fill_super()
236 sb->s_magic = magic; in kernfs_fill_super()
237 sb->s_op = &kernfs_sops; in kernfs_fill_super()
238 sb->s_xattr = kernfs_xattr_handlers; in kernfs_fill_super()
240 sb->s_export_op = &kernfs_export_ops; in kernfs_fill_super()
241 sb->s_time_gran = 1; in kernfs_fill_super()
245 inode = kernfs_get_inode(sb, info->root->kn); in kernfs_fill_super()
258 sb->s_root = root; in kernfs_fill_super()
259 sb->s_d_op = &kernfs_dops; in kernfs_fill_super()
263 static int kernfs_test_super(struct super_block *sb, void *data) in kernfs_test_super() argument
265 struct kernfs_super_info *sb_info = kernfs_info(sb); in kernfs_test_super()
271 static int kernfs_set_super(struct super_block *sb, void *data) in kernfs_set_super() argument
274 error = set_anon_super(sb, data); in kernfs_set_super()
276 sb->s_fs_info = data; in kernfs_set_super()
286 const void *kernfs_super_ns(struct super_block *sb) in kernfs_super_ns() argument
288 struct kernfs_super_info *info = kernfs_info(sb); in kernfs_super_ns()
313 struct super_block *sb; in kernfs_mount_ns() local
325 sb = sget_userns(fs_type, kernfs_test_super, kernfs_set_super, flags, in kernfs_mount_ns()
327 if (IS_ERR(sb) || sb->s_fs_info != info) in kernfs_mount_ns()
329 if (IS_ERR(sb)) in kernfs_mount_ns()
330 return ERR_CAST(sb); in kernfs_mount_ns()
333 *new_sb_created = !sb->s_root; in kernfs_mount_ns()
335 if (!sb->s_root) { in kernfs_mount_ns()
336 struct kernfs_super_info *info = kernfs_info(sb); in kernfs_mount_ns()
338 error = kernfs_fill_super(sb, magic); in kernfs_mount_ns()
340 deactivate_locked_super(sb); in kernfs_mount_ns()
343 sb->s_flags |= SB_ACTIVE; in kernfs_mount_ns()
350 return dget(sb->s_root); in kernfs_mount_ns()
361 void kernfs_kill_sb(struct super_block *sb) in kernfs_kill_sb() argument
363 struct kernfs_super_info *info = kernfs_info(sb); in kernfs_kill_sb()
373 kill_anon_super(sb); in kernfs_kill_sb()
392 struct super_block *sb = NULL; in kernfs_pin_sb() local
397 sb = info->sb; in kernfs_pin_sb()
398 if (!atomic_inc_not_zero(&info->sb->s_active)) in kernfs_pin_sb()
399 sb = ERR_PTR(-EINVAL); in kernfs_pin_sb()
404 return sb; in kernfs_pin_sb()