Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
1b0f7c29
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1b0f7c29
编写于
1月 30, 2008
作者:
C
Chris Mason
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix hole start calculation in btrfs_settar
Signed-off-by:
N
Chris Mason
<
chris.mason@oracle.com
>
上级
f392a938
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
11 deletion
+5
-11
fs/btrfs/inode.c
fs/btrfs/inode.c
+5
-11
未找到文件。
fs/btrfs/inode.c
浏览文件 @
1b0f7c29
...
@@ -1000,20 +1000,14 @@ static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
...
@@ -1000,20 +1000,14 @@ static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
struct
extent_io_tree
*
io_tree
=
&
BTRFS_I
(
inode
)
->
io_tree
;
struct
extent_io_tree
*
io_tree
=
&
BTRFS_I
(
inode
)
->
io_tree
;
u64
mask
=
root
->
sectorsize
-
1
;
u64
mask
=
root
->
sectorsize
-
1
;
u64
pos
=
(
inode
->
i_size
+
mask
)
&
~
mask
;
u64
hole_start
=
(
inode
->
i_size
+
mask
)
&
~
mask
;
u64
block_end
=
(
attr
->
ia_size
+
mask
)
&
~
mask
;
u64
block_end
=
(
attr
->
ia_size
+
mask
)
&
~
mask
;
u64
hole_start
;
u64
hole_size
;
u64
hole_size
;
u64
alloc_hint
=
0
;
u64
alloc_hint
=
0
;
if
(
attr
->
ia_size
<=
pos
)
if
(
attr
->
ia_size
<=
hole_start
)
goto
out
;
goto
out
;
if
(
pos
!=
inode
->
i_size
)
hole_start
=
pos
+
root
->
sectorsize
;
else
hole_start
=
pos
;
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
err
=
btrfs_check_free_space
(
root
,
1
,
0
);
err
=
btrfs_check_free_space
(
root
,
1
,
0
);
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
...
@@ -1022,14 +1016,14 @@ static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
...
@@ -1022,14 +1016,14 @@ static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
btrfs_truncate_page
(
inode
->
i_mapping
,
inode
->
i_size
);
btrfs_truncate_page
(
inode
->
i_mapping
,
inode
->
i_size
);
lock_extent
(
io_tree
,
pos
,
block_end
-
1
,
GFP_NOFS
);
lock_extent
(
io_tree
,
hole_start
,
block_end
-
1
,
GFP_NOFS
);
hole_size
=
block_end
-
hole_start
;
hole_size
=
block_end
-
hole_start
;
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
mutex_lock
(
&
root
->
fs_info
->
fs_mutex
);
trans
=
btrfs_start_transaction
(
root
,
1
);
trans
=
btrfs_start_transaction
(
root
,
1
);
btrfs_set_trans_block_group
(
trans
,
inode
);
btrfs_set_trans_block_group
(
trans
,
inode
);
err
=
btrfs_drop_extents
(
trans
,
root
,
inode
,
err
=
btrfs_drop_extents
(
trans
,
root
,
inode
,
pos
,
block_end
,
pos
,
hole_start
,
block_end
,
hole_start
,
&
alloc_hint
);
&
alloc_hint
);
if
(
alloc_hint
!=
EXTENT_MAP_INLINE
)
{
if
(
alloc_hint
!=
EXTENT_MAP_INLINE
)
{
...
@@ -1043,7 +1037,7 @@ static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
...
@@ -1043,7 +1037,7 @@ static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
}
}
btrfs_end_transaction
(
trans
,
root
);
btrfs_end_transaction
(
trans
,
root
);
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
mutex_unlock
(
&
root
->
fs_info
->
fs_mutex
);
unlock_extent
(
io_tree
,
pos
,
block_end
-
1
,
GFP_NOFS
);
unlock_extent
(
io_tree
,
hole_start
,
block_end
-
1
,
GFP_NOFS
);
if
(
err
)
if
(
err
)
return
err
;
return
err
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录