• Home
  • Raw
  • Download

Lines Matching refs:s

58 	struct super_block *s = kzalloc(sizeof(struct super_block),  GFP_USER);  in alloc_super()  local
61 if (s) { in alloc_super()
62 if (security_sb_alloc(s)) { in alloc_super()
63 kfree(s); in alloc_super()
64 s = NULL; in alloc_super()
67 INIT_LIST_HEAD(&s->s_dirty); in alloc_super()
68 INIT_LIST_HEAD(&s->s_io); in alloc_super()
69 INIT_LIST_HEAD(&s->s_more_io); in alloc_super()
70 INIT_LIST_HEAD(&s->s_files); in alloc_super()
71 INIT_LIST_HEAD(&s->s_instances); in alloc_super()
72 INIT_HLIST_HEAD(&s->s_anon); in alloc_super()
73 INIT_LIST_HEAD(&s->s_inodes); in alloc_super()
74 INIT_LIST_HEAD(&s->s_dentry_lru); in alloc_super()
75 INIT_LIST_HEAD(&s->s_async_list); in alloc_super()
76 init_rwsem(&s->s_umount); in alloc_super()
77 mutex_init(&s->s_lock); in alloc_super()
78 lockdep_set_class(&s->s_umount, &type->s_umount_key); in alloc_super()
84 lockdep_set_class(&s->s_lock, &type->s_lock_key); in alloc_super()
100 down_write_nested(&s->s_umount, SINGLE_DEPTH_NESTING); in alloc_super()
101 s->s_count = S_BIAS; in alloc_super()
102 atomic_set(&s->s_active, 1); in alloc_super()
103 mutex_init(&s->s_vfs_rename_mutex); in alloc_super()
104 mutex_init(&s->s_dquot.dqio_mutex); in alloc_super()
105 mutex_init(&s->s_dquot.dqonoff_mutex); in alloc_super()
106 init_rwsem(&s->s_dquot.dqptr_sem); in alloc_super()
107 init_waitqueue_head(&s->s_wait_unfrozen); in alloc_super()
108 s->s_maxbytes = MAX_NON_LFS; in alloc_super()
109 s->dq_op = sb_dquot_ops; in alloc_super()
110 s->s_qcop = sb_quotactl_ops; in alloc_super()
111 s->s_op = &default_op; in alloc_super()
112 s->s_time_gran = 1000000000; in alloc_super()
115 return s; in alloc_super()
124 static inline void destroy_super(struct super_block *s) in destroy_super() argument
126 security_sb_free(s); in destroy_super()
127 kfree(s->s_subtype); in destroy_super()
128 kfree(s->s_options); in destroy_super()
129 kfree(s); in destroy_super()
194 void deactivate_super(struct super_block *s) in deactivate_super() argument
196 struct file_system_type *fs = s->s_type; in deactivate_super()
197 if (atomic_dec_and_lock(&s->s_active, &sb_lock)) { in deactivate_super()
198 s->s_count -= S_BIAS-1; in deactivate_super()
200 DQUOT_OFF(s, 0); in deactivate_super()
201 down_write(&s->s_umount); in deactivate_super()
202 fs->kill_sb(s); in deactivate_super()
204 put_super(s); in deactivate_super()
221 static int grab_super(struct super_block *s) __releases(sb_lock) in grab_super() argument
223 s->s_count++; in grab_super()
225 down_write(&s->s_umount); in grab_super()
226 if (s->s_root) { in grab_super()
228 if (s->s_count > S_BIAS) { in grab_super()
229 atomic_inc(&s->s_active); in grab_super()
230 s->s_count--; in grab_super()
236 up_write(&s->s_umount); in grab_super()
237 put_super(s); in grab_super()
362 struct super_block *s = NULL; in sget() local
374 if (s) { in sget()
375 up_write(&s->s_umount); in sget()
376 destroy_super(s); in sget()
381 if (!s) { in sget()
383 s = alloc_super(type); in sget()
384 if (!s) in sget()
389 err = set(s, data); in sget()
392 up_write(&s->s_umount); in sget()
393 destroy_super(s); in sget()
396 s->s_type = type; in sget()
397 strlcpy(s->s_id, type->name, sizeof(s->s_id)); in sget()
398 list_add_tail(&s->s_list, &super_blocks); in sget()
399 list_add(&s->s_instances, &type->fs_supers); in sget()
402 return s; in sget()
567 struct super_block *s; in SYSCALL_DEFINE2() local
572 s = user_get_super(new_decode_dev(dev)); in SYSCALL_DEFINE2()
573 if (s == NULL) in SYSCALL_DEFINE2()
575 err = vfs_statfs(s->s_root, &sbuf); in SYSCALL_DEFINE2()
576 drop_super(s); in SYSCALL_DEFINE2()
716 int set_anon_super(struct super_block *s, void *data) in set_anon_super() argument
739 s->s_dev = MKDEV(0, dev & MINORMASK); in set_anon_super()
767 static int set_bdev_super(struct super_block *s, void *data) in set_bdev_super() argument
769 s->s_bdev = data; in set_bdev_super()
770 s->s_dev = s->s_bdev->bd_dev; in set_bdev_super()
774 static int test_bdev_super(struct super_block *s, void *data) in test_bdev_super() argument
776 return (void *)s->s_bdev == data; in test_bdev_super()
785 struct super_block *s; in get_sb_bdev() local
802 s = sget(fs_type, test_bdev_super, set_bdev_super, bdev); in get_sb_bdev()
804 if (IS_ERR(s)) in get_sb_bdev()
807 if (s->s_root) { in get_sb_bdev()
808 if ((flags ^ s->s_flags) & MS_RDONLY) { in get_sb_bdev()
809 up_write(&s->s_umount); in get_sb_bdev()
810 deactivate_super(s); in get_sb_bdev()
819 s->s_flags = flags; in get_sb_bdev()
820 s->s_mode = mode; in get_sb_bdev()
821 strlcpy(s->s_id, bdevname(bdev, b), sizeof(s->s_id)); in get_sb_bdev()
822 sb_set_blocksize(s, block_size(bdev)); in get_sb_bdev()
823 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0); in get_sb_bdev()
825 up_write(&s->s_umount); in get_sb_bdev()
826 deactivate_super(s); in get_sb_bdev()
830 s->s_flags |= MS_ACTIVE; in get_sb_bdev()
831 bdev->bd_super = s; in get_sb_bdev()
834 return simple_set_mnt(mnt, s); in get_sb_bdev()
837 error = PTR_ERR(s); in get_sb_bdev()
866 struct super_block *s = sget(fs_type, NULL, set_anon_super, NULL); in get_sb_nodev() local
868 if (IS_ERR(s)) in get_sb_nodev()
869 return PTR_ERR(s); in get_sb_nodev()
871 s->s_flags = flags; in get_sb_nodev()
873 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0); in get_sb_nodev()
875 up_write(&s->s_umount); in get_sb_nodev()
876 deactivate_super(s); in get_sb_nodev()
879 s->s_flags |= MS_ACTIVE; in get_sb_nodev()
880 return simple_set_mnt(mnt, s); in get_sb_nodev()
885 static int compare_single(struct super_block *s, void *p) in compare_single() argument
895 struct super_block *s; in get_sb_single() local
898 s = sget(fs_type, compare_single, set_anon_super, NULL); in get_sb_single()
899 if (IS_ERR(s)) in get_sb_single()
900 return PTR_ERR(s); in get_sb_single()
901 if (!s->s_root) { in get_sb_single()
902 s->s_flags = flags; in get_sb_single()
903 error = fill_super(s, data, flags & MS_SILENT ? 1 : 0); in get_sb_single()
905 up_write(&s->s_umount); in get_sb_single()
906 deactivate_super(s); in get_sb_single()
909 s->s_flags |= MS_ACTIVE; in get_sb_single()
911 do_remount_sb(s, flags, data, 0); in get_sb_single()
912 return simple_set_mnt(mnt, s); in get_sb_single()