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
20798dfe
Commit
20798dfe
authored
Nov 18, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Update the NFSv3 GETACL result encoder to use struct xdr_stream
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
83d0b845
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
16 deletions
+43
-16
fs/nfsd/nfs3acl.c
fs/nfsd/nfs3acl.c
+19
-14
fs/nfsd/nfs3xdr.c
fs/nfsd/nfs3xdr.c
+21
-2
fs/nfsd/xdr3.h
fs/nfsd/xdr3.h
+3
-0
No files found.
fs/nfsd/nfs3acl.c
View file @
20798dfe
...
...
@@ -168,22 +168,25 @@ static int nfs3svc_decode_setaclargs(struct svc_rqst *rqstp, __be32 *p)
/* GETACL */
static
int
nfs3svc_encode_getaclres
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
)
{
struct
xdr_stream
*
xdr
=
&
rqstp
->
rq_res_stream
;
struct
nfsd3_getaclres
*
resp
=
rqstp
->
rq_resp
;
struct
dentry
*
dentry
=
resp
->
fh
.
fh_dentry
;
*
p
++
=
resp
->
status
;
p
=
nfs3svc_encode_post_op_attr
(
rqstp
,
p
,
&
resp
->
fh
);
if
(
resp
->
status
==
0
&&
dentry
&&
d_really_is_positive
(
dentry
))
{
struct
inode
*
inode
=
d_inode
(
dentry
);
struct
kvec
*
head
=
rqstp
->
rq_res
.
head
;
struct
inode
*
inode
=
d_inode
(
dentry
);
unsigned
int
base
;
int
n
;
int
w
;
*
p
++
=
htonl
(
resp
->
mask
);
if
(
!
xdr_ressize_check
(
rqstp
,
p
))
if
(
!
svcxdr_encode_nfsstat3
(
xdr
,
resp
->
status
))
return
0
;
switch
(
resp
->
status
)
{
case
nfs_ok
:
if
(
!
svcxdr_encode_post_op_attr
(
rqstp
,
xdr
,
&
resp
->
fh
))
return
0
;
if
(
xdr_stream_encode_u32
(
xdr
,
resp
->
mask
)
<
0
)
return
0
;
base
=
(
char
*
)
p
-
(
char
*
)
head
->
iov_base
;
base
=
(
char
*
)
xdr
->
p
-
(
char
*
)
head
->
iov_base
;
rqstp
->
rq_res
.
page_len
=
w
=
nfsacl_size
(
(
resp
->
mask
&
NFS_ACL
)
?
resp
->
acl_access
:
NULL
,
...
...
@@ -204,9 +207,11 @@ static int nfs3svc_encode_getaclres(struct svc_rqst *rqstp, __be32 *p)
NFS_ACL_DEFAULT
);
if
(
n
<=
0
)
return
0
;
}
else
if
(
!
xdr_ressize_check
(
rqstp
,
p
))
break
;
default:
if
(
!
svcxdr_encode_post_op_attr
(
rqstp
,
xdr
,
&
resp
->
fh
))
return
0
;
}
return
1
;
}
...
...
fs/nfsd/nfs3xdr.c
View file @
20798dfe
...
...
@@ -107,7 +107,16 @@ svcxdr_decode_nfs_fh3(struct xdr_stream *xdr, struct svc_fh *fhp)
return
true
;
}
static
bool
/**
* svcxdr_encode_nfsstat3 - Encode an NFSv3 status code
* @xdr: XDR stream
* @status: status value to encode
*
* Return values:
* %false: Send buffer space was exhausted
* %true: Success
*/
bool
svcxdr_encode_nfsstat3
(
struct
xdr_stream
*
xdr
,
__be32
status
)
{
__be32
*
p
;
...
...
@@ -464,7 +473,17 @@ svcxdr_encode_pre_op_attr(struct xdr_stream *xdr, const struct svc_fh *fhp)
return
svcxdr_encode_wcc_attr
(
xdr
,
fhp
);
}
static
bool
/**
* svcxdr_encode_post_op_attr - Encode NFSv3 post-op attributes
* @rqstp: Context of a completed RPC transaction
* @xdr: XDR stream
* @fhp: File handle to encode
*
* Return values:
* %false: Send buffer space was exhausted
* %true: Success
*/
bool
svcxdr_encode_post_op_attr
(
struct
svc_rqst
*
rqstp
,
struct
xdr_stream
*
xdr
,
const
struct
svc_fh
*
fhp
)
{
...
...
fs/nfsd/xdr3.h
View file @
20798dfe
...
...
@@ -308,5 +308,8 @@ int nfs3svc_encode_entryplus3(void *data, const char *name, int namlen,
__be32
*
nfs3svc_encode_post_op_attr
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
,
struct
svc_fh
*
fhp
);
bool
svcxdr_decode_nfs_fh3
(
struct
xdr_stream
*
xdr
,
struct
svc_fh
*
fhp
);
bool
svcxdr_encode_nfsstat3
(
struct
xdr_stream
*
xdr
,
__be32
status
);
bool
svcxdr_encode_post_op_attr
(
struct
svc_rqst
*
rqstp
,
struct
xdr_stream
*
xdr
,
const
struct
svc_fh
*
fhp
);
#endif
/* _LINUX_NFSD_XDR3_H */
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