- Update attribute definition handling. (Anton, Yura)

edge.strict_endians
cha0smaster 2005-06-09 22:09:39 +00:00
parent aae6371c9d
commit 676d8782e8
3 changed files with 35 additions and 21 deletions

View File

@ -158,6 +158,7 @@ xx/xx/2005 - 2.0.0-WIP
FileNameDirty to indicate that FILE_NAME attributes need update.
At least after attribute resize we leave absolutely consist
volume. (Yura)
- Update attribute definition handling. (Anton, Yura)
04/09/2004 - 1.9.4 - Urgent bug fixes.

View File

@ -539,19 +539,37 @@ typedef enum {
/*
* The flags (32-bit) describing attribute properties in the attribute
* definition structure. FIXME: This information is from Regis's information
* and, according to him, it is not certain and probably incomplete.
* The INDEXABLE flag is fairly certainly correct as only the file name
* attribute has this flag set and this is the only attribute indexed in NT4.
* definition structure. FIXME: This information is based on Regis's
* information and, according to him, it is not certain and probably
* incomplete. The INDEXABLE flag is fairly certainly correct as only the file
* name attribute has this flag set and this is the only attribute indexed in
* NT4.
*/
typedef enum {
INDEXABLE = const_cpu_to_le32(0x02), /* Attribute can be
indexed. */
NEED_TO_REGENERATE = const_cpu_to_le32(0x40), /* Need to regenerate
during regeneration
phase. */
CAN_BE_NON_RESIDENT = const_cpu_to_le32(0x80), /* Attribute can be
non-resident. */
ATTR_DEF_INDEXABLE = const_cpu_to_le32(0x02), /* Attribute can be
indexed. */
ATTR_DEF_MULTIPLE = const_cpu_to_le32(0x04), /* Attribute type
can be present multiple times in the
mft records of an inode. */
ATTR_DEF_NOT_ZERO = const_cpu_to_le32(0x08), /* Attribute value
must contain at least one non-zero
byte. */
ATTR_DEF_INDEXED_UNIQUE = const_cpu_to_le32(0x10), /* Attribute must be
indexed and the attribute value must be
unique for the attribute type in all of
the mft records of an inode. */
ATTR_DEF_NAMED_UNIQUE = const_cpu_to_le32(0x20), /* Attribute must be
named and the name must be unique for
the attribute type in all of the mft
records of an inode. */
ATTR_DEF_RESIDENT = const_cpu_to_le32(0x40), /* Attribute must be
resident. */
ATTR_DEF_ALWAYS_LOG = const_cpu_to_le32(0x80), /* Always log
modifications to this attribute,
regardless of whether it is resident or
non-resident. Without this, only log
modifications if the attribute is
resident. */
} ATTR_DEF_FLAGS;
/*

View File

@ -2358,21 +2358,16 @@ int ntfs_attr_can_be_non_resident(const ntfs_volume *vol, const ATTR_TYPES type)
{
ATTR_DEF *ad;
/*
* $DATA is always allowed to be non-resident even if $AttrDef does not
* specify this in the flags of the $DATA attribute definition record.
*/
if (type == AT_DATA)
return 0;
/* Find the attribute definition record in $AttrDef. */
ad = ntfs_attr_find_in_attrdef(vol, type);
if (!ad)
return -1;
/* Check the flags and return the result. */
if (ad->flags & CAN_BE_NON_RESIDENT)
return 0;
errno = EPERM;
return -1;
if (ad->flags & ATTR_DEF_RESIDENT) {
errno = EPERM;
return -1;
}
return 0;
}
/**