Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
bb3cf335
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
bb3cf335
编写于
4月 06, 2005
作者:
A
Anton Altaparmakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NTFS: Update attribute definition handling.
Signed-off-by:
N
Anton Altaparmakov
<
aia21@cantab.net
>
上级
b0d2374d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
27 deletion
+40
-27
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+1
-0
fs/ntfs/attrib.c
fs/ntfs/attrib.c
+7
-14
fs/ntfs/layout.h
fs/ntfs/layout.h
+30
-12
fs/ntfs/ntfs.h
fs/ntfs/ntfs.h
+2
-1
未找到文件。
fs/ntfs/ChangeLog
浏览文件 @
bb3cf335
...
@@ -110,6 +110,7 @@ ToDo/Notes:
...
@@ -110,6 +110,7 @@ ToDo/Notes:
only emit a warning when the checksum is incorrect rather than
only emit a warning when the checksum is incorrect rather than
refusing the mount. Thanks to Bernd Casimir for pointing this
refusing the mount. Thanks to Bernd Casimir for pointing this
problem out.
problem out.
- Update attribute definition handling.
2.1.22 - Many bug and race fixes and error handling improvements.
2.1.22 - Many bug and race fixes and error handling improvements.
...
...
fs/ntfs/attrib.c
浏览文件 @
bb3cf335
...
@@ -1138,28 +1138,21 @@ int ntfs_attr_size_bounds_check(const ntfs_volume *vol, const ATTR_TYPE type,
...
@@ -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
* 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.
* 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.
* -ENOENT if the attribute is not listed in $AttrDef.
*/
*/
int
ntfs_attr_can_be_non_resident
(
const
ntfs_volume
*
vol
,
const
ATTR_TYPE
type
)
int
ntfs_attr_can_be_non_resident
(
const
ntfs_volume
*
vol
,
const
ATTR_TYPE
type
)
{
{
ATTR_DEF
*
ad
;
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. */
/* Find the attribute definition record in $AttrDef. */
ad
=
ntfs_attr_find_in_attrdef
(
vol
,
type
);
ad
=
ntfs_attr_find_in_attrdef
(
vol
,
type
);
if
(
unlikely
(
!
ad
))
if
(
unlikely
(
!
ad
))
return
-
ENOENT
;
return
-
ENOENT
;
/* Check the flags and return the result. */
/* Check the flags and return the result. */
if
(
ad
->
flags
&
CAN_BE_NON
_RESIDENT
)
if
(
ad
->
flags
&
ATTR_DEF
_RESIDENT
)
return
0
;
return
-
EPERM
;
return
-
EPERM
;
return
0
;
}
}
/**
/**
...
@@ -1182,9 +1175,9 @@ int ntfs_attr_can_be_non_resident(const ntfs_volume *vol, const ATTR_TYPE type)
...
@@ -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
)
int
ntfs_attr_can_be_resident
(
const
ntfs_volume
*
vol
,
const
ATTR_TYPE
type
)
{
{
if
(
type
!=
AT_INDEX_ALLOCATION
&&
type
!
=
AT_EA
)
if
(
type
==
AT_INDEX_ALLOCATION
||
type
=
=
AT_EA
)
return
0
;
return
-
EPERM
;
return
-
EPERM
;
return
0
;
}
}
/**
/**
...
...
fs/ntfs/layout.h
浏览文件 @
bb3cf335
...
@@ -547,26 +547,44 @@ enum {
...
@@ -547,26 +547,44 @@ enum {
COLLATION_NTOFS_ULONG
=
const_cpu_to_le32
(
0x10
),
COLLATION_NTOFS_ULONG
=
const_cpu_to_le32
(
0x10
),
COLLATION_NTOFS_SID
=
const_cpu_to_le32
(
0x11
),
COLLATION_NTOFS_SID
=
const_cpu_to_le32
(
0x11
),
COLLATION_NTOFS_SECURITY_HASH
=
const_cpu_to_le32
(
0x12
),
COLLATION_NTOFS_SECURITY_HASH
=
const_cpu_to_le32
(
0x12
),
COLLATION_NTOFS_ULONGS
=
const_cpu_to_le32
(
0x13
)
COLLATION_NTOFS_ULONGS
=
const_cpu_to_le32
(
0x13
)
,
};
};
typedef
le32
COLLATION_RULE
;
typedef
le32
COLLATION_RULE
;
/*
/*
* The flags (32-bit) describing attribute properties in the attribute
* The flags (32-bit) describing attribute properties in the attribute
* definition structure. FIXME: This information is from Regis's information
* definition structure. FIXME: This information is based on Regis's
* and, according to him, it is not certain and probably incomplete.
* information and, according to him, it is not certain and probably
* The INDEXABLE flag is fairly certainly correct as only the file name
* incomplete. The INDEXABLE flag is fairly certainly correct as only the file
* attribute has this flag set and this is the only attribute indexed in NT4.
* name attribute has this flag set and this is the only attribute indexed in
* NT4.
*/
*/
enum
{
enum
{
INDEXABLE
=
const_cpu_to_le32
(
0x02
),
/* Attribute can be
ATTR_DEF_INDEXABLE
=
const_cpu_to_le32
(
0x02
),
/* Attribute can be
indexed. */
indexed. */
NEED_TO_REGENERATE
=
const_cpu_to_le32
(
0x40
),
/* Need to regenerate
ATTR_DEF_MULTIPLE
=
const_cpu_to_le32
(
0x04
),
/* Attribute type
during regeneration
can be present multiple times in the
phase. */
mft records of an inode. */
CAN_BE_NON_RESIDENT
=
const_cpu_to_le32
(
0x80
),
/* Attribute can be
ATTR_DEF_NOT_ZERO
=
const_cpu_to_le32
(
0x08
),
/* Attribute value
non-resident. */
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. */
};
};
typedef
le32
ATTR_DEF_FLAGS
;
typedef
le32
ATTR_DEF_FLAGS
;
...
...
fs/ntfs/ntfs.h
浏览文件 @
bb3cf335
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* ntfs.h - Defines for NTFS Linux kernel driver. Part of the Linux-NTFS
* ntfs.h - Defines for NTFS Linux kernel driver. Part of the Linux-NTFS
* project.
* project.
*
*
* Copyright (c) 2001-200
4
Anton Altaparmakov
* Copyright (c) 2001-200
5
Anton Altaparmakov
* Copyright (C) 2002 Richard Russon
* Copyright (C) 2002 Richard Russon
*
*
* This program/include file is free software; you can redistribute it and/or
* This program/include file is free software; you can redistribute it and/or
...
@@ -41,6 +41,7 @@ typedef enum {
...
@@ -41,6 +41,7 @@ typedef enum {
NTFS_BLOCK_SIZE_BITS
=
9
,
NTFS_BLOCK_SIZE_BITS
=
9
,
NTFS_SB_MAGIC
=
0x5346544e
,
/* 'NTFS' */
NTFS_SB_MAGIC
=
0x5346544e
,
/* 'NTFS' */
NTFS_MAX_NAME_LEN
=
255
,
NTFS_MAX_NAME_LEN
=
255
,
NTFS_MAX_ATTR_NAME_LEN
=
255
,
}
NTFS_CONSTANTS
;
}
NTFS_CONSTANTS
;
/* Global variables. */
/* Global variables. */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录