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
5584c306
Commit
5584c306
authored
Dec 23, 2008
by
Trond Myklebust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NFSv4: Clean up is_atomic_open()
Signed-off-by:
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
parent
bd7bf9d5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
fs/nfs/dir.c
fs/nfs/dir.c
+8
-7
No files found.
fs/nfs/dir.c
View file @
5584c306
...
...
@@ -973,7 +973,7 @@ struct dentry_operations nfs4_dentry_operations = {
* Use intent information to determine whether we need to substitute
* the NFSv4-style stateful OPEN for the LOOKUP call
*/
static
int
is_atomic_open
(
struct
inode
*
dir
,
struct
nameidata
*
nd
)
static
int
is_atomic_open
(
struct
nameidata
*
nd
)
{
if
(
nd
==
NULL
||
nfs_lookup_check_intent
(
nd
,
LOOKUP_OPEN
)
==
0
)
return
0
;
...
...
@@ -996,7 +996,7 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
dir
->
i_sb
->
s_id
,
dir
->
i_ino
,
dentry
->
d_name
.
name
);
/* Check that we are indeed trying to open this file */
if
(
!
is_atomic_open
(
dir
,
nd
))
if
(
!
is_atomic_open
(
nd
))
goto
no_open
;
if
(
dentry
->
d_name
.
len
>
NFS_SERVER
(
dir
)
->
namelen
)
{
...
...
@@ -1047,10 +1047,10 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
struct
inode
*
dir
;
int
openflags
,
ret
=
0
;
if
(
!
is_atomic_open
(
nd
))
goto
no_open
;
parent
=
dget_parent
(
dentry
);
dir
=
parent
->
d_inode
;
if
(
!
is_atomic_open
(
dir
,
nd
))
goto
no_open
;
/* We can't create new files in nfs_open_revalidate(), so we
* optimize away revalidation of negative dentries.
*/
...
...
@@ -1062,11 +1062,11 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
/* NFS only supports OPEN on regular files */
if
(
!
S_ISREG
(
inode
->
i_mode
))
goto
no_open
;
goto
no_open
_dput
;
openflags
=
nd
->
intent
.
open
.
flags
;
/* We cannot do exclusive creation on a positive dentry */
if
((
openflags
&
(
O_CREAT
|
O_EXCL
))
==
(
O_CREAT
|
O_EXCL
))
goto
no_open
;
goto
no_open
_dput
;
/* We can't create new files, or truncate existing ones here */
openflags
&=
~
(
O_CREAT
|
O_TRUNC
);
...
...
@@ -1081,8 +1081,9 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
if
(
!
ret
)
d_drop
(
dentry
);
return
ret
;
no_open:
no_open
_dput
:
dput
(
parent
);
no_open:
if
(
inode
!=
NULL
&&
nfs_have_delegation
(
inode
,
FMODE_READ
))
return
1
;
return
nfs_lookup_revalidate
(
dentry
,
nd
);
...
...
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