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
a4773c08
Commit
a4773c08
authored
Feb 02, 2009
by
J. Bruce Fields
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nfsd4: use helper for copying filehandles for replay
Signed-off-by:
J. Bruce Fields
<
bfields@citi.umich.edu
>
parent
13024b7b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4proc.c
+6
-11
include/linux/nfsd/nfsfh.h
include/linux/nfsd/nfsfh.h
+7
-0
include/linux/nfsd/state.h
include/linux/nfsd/state.h
+1
-2
No files found.
fs/nfsd/nfs4proc.c
View file @
a4773c08
...
...
@@ -123,10 +123,8 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
fh_dup2
(
current_fh
,
&
resfh
);
/* set reply cache */
open
->
op_stateowner
->
so_replay
.
rp_openfh_len
=
resfh
.
fh_handle
.
fh_size
;
memcpy
(
open
->
op_stateowner
->
so_replay
.
rp_openfh
,
&
resfh
.
fh_handle
.
fh_base
,
resfh
.
fh_handle
.
fh_size
);
fh_copy_shallow
(
&
open
->
op_stateowner
->
so_replay
.
rp_openfh
,
&
resfh
.
fh_handle
);
if
(
!
created
)
status
=
do_open_permission
(
rqstp
,
current_fh
,
open
,
NFSD_MAY_NOP
);
...
...
@@ -152,10 +150,8 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_
memset
(
&
open
->
op_cinfo
,
0
,
sizeof
(
struct
nfsd4_change_info
));
/* set replay cache */
open
->
op_stateowner
->
so_replay
.
rp_openfh_len
=
current_fh
->
fh_handle
.
fh_size
;
memcpy
(
open
->
op_stateowner
->
so_replay
.
rp_openfh
,
&
current_fh
->
fh_handle
.
fh_base
,
current_fh
->
fh_handle
.
fh_size
);
fh_copy_shallow
(
&
open
->
op_stateowner
->
so_replay
.
rp_openfh
,
&
current_fh
->
fh_handle
);
open
->
op_truncate
=
(
open
->
op_iattr
.
ia_valid
&
ATTR_SIZE
)
&&
(
open
->
op_iattr
.
ia_size
==
0
);
...
...
@@ -187,9 +183,8 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
if
(
status
==
nfserr_replay_me
)
{
struct
nfs4_replay
*
rp
=
&
open
->
op_stateowner
->
so_replay
;
fh_put
(
&
cstate
->
current_fh
);
cstate
->
current_fh
.
fh_handle
.
fh_size
=
rp
->
rp_openfh_len
;
memcpy
(
&
cstate
->
current_fh
.
fh_handle
.
fh_base
,
rp
->
rp_openfh
,
rp
->
rp_openfh_len
);
fh_copy_shallow
(
&
cstate
->
current_fh
.
fh_handle
,
&
rp
->
rp_openfh
);
status
=
fh_verify
(
rqstp
,
&
cstate
->
current_fh
,
0
,
NFSD_MAY_NOP
);
if
(
status
)
dprintk
(
"nfsd4_open: replay failed"
...
...
include/linux/nfsd/nfsfh.h
View file @
a4773c08
...
...
@@ -269,6 +269,13 @@ fh_copy(struct svc_fh *dst, struct svc_fh *src)
return
dst
;
}
static
inline
void
fh_copy_shallow
(
struct
knfsd_fh
*
dst
,
struct
knfsd_fh
*
src
)
{
dst
->
fh_size
=
src
->
fh_size
;
memcpy
(
&
dst
->
fh_base
,
&
src
->
fh_base
,
src
->
fh_size
);
}
static
__inline__
struct
svc_fh
*
fh_init
(
struct
svc_fh
*
fhp
,
int
maxsize
)
{
...
...
include/linux/nfsd/state.h
View file @
a4773c08
...
...
@@ -168,8 +168,7 @@ struct nfs4_replay {
unsigned
int
rp_buflen
;
char
*
rp_buf
;
unsigned
intrp_allocated
;
int
rp_openfh_len
;
char
rp_openfh
[
NFS4_FHSIZE
];
struct
knfsd_fh
rp_openfh
;
char
rp_ibuf
[
NFSD4_REPLAY_ISIZE
];
};
...
...
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