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
nexedi
linux
Commits
535918f1
Commit
535918f1
authored
Sep 17, 2010
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Further cleanups for nfs4_open_revalidate()
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
b8d4cadd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
35 deletions
+26
-35
fs/nfs/dir.c
fs/nfs/dir.c
+26
-6
fs/nfs/nfs4_fs.h
fs/nfs/nfs4_fs.h
+0
-1
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+0
-28
No files found.
fs/nfs/dir.c
View file @
535918f1
...
...
@@ -1204,16 +1204,36 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
* operations that change the directory. We therefore save the
* change attribute *before* we do the RPC call.
*/
ret
=
nfs4_open_revalidate
(
dir
,
ctx
,
openflags
);
if
(
ret
==
1
)
inode
=
nfs4_atomic_open
(
dir
,
ctx
,
openflags
,
NULL
);
if
(
IS_ERR
(
inode
))
{
ret
=
PTR_ERR
(
inode
);
switch
(
ret
)
{
case
-
EPERM
:
case
-
EACCES
:
case
-
EDQUOT
:
case
-
ENOSPC
:
case
-
EROFS
:
goto
out_put_ctx
;
default:
goto
out_drop
;
}
}
iput
(
inode
);
if
(
inode
==
dentry
->
d_inode
)
{
nfs_set_verifier
(
dentry
,
nfs_save_change_attribute
(
dir
));
nfs_intent_set_file
(
nd
,
ctx
);
else
put_nfs_open_context
(
ctx
)
;
}
else
goto
out_drop
;
out:
dput
(
parent
);
if
(
!
ret
)
d_drop
(
dentry
);
return
ret
;
out_drop:
d_drop
(
dentry
);
ret
=
0
;
out_put_ctx:
put_nfs_open_context
(
ctx
);
goto
out
;
no_open_dput:
dput
(
parent
);
no_open:
...
...
fs/nfs/nfs4_fs.h
View file @
535918f1
...
...
@@ -243,7 +243,6 @@ extern int nfs4_init_clientid(struct nfs_client *, struct rpc_cred *);
extern
int
nfs41_init_clientid
(
struct
nfs_client
*
,
struct
rpc_cred
*
);
extern
int
nfs4_do_close
(
struct
path
*
path
,
struct
nfs4_state
*
state
,
gfp_t
gfp_mask
,
int
wait
);
extern
struct
inode
*
nfs4_atomic_open
(
struct
inode
*
,
struct
nfs_open_context
*
,
int
,
struct
iattr
*
);
extern
int
nfs4_open_revalidate
(
struct
inode
*
,
struct
nfs_open_context
*
,
int
);
extern
int
nfs4_server_capabilities
(
struct
nfs_server
*
server
,
struct
nfs_fh
*
fhandle
);
extern
int
nfs4_proc_fs_locations
(
struct
inode
*
dir
,
const
struct
qstr
*
name
,
struct
nfs4_fs_locations
*
fs_locations
,
struct
page
*
page
);
...
...
fs/nfs/nfs4proc.c
View file @
535918f1
...
...
@@ -2037,34 +2037,6 @@ nfs4_atomic_open(struct inode *dir, struct nfs_open_context *ctx, int open_flags
return
igrab
(
state
->
inode
);
}
int
nfs4_open_revalidate
(
struct
inode
*
dir
,
struct
nfs_open_context
*
ctx
,
int
openflags
)
{
struct
nfs4_state
*
state
;
state
=
nfs4_do_open
(
dir
,
&
ctx
->
path
,
ctx
->
mode
,
openflags
,
NULL
,
ctx
->
cred
);
if
(
IS_ERR
(
state
))
{
switch
(
PTR_ERR
(
state
))
{
case
-
EPERM
:
case
-
EACCES
:
case
-
EDQUOT
:
case
-
ENOSPC
:
case
-
EROFS
:
return
PTR_ERR
(
state
);
default:
goto
out_drop
;
}
}
ctx
->
state
=
state
;
if
(
state
->
inode
==
ctx
->
path
.
dentry
->
d_inode
)
{
nfs_set_verifier
(
ctx
->
path
.
dentry
,
nfs_save_change_attribute
(
dir
));
return
1
;
}
out_drop:
d_drop
(
ctx
->
path
.
dentry
);
return
0
;
}
static
void
nfs4_close_context
(
struct
nfs_open_context
*
ctx
,
int
is_sync
)
{
if
(
ctx
->
state
==
NULL
)
...
...
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