Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
cf8208d0
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cf8208d0
编写于
6月 12, 2007
作者:
J
Jens Axboe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sendfile: convert nfsd to splice_direct_to_actor()
Signed-off-by:
N
Jens Axboe
<
jens.axboe@oracle.com
>
上级
f0930fff
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
19 deletion
+34
-19
fs/nfsd/vfs.c
fs/nfsd/vfs.c
+31
-16
include/linux/sunrpc/svc.h
include/linux/sunrpc/svc.h
+1
-1
net/sunrpc/auth_gss/svcauth_gss.c
net/sunrpc/auth_gss/svcauth_gss.c
+1
-1
net/sunrpc/svc.c
net/sunrpc/svc.c
+1
-1
未找到文件。
fs/nfsd/vfs.c
浏览文件 @
cf8208d0
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
#include <linux/file.h>
#include <linux/file.h>
#include <linux/mount.h>
#include <linux/mount.h>
#include <linux/major.h>
#include <linux/major.h>
#include <linux/
ext2_fs
.h>
#include <linux/
pipe_fs_i
.h>
#include <linux/proc_fs.h>
#include <linux/proc_fs.h>
#include <linux/stat.h>
#include <linux/stat.h>
#include <linux/fcntl.h>
#include <linux/fcntl.h>
...
@@ -801,26 +801,32 @@ nfsd_get_raparms(dev_t dev, ino_t ino)
...
@@ -801,26 +801,32 @@ nfsd_get_raparms(dev_t dev, ino_t ino)
}
}
/*
/*
* Grab and keep cached pages asso
s
iated with a file in the svc_rqst
* Grab and keep cached pages asso
c
iated with a file in the svc_rqst
* so that they can be passed to the net
o
work sendmsg/sendpage routines
* so that they can be passed to the network sendmsg/sendpage routines
* direct
r
ly. They will be released after the sending has completed.
* directly. They will be released after the sending has completed.
*/
*/
static
int
static
int
nfsd_read_actor
(
read_descriptor_t
*
desc
,
struct
page
*
page
,
unsigned
long
offset
,
unsigned
long
size
)
nfsd_splice_actor
(
struct
pipe_inode_info
*
pipe
,
struct
pipe_buffer
*
buf
,
struct
splice_desc
*
sd
)
{
{
unsigned
long
count
=
desc
->
count
;
struct
svc_rqst
*
rqstp
=
sd
->
u
.
data
;
struct
svc_rqst
*
rqstp
=
desc
->
arg
.
data
;
struct
page
**
pp
=
rqstp
->
rq_respages
+
rqstp
->
rq_resused
;
struct
page
**
pp
=
rqstp
->
rq_respages
+
rqstp
->
rq_resused
;
struct
page
*
page
=
buf
->
page
;
size_t
size
;
int
ret
;
ret
=
buf
->
ops
->
pin
(
pipe
,
buf
);
if
(
unlikely
(
ret
))
return
ret
;
if
(
size
>
count
)
size
=
sd
->
len
;
size
=
count
;
if
(
rqstp
->
rq_res
.
page_len
==
0
)
{
if
(
rqstp
->
rq_res
.
page_len
==
0
)
{
get_page
(
page
);
get_page
(
page
);
put_page
(
*
pp
);
put_page
(
*
pp
);
*
pp
=
page
;
*
pp
=
page
;
rqstp
->
rq_resused
++
;
rqstp
->
rq_resused
++
;
rqstp
->
rq_res
.
page_base
=
offset
;
rqstp
->
rq_res
.
page_base
=
buf
->
offset
;
rqstp
->
rq_res
.
page_len
=
size
;
rqstp
->
rq_res
.
page_len
=
size
;
}
else
if
(
page
!=
pp
[
-
1
])
{
}
else
if
(
page
!=
pp
[
-
1
])
{
get_page
(
page
);
get_page
(
page
);
...
@@ -832,11 +838,15 @@ nfsd_read_actor(read_descriptor_t *desc, struct page *page, unsigned long offset
...
@@ -832,11 +838,15 @@ nfsd_read_actor(read_descriptor_t *desc, struct page *page, unsigned long offset
}
else
}
else
rqstp
->
rq_res
.
page_len
+=
size
;
rqstp
->
rq_res
.
page_len
+=
size
;
desc
->
count
=
count
-
size
;
desc
->
written
+=
size
;
return
size
;
return
size
;
}
}
static
int
nfsd_direct_splice_actor
(
struct
pipe_inode_info
*
pipe
,
struct
splice_desc
*
sd
)
{
return
__splice_from_pipe
(
pipe
,
sd
,
nfsd_splice_actor
);
}
static
__be32
static
__be32
nfsd_vfs_read
(
struct
svc_rqst
*
rqstp
,
struct
svc_fh
*
fhp
,
struct
file
*
file
,
nfsd_vfs_read
(
struct
svc_rqst
*
rqstp
,
struct
svc_fh
*
fhp
,
struct
file
*
file
,
loff_t
offset
,
struct
kvec
*
vec
,
int
vlen
,
unsigned
long
*
count
)
loff_t
offset
,
struct
kvec
*
vec
,
int
vlen
,
unsigned
long
*
count
)
...
@@ -861,10 +871,15 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
...
@@ -861,10 +871,15 @@ nfsd_vfs_read(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file *file,
if
(
ra
&&
ra
->
p_set
)
if
(
ra
&&
ra
->
p_set
)
file
->
f_ra
=
ra
->
p_ra
;
file
->
f_ra
=
ra
->
p_ra
;
if
(
file
->
f_op
->
sendfile
&&
rqstp
->
rq_sendfile_ok
)
{
if
(
file
->
f_op
->
splice_read
&&
rqstp
->
rq_splice_ok
)
{
rqstp
->
rq_resused
=
1
;
struct
splice_desc
sd
=
{
host_err
=
file
->
f_op
->
sendfile
(
file
,
&
offset
,
*
count
,
.
len
=
0
,
nfsd_read_actor
,
rqstp
);
.
total_len
=
*
count
,
.
pos
=
offset
,
.
u
.
data
=
rqstp
,
};
host_err
=
splice_direct_to_actor
(
file
,
&
sd
,
nfsd_direct_splice_actor
);
}
else
{
}
else
{
oldfs
=
get_fs
();
oldfs
=
get_fs
();
set_fs
(
KERNEL_DS
);
set_fs
(
KERNEL_DS
);
...
...
include/linux/sunrpc/svc.h
浏览文件 @
cf8208d0
...
@@ -253,7 +253,7 @@ struct svc_rqst {
...
@@ -253,7 +253,7 @@ struct svc_rqst {
* determine what device number
* determine what device number
* to report (real or virtual)
* to report (real or virtual)
*/
*/
int
rq_s
endfile_ok
;
/* turned off in gss privacy
int
rq_s
plice_ok
;
/* turned off in gss privacy
* to prevent encrypting page
* to prevent encrypting page
* cache pages */
* cache pages */
wait_queue_head_t
rq_wait
;
/* synchronization */
wait_queue_head_t
rq_wait
;
/* synchronization */
...
...
net/sunrpc/auth_gss/svcauth_gss.c
浏览文件 @
cf8208d0
...
@@ -853,7 +853,7 @@ unwrap_priv_data(struct svc_rqst *rqstp, struct xdr_buf *buf, u32 seq, struct gs
...
@@ -853,7 +853,7 @@ unwrap_priv_data(struct svc_rqst *rqstp, struct xdr_buf *buf, u32 seq, struct gs
u32
priv_len
,
maj_stat
;
u32
priv_len
,
maj_stat
;
int
pad
,
saved_len
,
remaining_len
,
offset
;
int
pad
,
saved_len
,
remaining_len
,
offset
;
rqstp
->
rq_s
endfil
e_ok
=
0
;
rqstp
->
rq_s
plic
e_ok
=
0
;
priv_len
=
svc_getnl
(
&
buf
->
head
[
0
]);
priv_len
=
svc_getnl
(
&
buf
->
head
[
0
]);
if
(
rqstp
->
rq_deferred
)
{
if
(
rqstp
->
rq_deferred
)
{
...
...
net/sunrpc/svc.c
浏览文件 @
cf8208d0
...
@@ -814,7 +814,7 @@ svc_process(struct svc_rqst *rqstp)
...
@@ -814,7 +814,7 @@ svc_process(struct svc_rqst *rqstp)
rqstp
->
rq_res
.
tail
[
0
].
iov_base
=
NULL
;
rqstp
->
rq_res
.
tail
[
0
].
iov_base
=
NULL
;
rqstp
->
rq_res
.
tail
[
0
].
iov_len
=
0
;
rqstp
->
rq_res
.
tail
[
0
].
iov_len
=
0
;
/* Will be turned off only in gss privacy case: */
/* Will be turned off only in gss privacy case: */
rqstp
->
rq_s
endfil
e_ok
=
1
;
rqstp
->
rq_s
plic
e_ok
=
1
;
/* tcp needs a space for the record length... */
/* tcp needs a space for the record length... */
if
(
rqstp
->
rq_prot
==
IPPROTO_TCP
)
if
(
rqstp
->
rq_prot
==
IPPROTO_TCP
)
svc_putnl
(
resv
,
0
);
svc_putnl
(
resv
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录