Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
a0646a1f
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,发现更多精彩内容 >>
提交
a0646a1f
编写于
3月 23, 2006
作者:
A
Anton Altaparmakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NTFS: Add support for sparse files which have a compression unit of 0.
Signed-off-by:
N
Anton Altaparmakov
<
aia21@cantab.net
>
上级
949763b2
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
75 addition
and
38 deletion
+75
-38
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+1
-0
fs/ntfs/attrib.c
fs/ntfs/attrib.c
+17
-8
fs/ntfs/inode.c
fs/ntfs/inode.c
+45
-23
fs/ntfs/layout.h
fs/ntfs/layout.h
+12
-7
未找到文件。
fs/ntfs/ChangeLog
浏览文件 @
a0646a1f
...
...
@@ -31,6 +31,7 @@ ToDo/Notes:
- Fix comparison of $MFT and $MFTMirr to not bail out when there are
unused, invalid mft records which are the same in both $MFT and
$MFTMirr.
- Add support for sparse files which have a compression unit of 0.
2.1.26 - Minor bug fixes and updates.
...
...
fs/ntfs/attrib.c
浏览文件 @
a0646a1f
...
...
@@ -1695,7 +1695,9 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni, const u32 data_size)
a
->
data
.
non_resident
.
initialized_size
=
cpu_to_sle64
(
attr_size
);
if
(
NInoSparse
(
ni
)
||
NInoCompressed
(
ni
))
{
a
->
data
.
non_resident
.
compression_unit
=
4
;
a
->
data
.
non_resident
.
compression_unit
=
0
;
if
(
NInoCompressed
(
ni
)
||
vol
->
major_ver
<
3
)
a
->
data
.
non_resident
.
compression_unit
=
4
;
a
->
data
.
non_resident
.
compressed_size
=
a
->
data
.
non_resident
.
allocated_size
;
}
else
...
...
@@ -1714,13 +1716,20 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni, const u32 data_size)
ni
->
allocated_size
=
new_size
;
if
(
NInoSparse
(
ni
)
||
NInoCompressed
(
ni
))
{
ni
->
itype
.
compressed
.
size
=
ni
->
allocated_size
;
ni
->
itype
.
compressed
.
block_size
=
1U
<<
(
a
->
data
.
non_resident
.
compression_unit
+
vol
->
cluster_size_bits
);
ni
->
itype
.
compressed
.
block_size_bits
=
ffs
(
ni
->
itype
.
compressed
.
block_size
)
-
1
;
ni
->
itype
.
compressed
.
block_clusters
=
1U
<<
a
->
data
.
non_resident
.
compression_unit
;
if
(
a
->
data
.
non_resident
.
compression_unit
)
{
ni
->
itype
.
compressed
.
block_size
=
1U
<<
(
a
->
data
.
non_resident
.
compression_unit
+
vol
->
cluster_size_bits
);
ni
->
itype
.
compressed
.
block_size_bits
=
ffs
(
ni
->
itype
.
compressed
.
block_size
)
-
1
;
ni
->
itype
.
compressed
.
block_clusters
=
1U
<<
a
->
data
.
non_resident
.
compression_unit
;
}
else
{
ni
->
itype
.
compressed
.
block_size
=
0
;
ni
->
itype
.
compressed
.
block_size_bits
=
0
;
ni
->
itype
.
compressed
.
block_clusters
=
0
;
}
vi
->
i_blocks
=
ni
->
itype
.
compressed
.
size
>>
9
;
}
else
vi
->
i_blocks
=
ni
->
allocated_size
>>
9
;
...
...
fs/ntfs/inode.c
浏览文件 @
a0646a1f
/**
* inode.c - NTFS kernel inode handling. Part of the Linux-NTFS project.
*
* Copyright (c) 2001-200
5
Anton Altaparmakov
* Copyright (c) 2001-200
6
Anton Altaparmakov
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
...
...
@@ -24,8 +24,10 @@
#include <linux/smp_lock.h>
#include <linux/quotaops.h>
#include <linux/mount.h>
#include <linux/mutex.h>
#include "aops.h"
#include "attrib.h"
#include "dir.h"
#include "debug.h"
#include "inode.h"
...
...
@@ -1064,10 +1066,10 @@ static int ntfs_read_locked_inode(struct inode *vi)
if
(
a
->
non_resident
)
{
NInoSetNonResident
(
ni
);
if
(
NInoCompressed
(
ni
)
||
NInoSparse
(
ni
))
{
if
(
a
->
data
.
non_resident
.
compression_unit
!=
4
)
{
if
(
NInoCompressed
(
ni
)
&&
a
->
data
.
non_resident
.
compression_unit
!=
4
)
{
ntfs_error
(
vi
->
i_sb
,
"Found "
"nonstandard "
"non
-
standard "
"compression unit (%u "
"instead of 4). "
"Cannot handle this."
,
...
...
@@ -1076,16 +1078,26 @@ static int ntfs_read_locked_inode(struct inode *vi)
err
=
-
EOPNOTSUPP
;
goto
unm_err_out
;
}
ni
->
itype
.
compressed
.
block_clusters
=
1U
<<
a
->
data
.
non_resident
.
compression_unit
;
ni
->
itype
.
compressed
.
block_size
=
1U
<<
(
a
->
data
.
non_resident
.
compression_unit
+
vol
->
cluster_size_bits
);
ni
->
itype
.
compressed
.
block_size_bits
=
ffs
(
ni
->
itype
.
compressed
.
block_size
)
-
1
;
if
(
a
->
data
.
non_resident
.
compression_unit
)
{
ni
->
itype
.
compressed
.
block_size
=
1U
<<
(
a
->
data
.
non_resident
.
compression_unit
+
vol
->
cluster_size_bits
);
ni
->
itype
.
compressed
.
block_size_bits
=
ffs
(
ni
->
itype
.
compressed
.
block_size
)
-
1
;
ni
->
itype
.
compressed
.
block_clusters
=
1U
<<
a
->
data
.
non_resident
.
compression_unit
;
}
else
{
ni
->
itype
.
compressed
.
block_size
=
0
;
ni
->
itype
.
compressed
.
block_size_bits
=
0
;
ni
->
itype
.
compressed
.
block_clusters
=
0
;
}
ni
->
itype
.
compressed
.
size
=
sle64_to_cpu
(
a
->
data
.
non_resident
.
compressed_size
);
...
...
@@ -1338,8 +1350,9 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi)
goto
unm_err_out
;
}
if
(
NInoCompressed
(
ni
)
||
NInoSparse
(
ni
))
{
if
(
a
->
data
.
non_resident
.
compression_unit
!=
4
)
{
ntfs_error
(
vi
->
i_sb
,
"Found nonstandard "
if
(
NInoCompressed
(
ni
)
&&
a
->
data
.
non_resident
.
compression_unit
!=
4
)
{
ntfs_error
(
vi
->
i_sb
,
"Found non-standard "
"compression unit (%u instead "
"of 4). Cannot handle this."
,
a
->
data
.
non_resident
.
...
...
@@ -1347,13 +1360,22 @@ static int ntfs_read_locked_attr_inode(struct inode *base_vi, struct inode *vi)
err
=
-
EOPNOTSUPP
;
goto
unm_err_out
;
}
ni
->
itype
.
compressed
.
block_clusters
=
1U
<<
a
->
data
.
non_resident
.
compression_unit
;
ni
->
itype
.
compressed
.
block_size
=
1U
<<
(
a
->
data
.
non_resident
.
compression_unit
+
vol
->
cluster_size_bits
);
ni
->
itype
.
compressed
.
block_size_bits
=
ffs
(
ni
->
itype
.
compressed
.
block_size
)
-
1
;
if
(
a
->
data
.
non_resident
.
compression_unit
)
{
ni
->
itype
.
compressed
.
block_size
=
1U
<<
(
a
->
data
.
non_resident
.
compression_unit
+
vol
->
cluster_size_bits
);
ni
->
itype
.
compressed
.
block_size_bits
=
ffs
(
ni
->
itype
.
compressed
.
block_size
)
-
1
;
ni
->
itype
.
compressed
.
block_clusters
=
1U
<<
a
->
data
.
non_resident
.
compression_unit
;
}
else
{
ni
->
itype
.
compressed
.
block_size
=
0
;
ni
->
itype
.
compressed
.
block_size_bits
=
0
;
ni
->
itype
.
compressed
.
block_clusters
=
0
;
}
ni
->
itype
.
compressed
.
size
=
sle64_to_cpu
(
a
->
data
.
non_resident
.
compressed_size
);
}
...
...
fs/ntfs/layout.h
浏览文件 @
a0646a1f
...
...
@@ -769,7 +769,7 @@ typedef struct {
compressed. (This effectively limits the
compression unit size to be a power of two
clusters.) WinNT4 only uses a value of 4.
Sparse files
also have this set to 4
. */
Sparse files
have this set to 0 on XPSP2
. */
/* 35*/
u8
reserved
[
5
];
/* Align to 8-byte boundary. */
/* The sizes below are only used when lowest_vcn is zero, as otherwise it would
be difficult to keep them up-to-date.*/
...
...
@@ -1076,16 +1076,21 @@ typedef struct {
/* 20*/
sle64
last_access_time
;
/* Time this mft record was last
accessed. */
/* 28*/
sle64
allocated_size
;
/* Byte size of on-disk allocated space
for the
data attribute. So for
normal $DATA, this is the
for the
unnamed data attribute. So
for
normal $DATA, this is the
allocated_size from the unnamed
$DATA attribute and for compressed
and/or sparse $DATA, this is the
compressed_size from the unnamed
$DATA attribute. NOTE: This is a
multiple of the cluster size. */
/* 30*/
sle64
data_size
;
/* Byte size of actual data in data
attribute. */
$DATA attribute. For a directory or
other inode without an unnamed $DATA
attribute, this is always 0. NOTE:
This is a multiple of the cluster
size. */
/* 30*/
sle64
data_size
;
/* Byte size of actual data in unnamed
data attribute. For a directory or
other inode without an unnamed $DATA
attribute, this is always 0. */
/* 38*/
FILE_ATTR_FLAGS
file_attributes
;
/* Flags describing the file. */
/* 3c*/
union
{
/* 3c*/
struct
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录