summaryrefslogtreecommitdiff
path: root/fs/ntfs/attrib.c
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-04-06 16:34:31 +0400
committerAnton Altaparmakov <aia21@cantab.net>2005-05-05 14:46:17 +0400
commitbb3cf33509009132cf8c7a7729f9d26c0c5fa961 (patch)
tree1e5a6a8bdf12e158a792b26b1d24b1743ce8a975 /fs/ntfs/attrib.c
parentb0d2374d62faed034dd80e6524efb98a6341597c (diff)
downloadlinux-bb3cf33509009132cf8c7a7729f9d26c0c5fa961.tar.xz
NTFS: Update attribute definition handling.
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs/attrib.c')
-rw-r--r--fs/ntfs/attrib.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c
index 1b95f39234a3..23ca3bdfb89a 100644
--- a/fs/ntfs/attrib.c
+++ b/fs/ntfs/attrib.c
@@ -1138,28 +1138,21 @@ int ntfs_attr_size_bounds_check(const ntfs_volume *vol, const ATTR_TYPE type,
* Check whether the attribute of @type on the ntfs volume @vol is allowed to
* be non-resident. This information is obtained from $AttrDef system file.
*
- * Return 0 if the attribute is allowed to be non-resident, -EPERM if not, or
+ * Return 0 if the attribute is allowed to be non-resident, -EPERM if not, and
* -ENOENT if the attribute is not listed in $AttrDef.
*/
int ntfs_attr_can_be_non_resident(const ntfs_volume *vol, const ATTR_TYPE type)
{
ATTR_DEF *ad;
- /*
- * $DATA and $EA are 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 || type == AT_EA)
- return 0;
/* Find the attribute definition record in $AttrDef. */
ad = ntfs_attr_find_in_attrdef(vol, type);
if (unlikely(!ad))
return -ENOENT;
/* Check the flags and return the result. */
- if (ad->flags & CAN_BE_NON_RESIDENT)
- return 0;
- return -EPERM;
+ if (ad->flags & ATTR_DEF_RESIDENT)
+ return -EPERM;
+ return 0;
}
/**
@@ -1182,9 +1175,9 @@ int ntfs_attr_can_be_non_resident(const ntfs_volume *vol, const ATTR_TYPE type)
*/
int ntfs_attr_can_be_resident(const ntfs_volume *vol, const ATTR_TYPE type)
{
- if (type != AT_INDEX_ALLOCATION && type != AT_EA)
- return 0;
- return -EPERM;
+ if (type == AT_INDEX_ALLOCATION || type == AT_EA)
+ return -EPERM;
+ return 0;
}
/**