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
cbd9abb3
Commit
cbd9abb3
authored
Nov 03, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Replace READ* macros in nfsd4_decode_commit()
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
d3d2f381
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
fs/nfsd/nfs4xdr.c
fs/nfsd/nfs4xdr.c
+5
-7
include/linux/sunrpc/xdr.h
include/linux/sunrpc/xdr.h
+21
-0
No files found.
fs/nfsd/nfs4xdr.c
View file @
cbd9abb3
...
...
@@ -581,13 +581,11 @@ nfsd4_decode_close(struct nfsd4_compoundargs *argp, struct nfsd4_close *close)
static
__be32
nfsd4_decode_commit
(
struct
nfsd4_compoundargs
*
argp
,
struct
nfsd4_commit
*
commit
)
{
DECODE_HEAD
;
READ_BUF
(
12
);
p
=
xdr_decode_hyper
(
p
,
&
commit
->
co_offset
);
commit
->
co_count
=
be32_to_cpup
(
p
++
);
DECODE_TAIL
;
if
(
xdr_stream_decode_u64
(
argp
->
xdr
,
&
commit
->
co_offset
)
<
0
)
return
nfserr_bad_xdr
;
if
(
xdr_stream_decode_u32
(
argp
->
xdr
,
&
commit
->
co_count
)
<
0
)
return
nfserr_bad_xdr
;
return
nfs_ok
;
}
static
__be32
...
...
include/linux/sunrpc/xdr.h
View file @
cbd9abb3
...
...
@@ -571,6 +571,27 @@ xdr_stream_decode_u32(struct xdr_stream *xdr, __u32 *ptr)
return
0
;
}
/**
* xdr_stream_decode_u64 - Decode a 64-bit integer
* @xdr: pointer to xdr_stream
* @ptr: location to store 64-bit integer
*
* Return values:
* %0 on success
* %-EBADMSG on XDR buffer overflow
*/
static
inline
ssize_t
xdr_stream_decode_u64
(
struct
xdr_stream
*
xdr
,
__u64
*
ptr
)
{
const
size_t
count
=
sizeof
(
*
ptr
);
__be32
*
p
=
xdr_inline_decode
(
xdr
,
count
);
if
(
unlikely
(
!
p
))
return
-
EBADMSG
;
xdr_decode_hyper
(
p
,
ptr
);
return
0
;
}
/**
* xdr_stream_decode_opaque_fixed - Decode fixed length opaque xdr data
* @xdr: pointer to xdr_stream
...
...
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