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
f092be42
Commit
f092be42
authored
Aug 23, 2004
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Further XDR cleanups in preparation for delegations.
Signed-off-by:
Trond Myklebust
<
trond.myklebust@fys.uio.no
>
parent
b6784786
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
22 deletions
+30
-22
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+30
-22
No files found.
fs/nfs/nfs4proc.c
View file @
f092be42
...
@@ -248,6 +248,29 @@ int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *state)
...
@@ -248,6 +248,29 @@ int nfs4_open_reclaim(struct nfs4_state_owner *sp, struct nfs4_state *state)
return
err
;
return
err
;
}
}
static
int
_nfs4_proc_open_confirm
(
struct
rpc_clnt
*
clnt
,
const
struct
nfs_fhandle
*
fh
,
struct
nfs4_state_owner
*
sp
,
nfs4_stateid
*
stateid
)
{
struct
nfs_open_confirmargs
arg
=
{
.
fh
=
fh
,
.
seqid
=
sp
->
so_seqid
,
.
stateid
=
*
stateid
,
};
struct
nfs_open_confirmres
res
;
struct
rpc_message
msg
=
{
.
rpc_proc
=
&
nfs4_procedures
[
NFSPROC4_CLNT_OPEN_CONFIRM
],
.
rpc_argp
=
&
arg
,
.
rpc_resp
=
&
res
,
.
rpc_cred
=
sp
->
so_cred
,
};
int
status
;
status
=
rpc_call_sync
(
clnt
,
&
msg
,
0
);
nfs4_increment_seqid
(
status
,
sp
);
if
(
status
>=
0
)
memcpy
(
stateid
,
&
res
.
stateid
,
sizeof
(
*
stateid
));
return
status
;
}
/*
/*
* Returns an nfs4_state + an referenced inode
* Returns an nfs4_state + an referenced inode
*/
*/
...
@@ -305,6 +328,12 @@ static int _nfs4_do_open(struct inode *dir, struct qstr *name, int flags, struct
...
@@ -305,6 +328,12 @@ static int _nfs4_do_open(struct inode *dir, struct qstr *name, int flags, struct
if
(
status
)
if
(
status
)
goto
out_err
;
goto
out_err
;
update_changeattr
(
dir
,
&
o_res
.
cinfo
);
update_changeattr
(
dir
,
&
o_res
.
cinfo
);
if
(
o_res
.
rflags
&
NFS4_OPEN_RESULT_CONFIRM
)
{
status
=
_nfs4_proc_open_confirm
(
server
->
client
,
&
o_res
.
fh
,
sp
,
&
o_res
.
stateid
);
if
(
status
!=
0
)
goto
out_err
;
}
if
(
!
(
f_attr
.
valid
&
NFS_ATTR_FATTR
))
{
if
(
!
(
f_attr
.
valid
&
NFS_ATTR_FATTR
))
{
status
=
server
->
rpc_ops
->
getattr
(
server
,
&
o_res
.
fh
,
&
f_attr
);
status
=
server
->
rpc_ops
->
getattr
(
server
,
&
o_res
.
fh
,
&
f_attr
);
if
(
status
<
0
)
if
(
status
<
0
)
...
@@ -318,28 +347,7 @@ static int _nfs4_do_open(struct inode *dir, struct qstr *name, int flags, struct
...
@@ -318,28 +347,7 @@ static int _nfs4_do_open(struct inode *dir, struct qstr *name, int flags, struct
state
=
nfs4_get_open_state
(
inode
,
sp
);
state
=
nfs4_get_open_state
(
inode
,
sp
);
if
(
!
state
)
if
(
!
state
)
goto
out_err
;
goto
out_err
;
memcpy
(
&
state
->
stateid
,
&
o_res
.
stateid
,
sizeof
(
state
->
stateid
));
if
(
o_res
.
rflags
&
NFS4_OPEN_RESULT_CONFIRM
)
{
struct
nfs_open_confirmargs
oc_arg
=
{
.
fh
=
&
o_res
.
fh
,
.
seqid
=
sp
->
so_seqid
,
};
struct
nfs_open_confirmres
oc_res
;
struct
rpc_message
msg
=
{
.
rpc_proc
=
&
nfs4_procedures
[
NFSPROC4_CLNT_OPEN_CONFIRM
],
.
rpc_argp
=
&
oc_arg
,
.
rpc_resp
=
&
oc_res
,
.
rpc_cred
=
cred
,
};
memcpy
(
&
oc_arg
.
stateid
,
&
o_res
.
stateid
,
sizeof
(
oc_arg
.
stateid
));
status
=
rpc_call_sync
(
server
->
client
,
&
msg
,
0
);
nfs4_increment_seqid
(
status
,
sp
);
if
(
status
)
goto
out_err
;
memcpy
(
&
state
->
stateid
,
&
oc_res
.
stateid
,
sizeof
(
state
->
stateid
));
}
else
memcpy
(
&
state
->
stateid
,
&
o_res
.
stateid
,
sizeof
(
state
->
stateid
));
spin_lock
(
&
inode
->
i_lock
);
spin_lock
(
&
inode
->
i_lock
);
if
(
flags
&
FMODE_READ
)
if
(
flags
&
FMODE_READ
)
state
->
nreaders
++
;
state
->
nreaders
++
;
...
...
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