Lines Matching refs:vol
437 static int entersecurity_stuff(ntfs_volume *vol, off_t offs)
450 written = ntfs_attr_data_write(vol->secure_ni,
477 static int entersecurity_data(ntfs_volume *vol,
508 written1 = ntfs_attr_data_write(vol->secure_ni,
511 written2 = ntfs_attr_data_write(vol->secure_ni,
524 res = ntfs_attr_shrink_size(vol->secure_ni,STREAM_SDS,
542 static int entersecurity_indexes(ntfs_volume *vol, s64 attrsz,
561 xsii = vol->secure_xsii;
582 xsdh = vol->secure_xsdh;
620 static le32 entersecurityattr(ntfs_volume *vol,
653 xsii = vol->secure_xsii;
747 na = ntfs_attr_open(vol->secure_ni,AT_INDEX_ROOT,sii_stream,4);
782 entersecurity_stuff(vol, offs);
795 if (entersecurity_data(vol, attr, attrsz, hash, securid, offs, gap)
796 || entersecurity_indexes(vol, attrsz, hash, securid, offs))
800 ntfs_index_entry_mark_dirty(vol->secure_xsii);
801 ntfs_index_ctx_reinit(vol->secure_xsii);
802 ntfs_index_entry_mark_dirty(vol->secure_xsdh);
803 ntfs_index_ctx_reinit(vol->secure_xsdh);
804 NInoSetDirty(vol->secure_ni);
805 if (ntfs_inode_sync(vol->secure_ni))
819 static le32 setsecurityattr(ntfs_volume *vol,
848 xsdh = vol->secure_xsdh;
849 if (vol->secure_ni && xsdh && !vol->secure_reentry++) {
894 vol->secure_ni,
922 securid = entersecurityattr(vol,
928 if (--vol->secure_reentry)
942 static int update_secur_descr(ntfs_volume *vol,
953 if ((vol->major_ver < 3) || !vol->secure_ni) {
1009 securid = setsecurityattr(vol,
1068 static int upgrade_secur_desc(ntfs_volume *vol,
1082 if ((vol->major_ver >= 3)
1085 securid = setsecurityattr(vol,
1192 if (scx->vol->secure_flags & (1 << SECURITY_STATICGRPS))
1269 if (scx->vol->secure_flags & (1 << SECURITY_STATICGRPS))
1708 scx->vol->legacy_cache, GENERIC(&wanted),
1776 scx->vol->legacy_cache, GENERIC(&wanted),
1795 static char *retrievesecurityattr(ntfs_volume *vol, SII_INDEX_KEY id)
1814 ni = vol->secure_ni;
1815 xsii = vol->secure_xsii;
1869 static char *getsecurityattr(ntfs_volume *vol, ntfs_inode *ni)
1882 && vol->secure_ni && ni->security_id) {
1885 securattr = retrievesecurityattr(vol,securid);
1942 noacl = !(scx->vol->secure_flags & (1 << SECURITY_ACL));
2095 securattr = getsecurityattr(scx->vol, ni);
2133 && (scx->vol->secure_flags
2135 upgrade_secur_desc(scx->vol,
2192 securattr = getsecurityattr(scx->vol, ni);
2219 && (scx->vol->secure_flags
2221 upgrade_secur_desc(scx->vol,
2327 securattr = getsecurityattr(scx->vol, ni);
2357 && (scx->vol->secure_flags
2359 upgrade_secur_desc(scx->vol,
2422 securattr = getsecurityattr(scx->vol, ni);
2459 if (!(scx->vol->secure_flags & (1 << SECURITY_ACL))
2472 securattr = getsecurityattr(scx->vol, ni);
2490 if (!(scx->vol->secure_flags
2511 && (scx->vol->secure_flags
2513 upgrade_secur_desc(scx->vol,
2575 if (scx->vol->secure_flags & (1 << SECURITY_ACL))
2583 securattr = getsecurityattr(scx->vol, dir_ni);
2611 && (scx->vol->secure_flags
2613 upgrade_secur_desc(scx->vol,
2624 if (scx->vol->secure_flags
2680 scx->vol->securid_cache, GENERIC(&wanted),
2688 if (!cached && (scx->vol->major_ver >= 3)) {
2700 securid = setsecurityattr(scx->vol,
2706 ntfs_enter_cache(scx->vol->securid_cache,
2757 res = update_secur_descr(scx->vol, newattr, ni);
2773 ntfs_invalidate_cache(scx->vol->legacy_cache,
2819 scx->vol->securid_cache, GENERIC(&wanted),
2827 if (!cached && (scx->vol->major_ver >= 3)) {
2838 securid = setsecurityattr(scx->vol,
2844 ntfs_enter_cache(scx->vol->securid_cache,
2910 scx->vol->securid_cache, GENERIC(&wanted),
2952 res = update_secur_descr(scx->vol, newattr, ni);
2965 ntfs_enter_cache(scx->vol->securid_cache,
2982 ntfs_invalidate_cache(scx->vol->legacy_cache,
3033 oldattr = getsecurityattr(scx->vol, ni);
3116 oldattr = getsecurityattr(scx->vol, ni);
3206 res = update_secur_descr(scx->vol, attr, ni);
3228 ntfs_invalidate_cache(scx->vol->legacy_cache,
3293 oldattr = getsecurityattr(scx->vol, ni);
3594 dir_ni = ntfs_pathname_to_inode(scx->vol, NULL, dirpath);
3605 ni = ntfs_pathname_to_inode(scx->vol, NULL,
3664 oldattr = getsecurityattr(scx->vol, ni);
3795 oldattr = getsecurityattr(scx->vol, ni);
4005 securid = setsecurityattr(scx->vol,
4055 parentattr = getsecurityattr(scx->vol, dir_ni);
4257 ni = ntfs_pathname_to_inode(scx->vol, NULL, "/.");
4259 securattr = getsecurityattr(scx->vol, ni);
4346 ni = ntfs_pathname_to_inode(scx->vol, NULL, usermap_path);
4473 int ntfs_open_secure(ntfs_volume *vol)
4479 if (vol->secure_ni) /* Already open? */
4482 ni = ntfs_pathname_to_inode(vol, NULL, "$Secure");
4501 vol->secure_xsdh = sdh;
4502 vol->secure_xsii = sii;
4503 vol->secure_ni = ni;
4512 if (vol->major_ver < 3)
4524 int ntfs_close_secure(ntfs_volume *vol)
4528 if (vol->secure_ni) {
4529 ntfs_index_ctx_put(vol->secure_xsdh);
4530 ntfs_index_ctx_put(vol->secure_xsii);
4531 res = ntfs_inode_close(vol->secure_ni);
4532 vol->secure_ni = NULL;
4711 static BOOL mergesecurityattr(ntfs_volume *vol, const char *oldattr,
4860 ok = !update_secur_descr(vol, target, ni);
4897 ni = ntfs_pathname_to_inode(scapi->security.vol, NULL, path);
4899 attr = getsecurityattr(scapi->security.vol, ni);
4964 ni = ntfs_pathname_to_inode(scapi->security.vol,
4967 oldattr = getsecurityattr(scapi->security.vol,
4971 scapi->security.vol,
5014 ni = ntfs_pathname_to_inode(scapi->security.vol, NULL, path);
5061 ni = ntfs_pathname_to_inode(scapi->security.vol, NULL, path);
5107 ni = ntfs_pathname_to_inode(scapi->security.vol, NULL, path);
5137 if (scapi->security.vol->secure_ni)
5138 got = ntfs_attr_data_read(scapi->security.vol->secure_ni,
5163 xsii = scapi->security.vol->secure_xsii;
5199 xsdh = scapi->security.vol->secure_xsdh;
5336 ntfs_volume *vol;
5345 vol = ntfs_mount(device, flags);
5346 if (vol) {
5349 if (!ntfs_volume_get_free_space(vol)
5354 scx->vol = vol;
5358 scx->vol->secure_flags = 0;
5366 mnt = ntfs_umount(vol,FALSE);
5387 ntfs_volume *vol;
5390 if (scapi && (scapi->magic == MAGIC_API) && scapi->security.vol) {
5391 vol = scapi->security.vol;
5394 if (!ntfs_umount(vol, 0))