Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
92236878
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
92236878
编写于
11月 27, 2013
作者:
K
Kent Overstreet
提交者:
Al Viro
4月 01, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
iov_iter: Move iov_iter to uio.h
Signed-off-by:
N
Kent Overstreet
<
kmo@daterainc.com
>
上级
8142c184
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
50 addition
and
32 deletion
+50
-32
include/linux/fs.h
include/linux/fs.h
+0
-32
include/linux/uio.h
include/linux/uio.h
+50
-0
未找到文件。
include/linux/fs.h
浏览文件 @
92236878
...
...
@@ -295,38 +295,6 @@ struct page;
struct
address_space
;
struct
writeback_control
;
struct
iov_iter
{
const
struct
iovec
*
iov
;
unsigned
long
nr_segs
;
size_t
iov_offset
;
size_t
count
;
};
size_t
iov_iter_copy_from_user_atomic
(
struct
page
*
page
,
struct
iov_iter
*
i
,
unsigned
long
offset
,
size_t
bytes
);
size_t
iov_iter_copy_from_user
(
struct
page
*
page
,
struct
iov_iter
*
i
,
unsigned
long
offset
,
size_t
bytes
);
void
iov_iter_advance
(
struct
iov_iter
*
i
,
size_t
bytes
);
int
iov_iter_fault_in_readable
(
struct
iov_iter
*
i
,
size_t
bytes
);
size_t
iov_iter_single_seg_count
(
const
struct
iov_iter
*
i
);
static
inline
void
iov_iter_init
(
struct
iov_iter
*
i
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
size_t
count
,
size_t
written
)
{
i
->
iov
=
iov
;
i
->
nr_segs
=
nr_segs
;
i
->
iov_offset
=
0
;
i
->
count
=
count
+
written
;
iov_iter_advance
(
i
,
written
);
}
static
inline
size_t
iov_iter_count
(
struct
iov_iter
*
i
)
{
return
i
->
count
;
}
/*
* "descriptor" for what we're up to with a read.
* This allows us to use the same read code yet
...
...
include/linux/uio.h
浏览文件 @
92236878
...
...
@@ -9,14 +9,23 @@
#ifndef __LINUX_UIO_H
#define __LINUX_UIO_H
#include <linux/kernel.h>
#include <uapi/linux/uio.h>
struct
page
;
struct
kvec
{
void
*
iov_base
;
/* and that should *never* hold a userland pointer */
size_t
iov_len
;
};
struct
iov_iter
{
const
struct
iovec
*
iov
;
unsigned
long
nr_segs
;
size_t
iov_offset
;
size_t
count
;
};
/*
* Total number of bytes covered by an iovec.
*
...
...
@@ -34,8 +43,49 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs)
return
ret
;
}
static
inline
struct
iovec
iov_iter_iovec
(
const
struct
iov_iter
*
iter
)
{
return
(
struct
iovec
)
{
.
iov_base
=
iter
->
iov
->
iov_base
+
iter
->
iov_offset
,
.
iov_len
=
min
(
iter
->
count
,
iter
->
iov
->
iov_len
-
iter
->
iov_offset
),
};
}
#define iov_for_each(iov, iter, start) \
for (iter = (start); \
(iter).count && \
((iov = iov_iter_iovec(&(iter))), 1); \
iov_iter_advance(&(iter), (iov).iov_len))
unsigned
long
iov_shorten
(
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
size_t
to
);
size_t
iov_iter_copy_from_user_atomic
(
struct
page
*
page
,
struct
iov_iter
*
i
,
unsigned
long
offset
,
size_t
bytes
);
size_t
iov_iter_copy_from_user
(
struct
page
*
page
,
struct
iov_iter
*
i
,
unsigned
long
offset
,
size_t
bytes
);
void
iov_iter_advance
(
struct
iov_iter
*
i
,
size_t
bytes
);
int
iov_iter_fault_in_readable
(
struct
iov_iter
*
i
,
size_t
bytes
);
size_t
iov_iter_single_seg_count
(
const
struct
iov_iter
*
i
);
static
inline
void
iov_iter_init
(
struct
iov_iter
*
i
,
const
struct
iovec
*
iov
,
unsigned
long
nr_segs
,
size_t
count
,
size_t
written
)
{
i
->
iov
=
iov
;
i
->
nr_segs
=
nr_segs
;
i
->
iov_offset
=
0
;
i
->
count
=
count
+
written
;
iov_iter_advance
(
i
,
written
);
}
static
inline
size_t
iov_iter_count
(
struct
iov_iter
*
i
)
{
return
i
->
count
;
}
int
memcpy_fromiovec
(
unsigned
char
*
kdata
,
struct
iovec
*
iov
,
int
len
);
int
memcpy_toiovec
(
struct
iovec
*
iov
,
unsigned
char
*
kdata
,
int
len
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录