Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
5740c99e
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5740c99e
编写于
7月 06, 2018
作者:
M
Miklos Szeredi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vfs: dedupe: return int
Signed-off-by:
N
Miklos Szeredi
<
mszeredi@redhat.com
>
上级
92b66d2c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
16 addition
and
40 deletion
+16
-40
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+2
-2
fs/btrfs/ioctl.c
fs/btrfs/ioctl.c
+3
-7
fs/ocfs2/file.c
fs/ocfs2/file.c
+6
-11
fs/read_write.c
fs/read_write.c
+2
-2
fs/xfs/xfs_file.c
fs/xfs/xfs_file.c
+2
-17
include/linux/fs.h
include/linux/fs.h
+1
-1
未找到文件。
fs/btrfs/ctree.h
浏览文件 @
5740c99e
...
@@ -3247,8 +3247,8 @@ void btrfs_get_block_group_info(struct list_head *groups_list,
...
@@ -3247,8 +3247,8 @@ void btrfs_get_block_group_info(struct list_head *groups_list,
struct
btrfs_ioctl_space_info
*
space
);
struct
btrfs_ioctl_space_info
*
space
);
void
btrfs_update_ioctl_balance_args
(
struct
btrfs_fs_info
*
fs_info
,
void
btrfs_update_ioctl_balance_args
(
struct
btrfs_fs_info
*
fs_info
,
struct
btrfs_ioctl_balance_args
*
bargs
);
struct
btrfs_ioctl_balance_args
*
bargs
);
ssize_
t
btrfs_dedupe_file_range
(
struct
file
*
src_file
,
u64
loff
,
u64
olen
,
in
t
btrfs_dedupe_file_range
(
struct
file
*
src_file
,
u64
loff
,
u64
olen
,
struct
file
*
dst_file
,
u64
dst_loff
);
struct
file
*
dst_file
,
u64
dst_loff
);
/* file.c */
/* file.c */
int
__init
btrfs_auto_defrag_init
(
void
);
int
__init
btrfs_auto_defrag_init
(
void
);
...
...
fs/btrfs/ioctl.c
浏览文件 @
5740c99e
...
@@ -3600,13 +3600,12 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
...
@@ -3600,13 +3600,12 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen,
return
ret
;
return
ret
;
}
}
ssize_
t
btrfs_dedupe_file_range
(
struct
file
*
src_file
,
u64
loff
,
u64
olen
,
in
t
btrfs_dedupe_file_range
(
struct
file
*
src_file
,
u64
loff
,
u64
olen
,
struct
file
*
dst_file
,
u64
dst_loff
)
struct
file
*
dst_file
,
u64
dst_loff
)
{
{
struct
inode
*
src
=
file_inode
(
src_file
);
struct
inode
*
src
=
file_inode
(
src_file
);
struct
inode
*
dst
=
file_inode
(
dst_file
);
struct
inode
*
dst
=
file_inode
(
dst_file
);
u64
bs
=
BTRFS_I
(
src
)
->
root
->
fs_info
->
sb
->
s_blocksize
;
u64
bs
=
BTRFS_I
(
src
)
->
root
->
fs_info
->
sb
->
s_blocksize
;
ssize_t
res
;
if
(
WARN_ON_ONCE
(
bs
<
PAGE_SIZE
))
{
if
(
WARN_ON_ONCE
(
bs
<
PAGE_SIZE
))
{
/*
/*
...
@@ -3617,10 +3616,7 @@ ssize_t btrfs_dedupe_file_range(struct file *src_file, u64 loff, u64 olen,
...
@@ -3617,10 +3616,7 @@ ssize_t btrfs_dedupe_file_range(struct file *src_file, u64 loff, u64 olen,
return
-
EINVAL
;
return
-
EINVAL
;
}
}
res
=
btrfs_extent_same
(
src
,
loff
,
olen
,
dst
,
dst_loff
);
return
btrfs_extent_same
(
src
,
loff
,
olen
,
dst
,
dst_loff
);
if
(
res
)
return
res
;
return
olen
;
}
}
static
int
clone_finish_inode_update
(
struct
btrfs_trans_handle
*
trans
,
static
int
clone_finish_inode_update
(
struct
btrfs_trans_handle
*
trans
,
...
...
fs/ocfs2/file.c
浏览文件 @
5740c99e
...
@@ -2537,19 +2537,14 @@ static int ocfs2_file_clone_range(struct file *file_in,
...
@@ -2537,19 +2537,14 @@ static int ocfs2_file_clone_range(struct file *file_in,
len
,
false
);
len
,
false
);
}
}
static
ssize_
t
ocfs2_file_dedupe_range
(
struct
file
*
src_file
,
static
in
t
ocfs2_file_dedupe_range
(
struct
file
*
src_file
,
u64
loff
,
u64
loff
,
u64
len
,
u64
len
,
struct
file
*
dst_file
,
struct
file
*
dst_file
,
u64
dst_loff
)
u64
dst_loff
)
{
{
int
error
;
return
ocfs2_reflink_remap_range
(
src_file
,
loff
,
dst_file
,
dst_loff
,
error
=
ocfs2_reflink_remap_range
(
src_file
,
loff
,
dst_file
,
dst_loff
,
len
,
true
);
len
,
true
);
if
(
error
)
return
error
;
return
len
;
}
}
const
struct
inode_operations
ocfs2_file_iops
=
{
const
struct
inode_operations
ocfs2_file_iops
=
{
...
...
fs/read_write.c
浏览文件 @
5740c99e
...
@@ -1976,7 +1976,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
...
@@ -1976,7 +1976,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
u16
count
=
same
->
dest_count
;
u16
count
=
same
->
dest_count
;
struct
file
*
dst_file
;
struct
file
*
dst_file
;
loff_t
dst_off
;
loff_t
dst_off
;
ssize_
t
deduped
;
in
t
deduped
;
if
(
!
(
file
->
f_mode
&
FMODE_READ
))
if
(
!
(
file
->
f_mode
&
FMODE_READ
))
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -2056,7 +2056,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
...
@@ -2056,7 +2056,7 @@ int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
else
if
(
deduped
<
0
)
else
if
(
deduped
<
0
)
info
->
status
=
deduped
;
info
->
status
=
deduped
;
else
else
info
->
bytes_deduped
+=
deduped
;
info
->
bytes_deduped
+=
len
;
}
}
next_file:
next_file:
...
...
fs/xfs/xfs_file.c
浏览文件 @
5740c99e
...
@@ -933,7 +933,7 @@ xfs_file_clone_range(
...
@@ -933,7 +933,7 @@ xfs_file_clone_range(
len
,
false
);
len
,
false
);
}
}
STATIC
ssize_
t
STATIC
in
t
xfs_file_dedupe_range
(
xfs_file_dedupe_range
(
struct
file
*
src_file
,
struct
file
*
src_file
,
u64
loff
,
u64
loff
,
...
@@ -941,23 +941,8 @@ xfs_file_dedupe_range(
...
@@ -941,23 +941,8 @@ xfs_file_dedupe_range(
struct
file
*
dst_file
,
struct
file
*
dst_file
,
u64
dst_loff
)
u64
dst_loff
)
{
{
struct
inode
*
srci
=
file_inode
(
src_file
);
return
xfs_reflink_remap_range
(
src_file
,
loff
,
dst_file
,
dst_loff
,
u64
max_dedupe
;
int
error
;
/*
* Since we have to read all these pages in to compare them, cut
* it off at MAX_RW_COUNT/2 rounded down to the nearest block.
* That means we won't do more than MAX_RW_COUNT IO per request.
*/
max_dedupe
=
(
MAX_RW_COUNT
>>
1
)
&
~
(
i_blocksize
(
srci
)
-
1
);
if
(
len
>
max_dedupe
)
len
=
max_dedupe
;
error
=
xfs_reflink_remap_range
(
src_file
,
loff
,
dst_file
,
dst_loff
,
len
,
true
);
len
,
true
);
if
(
error
)
return
error
;
return
len
;
}
}
STATIC
int
STATIC
int
...
...
include/linux/fs.h
浏览文件 @
5740c99e
...
@@ -1749,7 +1749,7 @@ struct file_operations {
...
@@ -1749,7 +1749,7 @@ struct file_operations {
loff_t
,
size_t
,
unsigned
int
);
loff_t
,
size_t
,
unsigned
int
);
int
(
*
clone_file_range
)(
struct
file
*
,
loff_t
,
struct
file
*
,
loff_t
,
int
(
*
clone_file_range
)(
struct
file
*
,
loff_t
,
struct
file
*
,
loff_t
,
u64
);
u64
);
ssize_
t
(
*
dedupe_file_range
)(
struct
file
*
,
u64
,
u64
,
struct
file
*
,
in
t
(
*
dedupe_file_range
)(
struct
file
*
,
u64
,
u64
,
struct
file
*
,
u64
);
u64
);
}
__randomize_layout
;
}
__randomize_layout
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录