Lines Matching full:fsi
85 struct selinux_fs_info *fsi; in selinux_fs_info_create() local
87 fsi = kzalloc(sizeof(*fsi), GFP_KERNEL); in selinux_fs_info_create()
88 if (!fsi) in selinux_fs_info_create()
91 fsi->last_ino = SEL_INO_NEXT - 1; in selinux_fs_info_create()
92 fsi->sb = sb; in selinux_fs_info_create()
93 sb->s_fs_info = fsi; in selinux_fs_info_create()
99 struct selinux_fs_info *fsi = sb->s_fs_info; in selinux_fs_info_free() local
102 if (fsi) { in selinux_fs_info_free()
103 for (i = 0; i < fsi->bool_num; i++) in selinux_fs_info_free()
104 kfree(fsi->bool_pending_names[i]); in selinux_fs_info_free()
105 kfree(fsi->bool_pending_names); in selinux_fs_info_free()
106 kfree(fsi->bool_pending_values); in selinux_fs_info_free()
368 struct selinux_fs_info *fsi = inode->i_sb->s_fs_info; in sel_open_policy() local
382 if (fsi->policy_opened) in sel_open_policy()
400 fsi->policy_opened = 1; in sel_open_policy()
418 struct selinux_fs_info *fsi = inode->i_sb->s_fs_info; in sel_release_policy() local
423 fsi->policy_opened = 0; in sel_release_policy()
507 static int sel_make_policy_nodes(struct selinux_fs_info *fsi, in sel_make_policy_nodes() argument
515 unsigned long tmp_ino = fsi->last_ino; /* Don't increment last_ino in this function */ in sel_make_policy_nodes()
517 tmp_parent = sel_make_disconnected_dir(fsi->sb, &tmp_ino); in sel_make_policy_nodes()
521 tmp_ino = fsi->bool_dir->d_inode->i_ino - 1; /* sel_make_dir will increment and set */ in sel_make_policy_nodes()
528 tmp_ino = fsi->class_dir->d_inode->i_ino - 1; /* sel_make_dir will increment and set */ in sel_make_policy_nodes()
541 &fsi->last_class_ino); in sel_make_policy_nodes()
546 old_dentry = fsi->bool_dir; in sel_make_policy_nodes()
548 d_exchange(tmp_bool_dir, fsi->bool_dir); in sel_make_policy_nodes()
550 old_bool_num = fsi->bool_num; in sel_make_policy_nodes()
551 old_bool_names = fsi->bool_pending_names; in sel_make_policy_nodes()
552 old_bool_values = fsi->bool_pending_values; in sel_make_policy_nodes()
554 fsi->bool_num = tmp_bool_num; in sel_make_policy_nodes()
555 fsi->bool_pending_names = tmp_bool_names; in sel_make_policy_nodes()
556 fsi->bool_pending_values = tmp_bool_values; in sel_make_policy_nodes()
560 fsi->bool_dir = tmp_bool_dir; in sel_make_policy_nodes()
564 old_dentry = fsi->class_dir; in sel_make_policy_nodes()
566 d_exchange(tmp_class_dir, fsi->class_dir); in sel_make_policy_nodes()
567 fsi->class_dir = tmp_class_dir; in sel_make_policy_nodes()
585 struct selinux_fs_info *fsi; in sel_write_load() local
619 fsi = file_inode(file)->i_sb->s_fs_info; in sel_write_load()
620 length = sel_make_policy_nodes(fsi, load_state.policy); in sel_write_load()
1211 struct selinux_fs_info *fsi = file_inode(filep)->i_sb->s_fs_info; in sel_read_bool() local
1222 if (index >= fsi->bool_num || strcmp(name, in sel_read_bool()
1223 fsi->bool_pending_names[index])) in sel_read_bool()
1237 fsi->bool_pending_values[index]); in sel_read_bool()
1252 struct selinux_fs_info *fsi = file_inode(filep)->i_sb->s_fs_info; in sel_write_bool() local
1279 if (index >= fsi->bool_num || strcmp(name, in sel_write_bool()
1280 fsi->bool_pending_names[index])) in sel_write_bool()
1290 fsi->bool_pending_values[index] = new_value; in sel_write_bool()
1309 struct selinux_fs_info *fsi = file_inode(filep)->i_sb->s_fs_info; in sel_commit_bools_write() local
1338 if (new_value && fsi->bool_pending_values) in sel_commit_bools_write()
1339 length = security_set_bools(fsi->bool_num, in sel_commit_bools_write()
1340 fsi->bool_pending_values); in sel_commit_bools_write()
1617 struct selinux_fs_info *fsi = sb->s_fs_info; in sel_make_avc_files() local
1643 inode->i_ino = ++fsi->last_ino; in sel_make_avc_files()
1653 struct selinux_fs_info *fsi = sb->s_fs_info; in sel_make_ss_files() local
1674 inode->i_ino = ++fsi->last_ino; in sel_make_ss_files()
1845 struct selinux_fs_info *fsi = sb->s_fs_info; in sel_make_class_dir_entries() local
1863 dentry = sel_make_dir(dir, "perms", &fsi->last_class_ino); in sel_make_class_dir_entries()
1909 static int sel_make_policycap(struct selinux_fs_info *fsi) in sel_make_policycap() argument
1917 dentry = d_alloc_name(fsi->policycap_dir, in sel_make_policycap()
1920 dentry = d_alloc_name(fsi->policycap_dir, "unknown"); in sel_make_policycap()
1925 inode = sel_make_inode(fsi->sb, S_IFREG | 0444); in sel_make_policycap()
1986 struct selinux_fs_info *fsi; in sel_fill_super() local
2023 fsi = sb->s_fs_info; in sel_fill_super()
2024 fsi->bool_dir = sel_make_dir(sb->s_root, BOOL_DIR_NAME, &fsi->last_ino); in sel_fill_super()
2025 if (IS_ERR(fsi->bool_dir)) { in sel_fill_super()
2026 ret = PTR_ERR(fsi->bool_dir); in sel_fill_super()
2027 fsi->bool_dir = NULL; in sel_fill_super()
2043 inode->i_ino = ++fsi->last_ino; in sel_fill_super()
2052 dentry = sel_make_dir(sb->s_root, "avc", &fsi->last_ino); in sel_fill_super()
2062 dentry = sel_make_dir(sb->s_root, "ss", &fsi->last_ino); in sel_fill_super()
2072 dentry = sel_make_dir(sb->s_root, "initial_contexts", &fsi->last_ino); in sel_fill_super()
2082 fsi->class_dir = sel_make_dir(sb->s_root, CLASS_DIR_NAME, &fsi->last_ino); in sel_fill_super()
2083 if (IS_ERR(fsi->class_dir)) { in sel_fill_super()
2084 ret = PTR_ERR(fsi->class_dir); in sel_fill_super()
2085 fsi->class_dir = NULL; in sel_fill_super()
2089 fsi->policycap_dir = sel_make_dir(sb->s_root, POLICYCAP_DIR_NAME, in sel_fill_super()
2090 &fsi->last_ino); in sel_fill_super()
2091 if (IS_ERR(fsi->policycap_dir)) { in sel_fill_super()
2092 ret = PTR_ERR(fsi->policycap_dir); in sel_fill_super()
2093 fsi->policycap_dir = NULL; in sel_fill_super()
2097 ret = sel_make_policycap(fsi); in sel_fill_super()