Lines Matching refs:rc

386 	int rc;  in roles_init()  local
393 rc = -EINVAL; in roles_init()
398 rc = -ENOMEM; in roles_init()
403 rc = symtab_insert(&p->p_roles, key, role); in roles_init()
404 if (rc) in roles_init()
411 return rc; in roles_init()
720 int i, rc; in policydb_index() local
763 rc = cond_init_bool_indexes(p); in policydb_index()
764 if (rc) in policydb_index()
774 rc = hashtab_map(&p->symtab[i].table, index_f[i], p); in policydb_index()
775 if (rc) in policydb_index()
778 rc = 0; in policydb_index()
780 return rc; in policydb_index()
872 int rc; in policydb_load_isids() local
874 rc = sidtab_init(s); in policydb_load_isids()
875 if (rc) { in policydb_load_isids()
895 rc = sidtab_set_initial(s, sid, &c->context[0]); in policydb_load_isids()
896 if (rc) { in policydb_load_isids()
903 rc = 0; in policydb_load_isids()
905 return rc; in policydb_load_isids()
982 int rc; in mls_read_range_helper() local
984 rc = next_entry(buf, fp, sizeof(u32)); in mls_read_range_helper()
985 if (rc) in mls_read_range_helper()
988 rc = -EINVAL; in mls_read_range_helper()
995 rc = next_entry(buf, fp, sizeof(u32) * items); in mls_read_range_helper()
996 if (rc) { in mls_read_range_helper()
1007 rc = ebitmap_read(&r->level[0].cat, fp); in mls_read_range_helper()
1008 if (rc) { in mls_read_range_helper()
1013 rc = ebitmap_read(&r->level[1].cat, fp); in mls_read_range_helper()
1014 if (rc) { in mls_read_range_helper()
1019 rc = ebitmap_cpy(&r->level[1].cat, &r->level[0].cat); in mls_read_range_helper()
1020 if (rc) { in mls_read_range_helper()
1030 return rc; in mls_read_range_helper()
1042 int rc; in context_read_and_validate() local
1044 rc = next_entry(buf, fp, sizeof buf); in context_read_and_validate()
1045 if (rc) { in context_read_and_validate()
1053 rc = mls_read_range_helper(&c->range, fp); in context_read_and_validate()
1054 if (rc) { in context_read_and_validate()
1060 rc = -EINVAL; in context_read_and_validate()
1066 rc = 0; in context_read_and_validate()
1068 return rc; in context_read_and_validate()
1079 int rc; in str_read() local
1089 rc = next_entry(str, fp, len); in str_read()
1090 if (rc) { in str_read()
1092 return rc; in str_read()
1104 int rc; in perm_read() local
1112 rc = next_entry(buf, fp, sizeof buf); in perm_read()
1113 if (rc) in perm_read()
1119 rc = str_read(&key, GFP_KERNEL, fp, len); in perm_read()
1120 if (rc) in perm_read()
1123 rc = symtab_insert(s, key, perdatum); in perm_read()
1124 if (rc) in perm_read()
1130 return rc; in perm_read()
1139 int i, rc; in common_read() local
1145 rc = next_entry(buf, fp, sizeof buf); in common_read()
1146 if (rc) in common_read()
1153 rc = symtab_init(&comdatum->permissions, nel); in common_read()
1154 if (rc) in common_read()
1158 rc = str_read(&key, GFP_KERNEL, fp, len); in common_read()
1159 if (rc) in common_read()
1163 rc = perm_read(p, &comdatum->permissions, fp); in common_read()
1164 if (rc) in common_read()
1168 rc = symtab_insert(s, key, comdatum); in common_read()
1169 if (rc) in common_read()
1174 return rc; in common_read()
1186 int rc; in type_set_read() local
1193 rc = next_entry(buf, fp, sizeof(u32)); in type_set_read()
1194 if (rc < 0) in type_set_read()
1210 int rc, i, j, depth; in read_cons_helper() local
1223 rc = next_entry(buf, fp, (sizeof(u32) * 2)); in read_cons_helper()
1224 if (rc) in read_cons_helper()
1225 return rc; in read_cons_helper()
1240 rc = next_entry(buf, fp, (sizeof(u32) * 3)); in read_cons_helper()
1241 if (rc) in read_cons_helper()
1242 return rc; in read_cons_helper()
1269 rc = ebitmap_read(&e->names, fp); in read_cons_helper()
1270 if (rc) in read_cons_helper()
1271 return rc; in read_cons_helper()
1279 rc = type_set_read(e->type_names, fp); in read_cons_helper()
1280 if (rc) in read_cons_helper()
1281 return rc; in read_cons_helper()
1303 int i, rc; in class_read() local
1309 rc = next_entry(buf, fp, sizeof(u32)*6); in class_read()
1310 if (rc) in class_read()
1318 rc = symtab_init(&cladatum->permissions, nel); in class_read()
1319 if (rc) in class_read()
1325 rc = str_read(&key, GFP_KERNEL, fp, len); in class_read()
1326 if (rc) in class_read()
1330 rc = str_read(&cladatum->comkey, GFP_KERNEL, fp, len2); in class_read()
1331 if (rc) in class_read()
1334 rc = -EINVAL; in class_read()
1344 rc = perm_read(p, &cladatum->permissions, fp); in class_read()
1345 if (rc) in class_read()
1349 rc = read_cons_helper(p, &cladatum->constraints, ncons, 0, fp); in class_read()
1350 if (rc) in class_read()
1355 rc = next_entry(buf, fp, sizeof(u32)); in class_read()
1356 if (rc) in class_read()
1359 rc = read_cons_helper(p, &cladatum->validatetrans, in class_read()
1361 if (rc) in class_read()
1366 rc = next_entry(buf, fp, sizeof(u32) * 3); in class_read()
1367 if (rc) in class_read()
1376 rc = next_entry(buf, fp, sizeof(u32) * 1); in class_read()
1377 if (rc) in class_read()
1382 rc = symtab_insert(s, key, cladatum); in class_read()
1383 if (rc) in class_read()
1389 return rc; in class_read()
1396 int rc, to_read = 2; in role_read() local
1407 rc = next_entry(buf, fp, sizeof(buf[0]) * to_read); in role_read()
1408 if (rc) in role_read()
1416 rc = str_read(&key, GFP_KERNEL, fp, len); in role_read()
1417 if (rc) in role_read()
1420 rc = ebitmap_read(&role->dominates, fp); in role_read()
1421 if (rc) in role_read()
1424 rc = ebitmap_read(&role->types, fp); in role_read()
1425 if (rc) in role_read()
1429 rc = -EINVAL; in role_read()
1435 rc = 0; in role_read()
1439 rc = symtab_insert(s, key, role); in role_read()
1440 if (rc) in role_read()
1445 return rc; in role_read()
1452 int rc, to_read = 3; in type_read() local
1463 rc = next_entry(buf, fp, sizeof(buf[0]) * to_read); in type_read()
1464 if (rc) in type_read()
1482 rc = str_read(&key, GFP_KERNEL, fp, len); in type_read()
1483 if (rc) in type_read()
1486 rc = symtab_insert(s, key, typdatum); in type_read()
1487 if (rc) in type_read()
1492 return rc; in type_read()
1503 int rc; in mls_read_level() local
1507 rc = next_entry(buf, fp, sizeof buf); in mls_read_level()
1508 if (rc) { in mls_read_level()
1510 return rc; in mls_read_level()
1514 rc = ebitmap_read(&lp->cat, fp); in mls_read_level()
1515 if (rc) { in mls_read_level()
1517 return rc; in mls_read_level()
1526 int rc, to_read = 2; in user_read() local
1537 rc = next_entry(buf, fp, sizeof(buf[0]) * to_read); in user_read()
1538 if (rc) in user_read()
1546 rc = str_read(&key, GFP_KERNEL, fp, len); in user_read()
1547 if (rc) in user_read()
1550 rc = ebitmap_read(&usrdatum->roles, fp); in user_read()
1551 if (rc) in user_read()
1555 rc = mls_read_range_helper(&usrdatum->range, fp); in user_read()
1556 if (rc) in user_read()
1558 rc = mls_read_level(&usrdatum->dfltlevel, fp); in user_read()
1559 if (rc) in user_read()
1563 rc = symtab_insert(s, key, usrdatum); in user_read()
1564 if (rc) in user_read()
1569 return rc; in user_read()
1576 int rc; in sens_read() local
1584 rc = next_entry(buf, fp, sizeof buf); in sens_read()
1585 if (rc) in sens_read()
1591 rc = str_read(&key, GFP_ATOMIC, fp, len); in sens_read()
1592 if (rc) in sens_read()
1595 rc = -ENOMEM; in sens_read()
1600 rc = mls_read_level(levdatum->level, fp); in sens_read()
1601 if (rc) in sens_read()
1604 rc = symtab_insert(s, key, levdatum); in sens_read()
1605 if (rc) in sens_read()
1610 return rc; in sens_read()
1617 int rc; in cat_read() local
1625 rc = next_entry(buf, fp, sizeof buf); in cat_read()
1626 if (rc) in cat_read()
1633 rc = str_read(&key, GFP_ATOMIC, fp, len); in cat_read()
1634 if (rc) in cat_read()
1637 rc = symtab_insert(s, key, catdatum); in cat_read()
1638 if (rc) in cat_read()
1643 return rc; in cat_read()
1762 int rc; in policydb_bounds_sanity_check() local
1767 rc = hashtab_map(&p->p_users.table, user_bounds_sanity_check, p); in policydb_bounds_sanity_check()
1768 if (rc) in policydb_bounds_sanity_check()
1769 return rc; in policydb_bounds_sanity_check()
1771 rc = hashtab_map(&p->p_roles.table, role_bounds_sanity_check, p); in policydb_bounds_sanity_check()
1772 if (rc) in policydb_bounds_sanity_check()
1773 return rc; in policydb_bounds_sanity_check()
1775 rc = hashtab_map(&p->p_types.table, type_bounds_sanity_check, p); in policydb_bounds_sanity_check()
1776 if (rc) in policydb_bounds_sanity_check()
1777 return rc; in policydb_bounds_sanity_check()
1818 int i, rc; in range_read() local
1825 rc = next_entry(buf, fp, sizeof(u32)); in range_read()
1826 if (rc) in range_read()
1827 return rc; in range_read()
1831 rc = hashtab_init(&p->range_tr, nel); in range_read()
1832 if (rc) in range_read()
1833 return rc; in range_read()
1836 rc = -ENOMEM; in range_read()
1841 rc = next_entry(buf, fp, (sizeof(u32) * 2)); in range_read()
1842 if (rc) in range_read()
1848 rc = next_entry(buf, fp, sizeof(u32)); in range_read()
1849 if (rc) in range_read()
1855 rc = -EINVAL; in range_read()
1861 rc = -ENOMEM; in range_read()
1866 rc = mls_read_range_helper(r, fp); in range_read()
1867 if (rc) in range_read()
1870 rc = -EINVAL; in range_read()
1876 rc = hashtab_insert(&p->range_tr, rt, r, rangetr_key_params); in range_read()
1877 if (rc) in range_read()
1884 rc = 0; in range_read()
1888 return rc; in range_read()
1898 int rc; in filename_trans_read_helper_compat() local
1901 rc = next_entry(buf, fp, sizeof(u32)); in filename_trans_read_helper_compat()
1902 if (rc) in filename_trans_read_helper_compat()
1903 return rc; in filename_trans_read_helper_compat()
1907 rc = str_read(&name, GFP_KERNEL, fp, len); in filename_trans_read_helper_compat()
1908 if (rc) in filename_trans_read_helper_compat()
1909 return rc; in filename_trans_read_helper_compat()
1911 rc = next_entry(buf, fp, sizeof(u32) * 4); in filename_trans_read_helper_compat()
1912 if (rc) in filename_trans_read_helper_compat()
1936 rc = -ENOMEM; in filename_trans_read_helper_compat()
1948 rc = -ENOMEM; in filename_trans_read_helper_compat()
1953 rc = hashtab_insert(&p->filename_trans, ft, datum, in filename_trans_read_helper_compat()
1955 if (rc) in filename_trans_read_helper_compat()
1959 rc = ebitmap_set_bit(&p->filename_trans_ttypes, in filename_trans_read_helper_compat()
1961 if (rc) in filename_trans_read_helper_compat()
1962 return rc; in filename_trans_read_helper_compat()
1972 return rc; in filename_trans_read_helper_compat()
1982 int rc; in filename_trans_read_helper() local
1985 rc = next_entry(buf, fp, sizeof(u32)); in filename_trans_read_helper()
1986 if (rc) in filename_trans_read_helper()
1987 return rc; in filename_trans_read_helper()
1991 rc = str_read(&name, GFP_KERNEL, fp, len); in filename_trans_read_helper()
1992 if (rc) in filename_trans_read_helper()
1993 return rc; in filename_trans_read_helper()
1995 rc = next_entry(buf, fp, sizeof(u32) * 3); in filename_trans_read_helper()
1996 if (rc) in filename_trans_read_helper()
2005 rc = -ENOENT; in filename_trans_read_helper()
2011 rc = -ENOMEM; in filename_trans_read_helper()
2019 rc = ebitmap_read(&datum->stypes, fp); in filename_trans_read_helper()
2020 if (rc) in filename_trans_read_helper()
2023 rc = next_entry(buf, fp, sizeof(u32)); in filename_trans_read_helper()
2024 if (rc) in filename_trans_read_helper()
2033 rc = -ENOMEM; in filename_trans_read_helper()
2042 rc = hashtab_insert(&p->filename_trans, ft, first, in filename_trans_read_helper()
2044 if (rc == -EEXIST) in filename_trans_read_helper()
2046 if (rc) in filename_trans_read_helper()
2061 return rc; in filename_trans_read_helper()
2068 int rc, i; in filename_trans_read() local
2073 rc = next_entry(buf, fp, sizeof(u32)); in filename_trans_read()
2074 if (rc) in filename_trans_read()
2075 return rc; in filename_trans_read()
2081 rc = hashtab_init(&p->filename_trans, (1 << 11)); in filename_trans_read()
2082 if (rc) in filename_trans_read()
2083 return rc; in filename_trans_read()
2086 rc = filename_trans_read_helper_compat(p, fp); in filename_trans_read()
2087 if (rc) in filename_trans_read()
2088 return rc; in filename_trans_read()
2091 rc = hashtab_init(&p->filename_trans, nel); in filename_trans_read()
2092 if (rc) in filename_trans_read()
2093 return rc; in filename_trans_read()
2096 rc = filename_trans_read_helper(p, fp); in filename_trans_read()
2097 if (rc) in filename_trans_read()
2098 return rc; in filename_trans_read()
2107 int i, j, rc; in genfs_read() local
2115 rc = next_entry(buf, fp, sizeof(u32)); in genfs_read()
2116 if (rc) in genfs_read()
2117 return rc; in genfs_read()
2121 rc = next_entry(buf, fp, sizeof(u32)); in genfs_read()
2122 if (rc) in genfs_read()
2126 rc = -ENOMEM; in genfs_read()
2131 rc = str_read(&newgenfs->fstype, GFP_KERNEL, fp, len); in genfs_read()
2132 if (rc) in genfs_read()
2137 rc = -EINVAL; in genfs_read()
2154 rc = next_entry(buf, fp, sizeof(u32)); in genfs_read()
2155 if (rc) in genfs_read()
2160 rc = next_entry(buf, fp, sizeof(u32)); in genfs_read()
2161 if (rc) in genfs_read()
2165 rc = -ENOMEM; in genfs_read()
2170 rc = str_read(&newc->u.name, GFP_KERNEL, fp, len); in genfs_read()
2171 if (rc) in genfs_read()
2174 rc = next_entry(buf, fp, sizeof(u32)); in genfs_read()
2175 if (rc) in genfs_read()
2179 rc = context_read_and_validate(&newc->context[0], p, fp); in genfs_read()
2180 if (rc) in genfs_read()
2185 rc = -EINVAL; in genfs_read()
2207 rc = 0; in genfs_read()
2215 return rc; in genfs_read()
2221 int i, j, rc; in ocontext_read() local
2229 rc = next_entry(buf, fp, sizeof(u32)); in ocontext_read()
2230 if (rc) in ocontext_read()
2236 rc = -ENOMEM; in ocontext_read()
2248 rc = next_entry(buf, fp, sizeof(u32)); in ocontext_read()
2249 if (rc) in ocontext_read()
2253 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2254 if (rc) in ocontext_read()
2259 rc = next_entry(buf, fp, sizeof(u32)); in ocontext_read()
2260 if (rc) in ocontext_read()
2264 rc = str_read(&c->u.name, GFP_KERNEL, fp, len); in ocontext_read()
2265 if (rc) in ocontext_read()
2268 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2269 if (rc) in ocontext_read()
2271 rc = context_read_and_validate(&c->context[1], p, fp); in ocontext_read()
2272 if (rc) in ocontext_read()
2276 rc = next_entry(buf, fp, sizeof(u32)*3); in ocontext_read()
2277 if (rc) in ocontext_read()
2282 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2283 if (rc) in ocontext_read()
2287 rc = next_entry(nodebuf, fp, sizeof(u32) * 2); in ocontext_read()
2288 if (rc) in ocontext_read()
2292 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2293 if (rc) in ocontext_read()
2297 rc = next_entry(buf, fp, sizeof(u32)*2); in ocontext_read()
2298 if (rc) in ocontext_read()
2301 rc = -EINVAL; in ocontext_read()
2310 rc = str_read(&c->u.name, GFP_KERNEL, fp, len); in ocontext_read()
2311 if (rc) in ocontext_read()
2314 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2315 if (rc) in ocontext_read()
2321 rc = next_entry(nodebuf, fp, sizeof(u32) * 8); in ocontext_read()
2322 if (rc) in ocontext_read()
2328 rc = context_read_and_validate(&c->context[0], p, fp); in ocontext_read()
2329 if (rc) in ocontext_read()
2336 rc = next_entry(prefixbuf, fp, sizeof(u64)); in ocontext_read()
2337 if (rc) in ocontext_read()
2343 rc = next_entry(buf, fp, sizeof(u32) * 2); in ocontext_read()
2344 if (rc) in ocontext_read()
2351 rc = -EINVAL; in ocontext_read()
2358 rc = context_read_and_validate(&c->context[0], in ocontext_read()
2361 if (rc) in ocontext_read()
2368 rc = next_entry(buf, fp, sizeof(u32) * 2); in ocontext_read()
2369 if (rc) in ocontext_read()
2373 rc = str_read(&c->u.ibendport.dev_name, GFP_KERNEL, fp, len); in ocontext_read()
2374 if (rc) in ocontext_read()
2379 rc = -EINVAL; in ocontext_read()
2385 rc = context_read_and_validate(&c->context[0], in ocontext_read()
2388 if (rc) in ocontext_read()
2395 rc = 0; in ocontext_read()
2397 return rc; in ocontext_read()
2409 int i, j, rc; in policydb_read() local
2419 rc = next_entry(buf, fp, sizeof(u32) * 2); in policydb_read()
2420 if (rc) in policydb_read()
2423 rc = -EINVAL; in policydb_read()
2431 rc = -EINVAL; in policydb_read()
2440 rc = -ENOMEM; in policydb_read()
2448 rc = next_entry(policydb_str, fp, len); in policydb_read()
2449 if (rc) { in policydb_read()
2455 rc = -EINVAL; in policydb_read()
2468 rc = next_entry(buf, fp, sizeof(u32)*4); in policydb_read()
2469 if (rc) in policydb_read()
2472 rc = -EINVAL; in policydb_read()
2485 rc = -EINVAL; in policydb_read()
2497 rc = ebitmap_read(&p->policycaps, fp); in policydb_read()
2498 if (rc) in policydb_read()
2503 rc = ebitmap_read(&p->permissive_map, fp); in policydb_read()
2504 if (rc) in policydb_read()
2508 rc = -EINVAL; in policydb_read()
2516 rc = -EINVAL; in policydb_read()
2527 rc = next_entry(buf, fp, sizeof(u32)*2); in policydb_read()
2528 if (rc) in policydb_read()
2533 rc = symtab_init(&p->symtab[i], nel); in policydb_read()
2534 if (rc) in policydb_read()
2538 rc = roles_init(p); in policydb_read()
2539 if (rc) in policydb_read()
2544 rc = read_f[i](p, &p->symtab[i], fp); in policydb_read()
2545 if (rc) in policydb_read()
2552 rc = -EINVAL; in policydb_read()
2559 rc = avtab_read(&p->te_avtab, fp, p); in policydb_read()
2560 if (rc) in policydb_read()
2564 rc = cond_read_list(p, fp); in policydb_read()
2565 if (rc) in policydb_read()
2569 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2570 if (rc) in policydb_read()
2574 rc = hashtab_init(&p->role_tr, nel); in policydb_read()
2575 if (rc) in policydb_read()
2578 rc = -ENOMEM; in policydb_read()
2583 rc = -ENOMEM; in policydb_read()
2588 rc = next_entry(buf, fp, sizeof(u32)*3); in policydb_read()
2589 if (rc) in policydb_read()
2592 rc = -EINVAL; in policydb_read()
2597 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2598 if (rc) in policydb_read()
2604 rc = -EINVAL; in policydb_read()
2611 rc = hashtab_insert(&p->role_tr, rtk, rtd, roletr_key_params); in policydb_read()
2612 if (rc) in policydb_read()
2619 rc = next_entry(buf, fp, sizeof(u32)); in policydb_read()
2620 if (rc) in policydb_read()
2625 rc = -ENOMEM; in policydb_read()
2633 rc = next_entry(buf, fp, sizeof(u32)*2); in policydb_read()
2634 if (rc) in policydb_read()
2637 rc = -EINVAL; in policydb_read()
2646 rc = filename_trans_read(p, fp); in policydb_read()
2647 if (rc) in policydb_read()
2650 rc = policydb_index(p); in policydb_read()
2651 if (rc) in policydb_read()
2654 rc = -EINVAL; in policydb_read()
2668 rc = ocontext_read(p, info, fp); in policydb_read()
2669 if (rc) in policydb_read()
2672 rc = genfs_read(p, fp); in policydb_read()
2673 if (rc) in policydb_read()
2676 rc = range_read(p, fp); in policydb_read()
2677 if (rc) in policydb_read()
2680 rc = -ENOMEM; in policydb_read()
2695 rc = ebitmap_read(e, fp); in policydb_read()
2696 if (rc) in policydb_read()
2700 rc = ebitmap_set_bit(e, i, 1); in policydb_read()
2701 if (rc) in policydb_read()
2705 rc = policydb_bounds_sanity_check(p); in policydb_read()
2706 if (rc) in policydb_read()
2709 rc = 0; in policydb_read()
2711 return rc; in policydb_read()
2726 int rc; in mls_write_level() local
2729 rc = put_entry(buf, sizeof(u32), 1, fp); in mls_write_level()
2730 if (rc) in mls_write_level()
2731 return rc; in mls_write_level()
2733 rc = ebitmap_write(&l->cat, fp); in mls_write_level()
2734 if (rc) in mls_write_level()
2735 return rc; in mls_write_level()
2748 int rc, eq; in mls_write_range_helper() local
2763 rc = put_entry(buf, sizeof(u32), items, fp); in mls_write_range_helper()
2764 if (rc) in mls_write_range_helper()
2765 return rc; in mls_write_range_helper()
2767 rc = ebitmap_write(&r->level[0].cat, fp); in mls_write_range_helper()
2768 if (rc) in mls_write_range_helper()
2769 return rc; in mls_write_range_helper()
2771 rc = ebitmap_write(&r->level[1].cat, fp); in mls_write_range_helper()
2772 if (rc) in mls_write_range_helper()
2773 return rc; in mls_write_range_helper()
2787 int rc; in sens_write() local
2792 rc = put_entry(buf, sizeof(u32), 2, fp); in sens_write()
2793 if (rc) in sens_write()
2794 return rc; in sens_write()
2796 rc = put_entry(key, 1, len, fp); in sens_write()
2797 if (rc) in sens_write()
2798 return rc; in sens_write()
2800 rc = mls_write_level(levdatum->level, fp); in sens_write()
2801 if (rc) in sens_write()
2802 return rc; in sens_write()
2815 int rc; in cat_write() local
2821 rc = put_entry(buf, sizeof(u32), 3, fp); in cat_write()
2822 if (rc) in cat_write()
2823 return rc; in cat_write()
2825 rc = put_entry(key, 1, len, fp); in cat_write()
2826 if (rc) in cat_write()
2827 return rc; in cat_write()
2840 int rc; in role_trans_write_one() local
2845 rc = put_entry(buf, sizeof(u32), 3, fp); in role_trans_write_one()
2846 if (rc) in role_trans_write_one()
2847 return rc; in role_trans_write_one()
2850 rc = put_entry(buf, sizeof(u32), 1, fp); in role_trans_write_one()
2851 if (rc) in role_trans_write_one()
2852 return rc; in role_trans_write_one()
2861 int rc; in role_trans_write() local
2864 rc = put_entry(buf, sizeof(u32), 1, fp); in role_trans_write()
2865 if (rc) in role_trans_write()
2866 return rc; in role_trans_write()
2876 int rc; in role_allow_write() local
2882 rc = put_entry(buf, sizeof(u32), 1, fp); in role_allow_write()
2883 if (rc) in role_allow_write()
2884 return rc; in role_allow_write()
2888 rc = put_entry(buf, sizeof(u32), 2, fp); in role_allow_write()
2889 if (rc) in role_allow_write()
2890 return rc; in role_allow_write()
2902 int rc; in context_write() local
2909 rc = put_entry(buf, sizeof(u32), 3, fp); in context_write()
2910 if (rc) in context_write()
2911 return rc; in context_write()
2913 rc = mls_write_range_helper(&c->range, fp); in context_write()
2914 if (rc) in context_write()
2915 return rc; in context_write()
2932 int rc; in perm_write() local
2937 rc = put_entry(buf, sizeof(u32), 2, fp); in perm_write()
2938 if (rc) in perm_write()
2939 return rc; in perm_write()
2941 rc = put_entry(key, 1, len, fp); in perm_write()
2942 if (rc) in perm_write()
2943 return rc; in perm_write()
2956 int rc; in common_write() local
2963 rc = put_entry(buf, sizeof(u32), 4, fp); in common_write()
2964 if (rc) in common_write()
2965 return rc; in common_write()
2967 rc = put_entry(key, 1, len, fp); in common_write()
2968 if (rc) in common_write()
2969 return rc; in common_write()
2971 rc = hashtab_map(&comdatum->permissions.table, perm_write, fp); in common_write()
2972 if (rc) in common_write()
2973 return rc; in common_write()
2980 int rc; in type_set_write() local
2989 rc = put_entry(buf, sizeof(u32), 1, fp); in type_set_write()
2990 if (rc) in type_set_write()
3003 int rc; in write_cons_helper() local
3011 rc = put_entry(buf, sizeof(u32), 2, fp); in write_cons_helper()
3012 if (rc) in write_cons_helper()
3013 return rc; in write_cons_helper()
3018 rc = put_entry(buf, sizeof(u32), 3, fp); in write_cons_helper()
3019 if (rc) in write_cons_helper()
3020 return rc; in write_cons_helper()
3024 rc = ebitmap_write(&e->names, fp); in write_cons_helper()
3025 if (rc) in write_cons_helper()
3026 return rc; in write_cons_helper()
3029 rc = type_set_write(e->type_names, fp); in write_cons_helper()
3030 if (rc) in write_cons_helper()
3031 return rc; in write_cons_helper()
3054 int rc; in class_write() local
3072 rc = put_entry(buf, sizeof(u32), 6, fp); in class_write()
3073 if (rc) in class_write()
3074 return rc; in class_write()
3076 rc = put_entry(key, 1, len, fp); in class_write()
3077 if (rc) in class_write()
3078 return rc; in class_write()
3081 rc = put_entry(cladatum->comkey, 1, len2, fp); in class_write()
3082 if (rc) in class_write()
3083 return rc; in class_write()
3086 rc = hashtab_map(&cladatum->permissions.table, perm_write, fp); in class_write()
3087 if (rc) in class_write()
3088 return rc; in class_write()
3090 rc = write_cons_helper(p, cladatum->constraints, fp); in class_write()
3091 if (rc) in class_write()
3092 return rc; in class_write()
3100 rc = put_entry(buf, sizeof(u32), 1, fp); in class_write()
3101 if (rc) in class_write()
3102 return rc; in class_write()
3104 rc = write_cons_helper(p, cladatum->validatetrans, fp); in class_write()
3105 if (rc) in class_write()
3106 return rc; in class_write()
3113 rc = put_entry(buf, sizeof(uint32_t), 3, fp); in class_write()
3114 if (rc) in class_write()
3115 return rc; in class_write()
3120 rc = put_entry(buf, sizeof(uint32_t), 1, fp); in class_write()
3121 if (rc) in class_write()
3122 return rc; in class_write()
3137 int rc; in role_write() local
3148 rc = put_entry(buf, sizeof(u32), items, fp); in role_write()
3149 if (rc) in role_write()
3150 return rc; in role_write()
3152 rc = put_entry(key, 1, len, fp); in role_write()
3153 if (rc) in role_write()
3154 return rc; in role_write()
3156 rc = ebitmap_write(&role->dominates, fp); in role_write()
3157 if (rc) in role_write()
3158 return rc; in role_write()
3160 rc = ebitmap_write(&role->types, fp); in role_write()
3161 if (rc) in role_write()
3162 return rc; in role_write()
3175 int rc; in type_write() local
3197 rc = put_entry(buf, sizeof(u32), items, fp); in type_write()
3198 if (rc) in type_write()
3199 return rc; in type_write()
3201 rc = put_entry(key, 1, len, fp); in type_write()
3202 if (rc) in type_write()
3203 return rc; in type_write()
3217 int rc; in user_write() local
3226 rc = put_entry(buf, sizeof(u32), items, fp); in user_write()
3227 if (rc) in user_write()
3228 return rc; in user_write()
3230 rc = put_entry(key, 1, len, fp); in user_write()
3231 if (rc) in user_write()
3232 return rc; in user_write()
3234 rc = ebitmap_write(&usrdatum->roles, fp); in user_write()
3235 if (rc) in user_write()
3236 return rc; in user_write()
3238 rc = mls_write_range_helper(&usrdatum->range, fp); in user_write()
3239 if (rc) in user_write()
3240 return rc; in user_write()
3242 rc = mls_write_level(&usrdatum->dfltlevel, fp); in user_write()
3243 if (rc) in user_write()
3244 return rc; in user_write()
3265 unsigned int i, j, rc; in ocontext_write() local
3276 rc = put_entry(buf, sizeof(u32), 1, fp); in ocontext_write()
3277 if (rc) in ocontext_write()
3278 return rc; in ocontext_write()
3283 rc = put_entry(buf, sizeof(u32), 1, fp); in ocontext_write()
3284 if (rc) in ocontext_write()
3285 return rc; in ocontext_write()
3286 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3287 if (rc) in ocontext_write()
3288 return rc; in ocontext_write()
3294 rc = put_entry(buf, sizeof(u32), 1, fp); in ocontext_write()
3295 if (rc) in ocontext_write()
3296 return rc; in ocontext_write()
3297 rc = put_entry(c->u.name, 1, len, fp); in ocontext_write()
3298 if (rc) in ocontext_write()
3299 return rc; in ocontext_write()
3300 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3301 if (rc) in ocontext_write()
3302 return rc; in ocontext_write()
3303 rc = context_write(p, &c->context[1], fp); in ocontext_write()
3304 if (rc) in ocontext_write()
3305 return rc; in ocontext_write()
3311 rc = put_entry(buf, sizeof(u32), 3, fp); in ocontext_write()
3312 if (rc) in ocontext_write()
3313 return rc; in ocontext_write()
3314 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3315 if (rc) in ocontext_write()
3316 return rc; in ocontext_write()
3321 rc = put_entry(nodebuf, sizeof(u32), 2, fp); in ocontext_write()
3322 if (rc) in ocontext_write()
3323 return rc; in ocontext_write()
3324 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3325 if (rc) in ocontext_write()
3326 return rc; in ocontext_write()
3332 rc = put_entry(buf, sizeof(u32), 2, fp); in ocontext_write()
3333 if (rc) in ocontext_write()
3334 return rc; in ocontext_write()
3335 rc = put_entry(c->u.name, 1, len, fp); in ocontext_write()
3336 if (rc) in ocontext_write()
3337 return rc; in ocontext_write()
3338 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3339 if (rc) in ocontext_write()
3340 return rc; in ocontext_write()
3347 rc = put_entry(nodebuf, sizeof(u32), 8, fp); in ocontext_write()
3348 if (rc) in ocontext_write()
3349 return rc; in ocontext_write()
3350 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3351 if (rc) in ocontext_write()
3352 return rc; in ocontext_write()
3358 rc = put_entry(prefixbuf, sizeof(u64), 1, fp); in ocontext_write()
3359 if (rc) in ocontext_write()
3360 return rc; in ocontext_write()
3365 rc = put_entry(buf, sizeof(u32), 2, fp); in ocontext_write()
3366 if (rc) in ocontext_write()
3367 return rc; in ocontext_write()
3368 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3369 if (rc) in ocontext_write()
3370 return rc; in ocontext_write()
3376 rc = put_entry(buf, sizeof(u32), 2, fp); in ocontext_write()
3377 if (rc) in ocontext_write()
3378 return rc; in ocontext_write()
3379 rc = put_entry(c->u.ibendport.dev_name, 1, len, fp); in ocontext_write()
3380 if (rc) in ocontext_write()
3381 return rc; in ocontext_write()
3382 rc = context_write(p, &c->context[0], fp); in ocontext_write()
3383 if (rc) in ocontext_write()
3384 return rc; in ocontext_write()
3398 int rc; in genfs_write() local
3404 rc = put_entry(buf, sizeof(u32), 1, fp); in genfs_write()
3405 if (rc) in genfs_write()
3406 return rc; in genfs_write()
3410 rc = put_entry(buf, sizeof(u32), 1, fp); in genfs_write()
3411 if (rc) in genfs_write()
3412 return rc; in genfs_write()
3413 rc = put_entry(genfs->fstype, 1, len, fp); in genfs_write()
3414 if (rc) in genfs_write()
3415 return rc; in genfs_write()
3420 rc = put_entry(buf, sizeof(u32), 1, fp); in genfs_write()
3421 if (rc) in genfs_write()
3422 return rc; in genfs_write()
3426 rc = put_entry(buf, sizeof(u32), 1, fp); in genfs_write()
3427 if (rc) in genfs_write()
3428 return rc; in genfs_write()
3429 rc = put_entry(c->u.name, 1, len, fp); in genfs_write()
3430 if (rc) in genfs_write()
3431 return rc; in genfs_write()
3433 rc = put_entry(buf, sizeof(u32), 1, fp); in genfs_write()
3434 if (rc) in genfs_write()
3435 return rc; in genfs_write()
3436 rc = context_write(p, &c->context[0], fp); in genfs_write()
3437 if (rc) in genfs_write()
3438 return rc; in genfs_write()
3452 int rc; in range_write_helper() local
3456 rc = put_entry(buf, sizeof(u32), 2, fp); in range_write_helper()
3457 if (rc) in range_write_helper()
3458 return rc; in range_write_helper()
3461 rc = put_entry(buf, sizeof(u32), 1, fp); in range_write_helper()
3462 if (rc) in range_write_helper()
3463 return rc; in range_write_helper()
3465 rc = mls_write_range_helper(r, fp); in range_write_helper()
3466 if (rc) in range_write_helper()
3467 return rc; in range_write_helper()
3475 int rc; in range_write() local
3482 rc = put_entry(buf, sizeof(u32), 1, fp); in range_write()
3483 if (rc) in range_write()
3484 return rc; in range_write()
3487 rc = hashtab_map(&p->range_tr, range_write_helper, &pd); in range_write()
3488 if (rc) in range_write()
3489 return rc; in range_write()
3501 int rc; in filename_write_helper_compat() local
3507 rc = put_entry(buf, sizeof(u32), 1, fp); in filename_write_helper_compat()
3508 if (rc) in filename_write_helper_compat()
3509 return rc; in filename_write_helper_compat()
3511 rc = put_entry(ft->name, sizeof(char), len, fp); in filename_write_helper_compat()
3512 if (rc) in filename_write_helper_compat()
3513 return rc; in filename_write_helper_compat()
3520 rc = put_entry(buf, sizeof(u32), 4, fp); in filename_write_helper_compat()
3521 if (rc) in filename_write_helper_compat()
3522 return rc; in filename_write_helper_compat()
3537 int rc; in filename_write_helper() local
3541 rc = put_entry(buf, sizeof(u32), 1, fp); in filename_write_helper()
3542 if (rc) in filename_write_helper()
3543 return rc; in filename_write_helper()
3545 rc = put_entry(ft->name, sizeof(char), len, fp); in filename_write_helper()
3546 if (rc) in filename_write_helper()
3547 return rc; in filename_write_helper()
3559 rc = put_entry(buf, sizeof(u32), 3, fp); in filename_write_helper()
3560 if (rc) in filename_write_helper()
3561 return rc; in filename_write_helper()
3565 rc = ebitmap_write(&datum->stypes, fp); in filename_write_helper()
3566 if (rc) in filename_write_helper()
3567 return rc; in filename_write_helper()
3570 rc = put_entry(buf, sizeof(u32), 1, fp); in filename_write_helper()
3571 if (rc) in filename_write_helper()
3572 return rc; in filename_write_helper()
3583 int rc; in filename_trans_write() local
3590 rc = put_entry(buf, sizeof(u32), 1, fp); in filename_trans_write()
3591 if (rc) in filename_trans_write()
3592 return rc; in filename_trans_write()
3594 rc = hashtab_map(&p->filename_trans, in filename_trans_write()
3598 rc = put_entry(buf, sizeof(u32), 1, fp); in filename_trans_write()
3599 if (rc) in filename_trans_write()
3600 return rc; in filename_trans_write()
3602 rc = hashtab_map(&p->filename_trans, filename_write_helper, fp); in filename_trans_write()
3604 return rc; in filename_trans_write()
3615 int rc; in policydb_write() local
3647 rc = put_entry(buf, sizeof(u32), 2, fp); in policydb_write()
3648 if (rc) in policydb_write()
3649 return rc; in policydb_write()
3650 rc = put_entry(POLICYDB_STRING, 1, len, fp); in policydb_write()
3651 if (rc) in policydb_write()
3652 return rc; in policydb_write()
3667 rc = put_entry(buf, sizeof(u32), 4, fp); in policydb_write()
3668 if (rc) in policydb_write()
3669 return rc; in policydb_write()
3672 rc = ebitmap_write(&p->policycaps, fp); in policydb_write()
3673 if (rc) in policydb_write()
3674 return rc; in policydb_write()
3678 rc = ebitmap_write(&p->permissive_map, fp); in policydb_write()
3679 if (rc) in policydb_write()
3680 return rc; in policydb_write()
3693 rc = put_entry(buf, sizeof(u32), 2, fp); in policydb_write()
3694 if (rc) in policydb_write()
3695 return rc; in policydb_write()
3696 rc = hashtab_map(&p->symtab[i].table, write_f[i], &pd); in policydb_write()
3697 if (rc) in policydb_write()
3698 return rc; in policydb_write()
3701 rc = avtab_write(p, &p->te_avtab, fp); in policydb_write()
3702 if (rc) in policydb_write()
3703 return rc; in policydb_write()
3705 rc = cond_write_list(p, fp); in policydb_write()
3706 if (rc) in policydb_write()
3707 return rc; in policydb_write()
3709 rc = role_trans_write(p, fp); in policydb_write()
3710 if (rc) in policydb_write()
3711 return rc; in policydb_write()
3713 rc = role_allow_write(p->role_allow, fp); in policydb_write()
3714 if (rc) in policydb_write()
3715 return rc; in policydb_write()
3717 rc = filename_trans_write(p, fp); in policydb_write()
3718 if (rc) in policydb_write()
3719 return rc; in policydb_write()
3721 rc = ocontext_write(p, info, fp); in policydb_write()
3722 if (rc) in policydb_write()
3723 return rc; in policydb_write()
3725 rc = genfs_write(p, fp); in policydb_write()
3726 if (rc) in policydb_write()
3727 return rc; in policydb_write()
3729 rc = range_write(p, fp); in policydb_write()
3730 if (rc) in policydb_write()
3731 return rc; in policydb_write()
3736 rc = ebitmap_write(e, fp); in policydb_write()
3737 if (rc) in policydb_write()
3738 return rc; in policydb_write()