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
e8febea7
Commit
e8febea7
authored
Nov 04, 2020
by
Chuck Lever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSD: Replace READ* macros in nfsd4_decode_copy()
Signed-off-by:
Chuck Lever
<
chuck.lever@oracle.com
>
parent
f49e4b4d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
20 deletions
+23
-20
fs/nfsd/nfs4xdr.c
fs/nfsd/nfs4xdr.c
+22
-19
fs/nfsd/xdr4.h
fs/nfsd/xdr4.h
+1
-1
No files found.
fs/nfsd/nfs4xdr.c
View file @
e8febea7
...
...
@@ -1982,40 +1982,44 @@ static __be32 nfsd4_decode_nl4_server(struct nfsd4_compoundargs *argp,
static
__be32
nfsd4_decode_copy
(
struct
nfsd4_compoundargs
*
argp
,
struct
nfsd4_copy
*
copy
)
{
DECODE_HEAD
;
struct
nl4_server
*
ns_dummy
;
int
i
,
count
;
u32
consecutive
,
i
,
count
;
__be32
status
;
status
=
nfsd4_decode_stateid
(
argp
,
&
copy
->
cp_src_stateid
);
status
=
nfsd4_decode_stateid
4
(
argp
,
&
copy
->
cp_src_stateid
);
if
(
status
)
return
status
;
status
=
nfsd4_decode_stateid
(
argp
,
&
copy
->
cp_dst_stateid
);
status
=
nfsd4_decode_stateid
4
(
argp
,
&
copy
->
cp_dst_stateid
);
if
(
status
)
return
status
;
if
(
xdr_stream_decode_u64
(
argp
->
xdr
,
&
copy
->
cp_src_pos
)
<
0
)
return
nfserr_bad_xdr
;
if
(
xdr_stream_decode_u64
(
argp
->
xdr
,
&
copy
->
cp_dst_pos
)
<
0
)
return
nfserr_bad_xdr
;
if
(
xdr_stream_decode_u64
(
argp
->
xdr
,
&
copy
->
cp_count
)
<
0
)
return
nfserr_bad_xdr
;
/* ca_consecutive: we always do consecutive copies */
if
(
xdr_stream_decode_u32
(
argp
->
xdr
,
&
consecutive
)
<
0
)
return
nfserr_bad_xdr
;
if
(
xdr_stream_decode_u32
(
argp
->
xdr
,
&
copy
->
cp_synchronous
)
<
0
)
return
nfserr_bad_xdr
;
READ_BUF
(
8
+
8
+
8
+
4
+
4
+
4
);
p
=
xdr_decode_hyper
(
p
,
&
copy
->
cp_src_pos
);
p
=
xdr_decode_hyper
(
p
,
&
copy
->
cp_dst_pos
);
p
=
xdr_decode_hyper
(
p
,
&
copy
->
cp_count
);
p
++
;
/* ca_consecutive: we always do consecutive copies */
copy
->
cp_synchronous
=
be32_to_cpup
(
p
++
);
count
=
be32_to_cpup
(
p
++
);
if
(
xdr_stream_decode_u32
(
argp
->
xdr
,
&
count
)
<
0
)
return
nfserr_bad_xdr
;
copy
->
cp_intra
=
false
;
if
(
count
==
0
)
{
/* intra-server copy */
copy
->
cp_intra
=
true
;
goto
intra
;
return
nfs_ok
;
}
/* decode all the supplied server addresses but use first */
/* decode all the supplied server addresses but use
only the
first */
status
=
nfsd4_decode_nl4_server
(
argp
,
&
copy
->
cp_src
);
if
(
status
)
return
status
;
ns_dummy
=
kmalloc
(
sizeof
(
struct
nl4_server
),
GFP_KERNEL
);
if
(
ns_dummy
==
NULL
)
return
nfserrno
(
-
ENOMEM
);
return
nfserrno
(
-
ENOMEM
);
/* XXX: jukebox? */
for
(
i
=
0
;
i
<
count
-
1
;
i
++
)
{
status
=
nfsd4_decode_nl4_server
(
argp
,
ns_dummy
);
if
(
status
)
{
...
...
@@ -2024,9 +2028,8 @@ nfsd4_decode_copy(struct nfsd4_compoundargs *argp, struct nfsd4_copy *copy)
}
}
kfree
(
ns_dummy
);
intra:
DECODE_TAIL
;
return
nfs_ok
;
}
static
__be32
...
...
@@ -4781,7 +4784,7 @@ nfsd4_encode_copy(struct nfsd4_compoundres *resp, __be32 nfserr,
__be32
*
p
;
nfserr
=
nfsd42_encode_write_res
(
resp
,
&
copy
->
cp_res
,
copy
->
cp_synchronous
);
!!
copy
->
cp_synchronous
);
if
(
nfserr
)
return
nfserr
;
...
...
fs/nfsd/xdr4.h
View file @
e8febea7
...
...
@@ -554,7 +554,7 @@ struct nfsd4_copy {
bool
cp_intra
;
/* both */
bool
cp_synchronous
;
u32
cp_synchronous
;
/* response */
struct
nfsd42_write_res
cp_res
;
...
...
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