Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
a6f8d9dc
Commit
a6f8d9dc
authored
Oct 23, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Update the NFSv2 READ result encoder to use struct xdr_stream
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
d9014b0f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
fs/nfsd/nfsproc.c
fs/nfsd/nfsproc.c
+1
-0
fs/nfsd/nfsxdr.c
fs/nfsd/nfsxdr.c
+15
-17
fs/nfsd/xdr.h
fs/nfsd/xdr.h
+1
-0
No files found.
fs/nfsd/nfsproc.c
View file @
a6f8d9dc
...
@@ -185,6 +185,7 @@ nfsd_proc_read(struct svc_rqst *rqstp)
...
@@ -185,6 +185,7 @@ nfsd_proc_read(struct svc_rqst *rqstp)
v
=
0
;
v
=
0
;
len
=
argp
->
count
;
len
=
argp
->
count
;
resp
->
pages
=
rqstp
->
rq_next_page
;
while
(
len
>
0
)
{
while
(
len
>
0
)
{
struct
page
*
page
=
*
(
rqstp
->
rq_next_page
++
);
struct
page
*
page
=
*
(
rqstp
->
rq_next_page
++
);
...
...
fs/nfsd/nfsxdr.c
View file @
a6f8d9dc
...
@@ -549,27 +549,25 @@ nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p)
...
@@ -549,27 +549,25 @@ nfssvc_encode_readlinkres(struct svc_rqst *rqstp, __be32 *p)
int
int
nfssvc_encode_readres
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
)
nfssvc_encode_readres
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
)
{
{
struct
xdr_stream
*
xdr
=
&
rqstp
->
rq_res_stream
;
struct
nfsd_readres
*
resp
=
rqstp
->
rq_resp
;
struct
nfsd_readres
*
resp
=
rqstp
->
rq_resp
;
struct
kvec
*
head
=
rqstp
->
rq_res
.
head
;
struct
kvec
*
head
=
rqstp
->
rq_res
.
head
;
*
p
++
=
resp
->
status
;
if
(
!
svcxdr_encode_stat
(
xdr
,
resp
->
status
))
if
(
resp
->
status
!=
nfs_ok
)
return
xdr_ressize_check
(
rqstp
,
p
);
p
=
encode_fattr
(
rqstp
,
p
,
&
resp
->
fh
,
&
resp
->
stat
);
*
p
++
=
htonl
(
resp
->
count
);
xdr_ressize_check
(
rqstp
,
p
);
/* now update rqstp->rq_res to reflect data as well */
rqstp
->
rq_res
.
page_len
=
resp
->
count
;
if
(
resp
->
count
&
3
)
{
/* need to pad the tail */
rqstp
->
rq_res
.
tail
[
0
].
iov_base
=
p
;
*
p
=
0
;
rqstp
->
rq_res
.
tail
[
0
].
iov_len
=
4
-
(
resp
->
count
&
3
);
}
if
(
svc_encode_result_payload
(
rqstp
,
head
->
iov_len
,
resp
->
count
))
return
0
;
return
0
;
switch
(
resp
->
status
)
{
case
nfs_ok
:
if
(
!
svcxdr_encode_fattr
(
rqstp
,
xdr
,
&
resp
->
fh
,
&
resp
->
stat
))
return
0
;
if
(
xdr_stream_encode_u32
(
xdr
,
resp
->
count
)
<
0
)
return
0
;
xdr_write_pages
(
xdr
,
resp
->
pages
,
rqstp
->
rq_res
.
page_base
,
resp
->
count
);
if
(
svc_encode_result_payload
(
rqstp
,
head
->
iov_len
,
resp
->
count
)
<
0
)
return
0
;
break
;
}
return
1
;
return
1
;
}
}
...
...
fs/nfsd/xdr.h
View file @
a6f8d9dc
...
@@ -102,6 +102,7 @@ struct nfsd_readres {
...
@@ -102,6 +102,7 @@ struct nfsd_readres {
struct
svc_fh
fh
;
struct
svc_fh
fh
;
unsigned
long
count
;
unsigned
long
count
;
struct
kstat
stat
;
struct
kstat
stat
;
struct
page
**
pages
;
};
};
struct
nfsd_readdirres
{
struct
nfsd_readdirres
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment