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()
365 struct selinux_fs_info *fsi = inode->i_sb->s_fs_info; in sel_open_policy() local
379 if (fsi->policy_opened) in sel_open_policy()
397 fsi->policy_opened = 1; in sel_open_policy()
415 struct selinux_fs_info *fsi = inode->i_sb->s_fs_info; in sel_release_policy() local
420 fsi->policy_opened = 0; in sel_release_policy()
504 static int sel_make_policy_nodes(struct selinux_fs_info *fsi, in sel_make_policy_nodes() argument
512 unsigned long tmp_ino = fsi->last_ino; /* Don't increment last_ino in this function */ in sel_make_policy_nodes()
514 tmp_parent = sel_make_swapover_dir(fsi->sb, &tmp_ino); in sel_make_policy_nodes()
518 tmp_ino = fsi->bool_dir->d_inode->i_ino - 1; /* sel_make_dir will increment and set */ in sel_make_policy_nodes()
525 tmp_ino = fsi->class_dir->d_inode->i_ino - 1; /* sel_make_dir will increment and set */ in sel_make_policy_nodes()
538 &fsi->last_class_ino); in sel_make_policy_nodes()
542 lock_rename(tmp_parent, fsi->sb->s_root); in sel_make_policy_nodes()
545 d_exchange(tmp_bool_dir, fsi->bool_dir); in sel_make_policy_nodes()
547 swap(fsi->bool_num, bool_num); in sel_make_policy_nodes()
548 swap(fsi->bool_pending_names, bool_names); in sel_make_policy_nodes()
549 swap(fsi->bool_pending_values, bool_values); in sel_make_policy_nodes()
551 fsi->bool_dir = tmp_bool_dir; in sel_make_policy_nodes()
554 d_exchange(tmp_class_dir, fsi->class_dir); in sel_make_policy_nodes()
555 fsi->class_dir = tmp_class_dir; in sel_make_policy_nodes()
557 unlock_rename(tmp_parent, fsi->sb->s_root); in sel_make_policy_nodes()
574 struct selinux_fs_info *fsi; in sel_write_load() local
608 fsi = file_inode(file)->i_sb->s_fs_info; in sel_write_load()
609 length = sel_make_policy_nodes(fsi, load_state.policy); in sel_write_load()
1200 struct selinux_fs_info *fsi = file_inode(filep)->i_sb->s_fs_info; in sel_read_bool() local
1211 if (index >= fsi->bool_num || strcmp(name, in sel_read_bool()
1212 fsi->bool_pending_names[index])) in sel_read_bool()
1226 fsi->bool_pending_values[index]); in sel_read_bool()
1241 struct selinux_fs_info *fsi = file_inode(filep)->i_sb->s_fs_info; in sel_write_bool() local
1268 if (index >= fsi->bool_num || strcmp(name, in sel_write_bool()
1269 fsi->bool_pending_names[index])) in sel_write_bool()
1279 fsi->bool_pending_values[index] = new_value; in sel_write_bool()
1298 struct selinux_fs_info *fsi = file_inode(filep)->i_sb->s_fs_info; in sel_commit_bools_write() local
1327 if (new_value && fsi->bool_pending_values) in sel_commit_bools_write()
1328 length = security_set_bools(fsi->bool_num, in sel_commit_bools_write()
1329 fsi->bool_pending_values); in sel_commit_bools_write()
1585 struct selinux_fs_info *fsi = sb->s_fs_info; in sel_make_avc_files() local
1611 inode->i_ino = ++fsi->last_ino; in sel_make_avc_files()
1621 struct selinux_fs_info *fsi = sb->s_fs_info; in sel_make_ss_files() local
1642 inode->i_ino = ++fsi->last_ino; in sel_make_ss_files()
1813 struct selinux_fs_info *fsi = sb->s_fs_info; in sel_make_class_dir_entries() local
1831 dentry = sel_make_dir(dir, "perms", &fsi->last_class_ino); in sel_make_class_dir_entries()
1877 static int sel_make_policycap(struct selinux_fs_info *fsi) in sel_make_policycap() argument
1885 dentry = d_alloc_name(fsi->policycap_dir, in sel_make_policycap()
1888 dentry = d_alloc_name(fsi->policycap_dir, "unknown"); in sel_make_policycap()
1893 inode = sel_make_inode(fsi->sb, S_IFREG | 0444); in sel_make_policycap()
1974 struct selinux_fs_info *fsi; in sel_fill_super() local
2011 fsi = sb->s_fs_info; in sel_fill_super()
2012 fsi->bool_dir = sel_make_dir(sb->s_root, BOOL_DIR_NAME, &fsi->last_ino); in sel_fill_super()
2013 if (IS_ERR(fsi->bool_dir)) { in sel_fill_super()
2014 ret = PTR_ERR(fsi->bool_dir); in sel_fill_super()
2015 fsi->bool_dir = NULL; in sel_fill_super()
2031 inode->i_ino = ++fsi->last_ino; in sel_fill_super()
2040 dentry = sel_make_dir(sb->s_root, "avc", &fsi->last_ino); in sel_fill_super()
2050 dentry = sel_make_dir(sb->s_root, "ss", &fsi->last_ino); in sel_fill_super()
2060 dentry = sel_make_dir(sb->s_root, "initial_contexts", &fsi->last_ino); in sel_fill_super()
2070 fsi->class_dir = sel_make_dir(sb->s_root, CLASS_DIR_NAME, &fsi->last_ino); in sel_fill_super()
2071 if (IS_ERR(fsi->class_dir)) { in sel_fill_super()
2072 ret = PTR_ERR(fsi->class_dir); in sel_fill_super()
2073 fsi->class_dir = NULL; in sel_fill_super()
2077 fsi->policycap_dir = sel_make_dir(sb->s_root, POLICYCAP_DIR_NAME, in sel_fill_super()
2078 &fsi->last_ino); in sel_fill_super()
2079 if (IS_ERR(fsi->policycap_dir)) { in sel_fill_super()
2080 ret = PTR_ERR(fsi->policycap_dir); in sel_fill_super()
2081 fsi->policycap_dir = NULL; in sel_fill_super()
2085 ret = sel_make_policycap(fsi); in sel_fill_super()