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
94c8f8c6
Commit
94c8f8c6
authored
Oct 23, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Update the NFSv2 READDIR result encoder to use struct xdr_stream
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
8141d6a2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
fs/nfsd/nfsxdr.c
fs/nfsd/nfsxdr.c
+13
-9
fs/nfsd/xdr.h
fs/nfsd/xdr.h
+1
-0
No files found.
fs/nfsd/nfsxdr.c
View file @
94c8f8c6
...
...
@@ -574,17 +574,21 @@ nfssvc_encode_readres(struct svc_rqst *rqstp, __be32 *p)
int
nfssvc_encode_readdirres
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
)
{
struct
xdr_stream
*
xdr
=
&
rqstp
->
rq_res_stream
;
struct
nfsd_readdirres
*
resp
=
rqstp
->
rq_resp
;
*
p
++
=
resp
->
status
;
if
(
resp
->
status
!=
nfs_ok
)
return
xdr_ressize_check
(
rqstp
,
p
);
xdr_ressize_check
(
rqstp
,
p
);
p
=
resp
->
buffer
;
*
p
++
=
0
;
/* no more entries */
*
p
++
=
htonl
((
resp
->
common
.
err
==
nfserr_eof
));
rqstp
->
rq_res
.
page_len
=
resp
->
count
<<
2
;
if
(
!
svcxdr_encode_stat
(
xdr
,
resp
->
status
))
return
0
;
switch
(
resp
->
status
)
{
case
nfs_ok
:
xdr_write_pages
(
xdr
,
&
resp
->
page
,
0
,
resp
->
count
<<
2
);
/* no more entries */
if
(
xdr_stream_encode_item_absent
(
xdr
)
<
0
)
return
0
;
if
(
xdr_stream_encode_bool
(
xdr
,
resp
->
common
.
err
==
nfserr_eof
)
<
0
)
return
0
;
break
;
}
return
1
;
}
...
...
fs/nfsd/xdr.h
View file @
94c8f8c6
...
...
@@ -114,6 +114,7 @@ struct nfsd_readdirres {
__be32
*
buffer
;
int
buflen
;
__be32
*
offset
;
struct
page
*
page
;
};
struct
nfsd_statfsres
{
...
...
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