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
9575363a
Commit
9575363a
authored
Oct 20, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Update GETATTR3args decoder to use struct xdr_stream
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
81d21747
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
9 deletions
+27
-9
fs/nfsd/nfs3proc.c
fs/nfsd/nfs3proc.c
+1
-2
fs/nfsd/nfs3xdr.c
fs/nfsd/nfs3xdr.c
+25
-6
fs/nfsd/xdr3.h
fs/nfsd/xdr3.h
+1
-1
No files found.
fs/nfsd/nfs3proc.c
View file @
9575363a
...
...
@@ -683,7 +683,6 @@ nfsd3_proc_commit(struct svc_rqst *rqstp)
* NFSv3 Server procedures.
* Only the results of non-idempotent operations are cached.
*/
#define nfs3svc_decode_fhandleargs nfs3svc_decode_fhandle
#define nfs3svc_encode_attrstatres nfs3svc_encode_attrstat
#define nfs3svc_encode_wccstatres nfs3svc_encode_wccstat
#define nfsd3_mkdirargs nfsd3_createargs
...
...
@@ -715,7 +714,7 @@ static const struct svc_procedure nfsd_procedures3[22] = {
.
pc_decode
=
nfs3svc_decode_fhandleargs
,
.
pc_encode
=
nfs3svc_encode_attrstatres
,
.
pc_release
=
nfs3svc_release_fhandle
,
.
pc_argsize
=
sizeof
(
struct
nfsd
3_fhandleargs
),
.
pc_argsize
=
sizeof
(
struct
nfsd
_fhandle
),
.
pc_ressize
=
sizeof
(
struct
nfsd3_attrstatres
),
.
pc_cachetype
=
RC_NOCACHE
,
.
pc_xdrressize
=
ST
+
AT
,
...
...
fs/nfsd/nfs3xdr.c
View file @
9575363a
...
...
@@ -29,8 +29,9 @@ static u32 nfs3_ftypes[] = {
/*
*
XDR functions for basic NFS types
*
Basic NFSv3 data types (RFC 1813 Sections 2.5 and 2.6)
*/
static
__be32
*
encode_time3
(
__be32
*
p
,
struct
timespec64
*
time
)
{
...
...
@@ -46,6 +47,26 @@ decode_time3(__be32 *p, struct timespec64 *time)
return
p
;
}
static
bool
svcxdr_decode_nfs_fh3
(
struct
xdr_stream
*
xdr
,
struct
svc_fh
*
fhp
)
{
__be32
*
p
;
u32
size
;
if
(
xdr_stream_decode_u32
(
xdr
,
&
size
)
<
0
)
return
false
;
if
(
size
==
0
||
size
>
NFS3_FHSIZE
)
return
false
;
p
=
xdr_inline_decode
(
xdr
,
size
);
if
(
!
p
)
return
false
;
fh_init
(
fhp
,
NFS3_FHSIZE
);
fhp
->
fh_handle
.
fh_size
=
size
;
memcpy
(
&
fhp
->
fh_handle
.
fh_base
,
p
,
size
);
return
true
;
}
static
__be32
*
decode_fh
(
__be32
*
p
,
struct
svc_fh
*
fhp
)
{
...
...
@@ -312,14 +333,12 @@ void fill_post_wcc(struct svc_fh *fhp)
*/
int
nfs3svc_decode_fhandle
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
)
nfs3svc_decode_fhandle
args
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
)
{
struct
xdr_stream
*
xdr
=
&
rqstp
->
rq_arg_stream
;
struct
nfsd_fhandle
*
args
=
rqstp
->
rq_argp
;
p
=
decode_fh
(
p
,
&
args
->
fh
);
if
(
!
p
)
return
0
;
return
xdr_argsize_check
(
rqstp
,
p
);
return
svcxdr_decode_nfs_fh3
(
xdr
,
&
args
->
fh
);
}
int
...
...
fs/nfsd/xdr3.h
View file @
9575363a
...
...
@@ -273,7 +273,7 @@ union nfsd3_xdrstore {
#define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore)
int
nfs3svc_decode_fhandle
(
struct
svc_rqst
*
,
__be32
*
);
int
nfs3svc_decode_fhandle
args
(
struct
svc_rqst
*
,
__be32
*
);
int
nfs3svc_decode_sattrargs
(
struct
svc_rqst
*
,
__be32
*
);
int
nfs3svc_decode_diropargs
(
struct
svc_rqst
*
,
__be32
*
);
int
nfs3svc_decode_accessargs
(
struct
svc_rqst
*
,
__be32
*
);
...
...
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