Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
0aacceac
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0aacceac
编写于
9月 08, 2005
作者:
A
Anton Altaparmakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NTFS: Add fs/ntfs/attrib.[hc]::ntfs_resident_attr_value_resize().
Signed-off-by:
N
Anton Altaparmakov
<
aia21@cantab.net
>
上级
f25dfb5e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
43 addition
and
0 deletion
+43
-0
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+1
-0
fs/ntfs/attrib.c
fs/ntfs/attrib.c
+40
-0
fs/ntfs/attrib.h
fs/ntfs/attrib.h
+2
-0
未找到文件。
fs/ntfs/ChangeLog
浏览文件 @
0aacceac
...
...
@@ -59,6 +59,7 @@ ToDo/Notes:
index entry is in the index root, we forgot to set the @ir pointer in
the index context. Thanks to Yura Pakhuchiy for finding this bug.
- Remove bogus setting of PageError in ntfs_read_compressed_block().
- Add fs/ntfs/attrib.[hc]::ntfs_resident_attr_value_resize().
2.1.23 - Implement extension of resident files and make writing safe as well as
many bug fixes, cleanups, and enhancements...
...
...
fs/ntfs/attrib.c
浏览文件 @
0aacceac
...
...
@@ -1246,6 +1246,46 @@ int ntfs_attr_record_resize(MFT_RECORD *m, ATTR_RECORD *a, u32 new_size)
return
0
;
}
/**
* ntfs_resident_attr_value_resize - resize the value of a resident attribute
* @m: mft record containing attribute record
* @a: attribute record whose value to resize
* @new_size: new size in bytes to which to resize the attribute value of @a
*
* Resize the value of the attribute @a in the mft record @m to @new_size bytes.
* If the value is made bigger, the newly allocated space is cleared.
*
* Return 0 on success and -errno on error. The following error codes are
* defined:
* -ENOSPC - Not enough space in the mft record @m to perform the resize.
*
* Note: On error, no modifications have been performed whatsoever.
*
* Warning: If you make a record smaller without having copied all the data you
* are interested in the data may be overwritten.
*/
int
ntfs_resident_attr_value_resize
(
MFT_RECORD
*
m
,
ATTR_RECORD
*
a
,
const
u32
new_size
)
{
u32
old_size
;
/* Resize the resident part of the attribute record. */
if
(
ntfs_attr_record_resize
(
m
,
a
,
le16_to_cpu
(
a
->
data
.
resident
.
value_offset
)
+
new_size
))
return
-
ENOSPC
;
/*
* The resize succeeded! If we made the attribute value bigger, clear
* the area between the old size and @new_size.
*/
old_size
=
le32_to_cpu
(
a
->
data
.
resident
.
value_length
);
if
(
new_size
>
old_size
)
memset
((
u8
*
)
a
+
le16_to_cpu
(
a
->
data
.
resident
.
value_offset
)
+
old_size
,
0
,
new_size
-
old_size
);
/* Finally update the length of the attribute value. */
a
->
data
.
resident
.
value_length
=
cpu_to_le32
(
new_size
);
return
0
;
}
/**
* ntfs_attr_make_non_resident - convert a resident to a non-resident attribute
* @ni: ntfs inode describing the attribute to convert
...
...
fs/ntfs/attrib.h
浏览文件 @
0aacceac
...
...
@@ -99,6 +99,8 @@ extern int ntfs_attr_can_be_resident(const ntfs_volume *vol,
const
ATTR_TYPE
type
);
extern
int
ntfs_attr_record_resize
(
MFT_RECORD
*
m
,
ATTR_RECORD
*
a
,
u32
new_size
);
extern
int
ntfs_resident_attr_value_resize
(
MFT_RECORD
*
m
,
ATTR_RECORD
*
a
,
const
u32
new_size
);
extern
int
ntfs_attr_make_non_resident
(
ntfs_inode
*
ni
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录