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
ecb7a085
Commit
ecb7a085
authored
Oct 22, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Update the NFSv3 WRITE3res encoder to use struct xdr_stream
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
cc9bcdad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
fs/nfsd/nfs3xdr.c
fs/nfsd/nfs3xdr.c
+32
-8
No files found.
fs/nfsd/nfs3xdr.c
View file @
ecb7a085
...
...
@@ -131,6 +131,19 @@ encode_fh(__be32 *p, struct svc_fh *fhp)
return
p
+
XDR_QUADLEN
(
size
);
}
static
bool
svcxdr_encode_writeverf3
(
struct
xdr_stream
*
xdr
,
const
__be32
*
verf
)
{
__be32
*
p
;
p
=
xdr_reserve_space
(
xdr
,
NFS3_WRITEVERFSIZE
);
if
(
!
p
)
return
false
;
memcpy
(
p
,
verf
,
NFS3_WRITEVERFSIZE
);
return
true
;
}
static
bool
svcxdr_decode_filename3
(
struct
xdr_stream
*
xdr
,
char
**
name
,
unsigned
int
*
len
)
{
...
...
@@ -1038,17 +1051,28 @@ nfs3svc_encode_readres(struct svc_rqst *rqstp, __be32 *p)
int
nfs3svc_encode_writeres
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
)
{
struct
xdr_stream
*
xdr
=
&
rqstp
->
rq_res_stream
;
struct
nfsd3_writeres
*
resp
=
rqstp
->
rq_resp
;
*
p
++
=
resp
->
status
;
p
=
encode_wcc_data
(
rqstp
,
p
,
&
resp
->
fh
);
if
(
resp
->
status
==
0
)
{
*
p
++
=
htonl
(
resp
->
count
);
*
p
++
=
htonl
(
resp
->
committed
);
*
p
++
=
resp
->
verf
[
0
];
*
p
++
=
resp
->
verf
[
1
];
if
(
!
svcxdr_encode_nfsstat3
(
xdr
,
resp
->
status
))
return
0
;
switch
(
resp
->
status
)
{
case
nfs_ok
:
if
(
!
svcxdr_encode_wcc_data
(
rqstp
,
xdr
,
&
resp
->
fh
))
return
0
;
if
(
xdr_stream_encode_u32
(
xdr
,
resp
->
count
)
<
0
)
return
0
;
if
(
xdr_stream_encode_u32
(
xdr
,
resp
->
committed
)
<
0
)
return
0
;
if
(
!
svcxdr_encode_writeverf3
(
xdr
,
resp
->
verf
))
return
0
;
break
;
default:
if
(
!
svcxdr_encode_wcc_data
(
rqstp
,
xdr
,
&
resp
->
fh
))
return
0
;
}
return
xdr_ressize_check
(
rqstp
,
p
);
return
1
;
}
/* CREATE, MKDIR, SYMLINK, MKNOD */
...
...
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