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
4872eacc
Commit
4872eacc
authored
Jul 21, 2002
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
4161a75e
17191a2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
42 deletions
+22
-42
fs/namei.c
fs/namei.c
+4
-7
fs/nfs/dir.c
fs/nfs/dir.c
+18
-35
No files found.
fs/namei.c
View file @
4872eacc
...
...
@@ -1593,16 +1593,13 @@ int vfs_unlink(struct inode *dir, struct dentry *dentry)
down
(
&
dentry
->
d_inode
->
i_sem
);
if
(
d_mountpoint
(
dentry
))
error
=
-
EBUSY
;
else
{
else
error
=
dir
->
i_op
->
unlink
(
dir
,
dentry
);
if
(
!
error
)
d_delete
(
dentry
);
}
up
(
&
dentry
->
d_inode
->
i_sem
);
if
(
!
error
)
if
(
!
error
)
{
d_delete
(
dentry
);
inode_dir_notify
(
dir
,
DN_DELETE
);
}
return
error
;
}
...
...
fs/nfs/dir.c
View file @
4872eacc
...
...
@@ -772,10 +772,6 @@ static int nfs_sillyrename(struct inode *dir, struct dentry *dentry)
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
atomic_read
(
&
dentry
->
d_count
));
if
(
atomic_read
(
&
dentry
->
d_count
)
==
1
)
goto
out
;
/* No need to silly rename. */
#ifdef NFS_PARANOIA
if
(
!
dentry
->
d_inode
)
printk
(
"NFS: silly-renaming %s/%s, negative dentry??
\n
"
,
...
...
@@ -842,26 +838,10 @@ static int nfs_safe_remove(struct dentry *dentry)
dfprintk
(
VFS
,
"NFS: safe_remove(%s/%s)
\n
"
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
);
/*
* Unhash the dentry while we remove the file ...
*/
if
(
!
d_unhashed
(
dentry
))
{
d_drop
(
dentry
);
rehash
=
1
;
}
if
(
atomic_read
(
&
dentry
->
d_count
)
>
1
)
{
#ifdef NFS_PARANOIA
printk
(
"nfs_safe_remove: %s/%s busy, d_count=%d
\n
"
,
dentry
->
d_parent
->
d_name
.
name
,
dentry
->
d_name
.
name
,
atomic_read
(
&
dentry
->
d_count
));
#endif
goto
out
;
}
/* If the dentry was sillyrenamed, we simply call d_delete() */
if
(
dentry
->
d_flags
&
DCACHE_NFSFS_RENAMED
)
{
error
=
0
;
goto
out
_delete
;
goto
out
;
}
nfs_zap_caches
(
dir
);
...
...
@@ -872,15 +852,7 @@ static int nfs_safe_remove(struct dentry *dentry)
goto
out
;
if
(
inode
)
inode
->
i_nlink
--
;
out_delete:
/*
* Free the inode
*/
d_delete
(
dentry
);
out:
if
(
rehash
)
d_rehash
(
dentry
);
return
error
;
}
...
...
@@ -892,18 +864,29 @@ static int nfs_safe_remove(struct dentry *dentry)
static
int
nfs_unlink
(
struct
inode
*
dir
,
struct
dentry
*
dentry
)
{
int
error
;
int
need_rehash
=
0
;
dfprintk
(
VFS
,
"NFS: unlink(%s/%ld, %s)
\n
"
,
dir
->
i_sb
->
s_id
,
dir
->
i_ino
,
dentry
->
d_name
.
name
);
lock_kernel
();
error
=
nfs_sillyrename
(
dir
,
dentry
);
if
(
error
&&
error
!=
-
EBUSY
)
{
error
=
nfs_safe_remove
(
dentry
);
if
(
!
error
)
{
nfs_renew_times
(
dentry
);
}
spin_lock
(
&
dcache_lock
);
if
(
atomic_read
(
&
dentry
->
d_count
)
>
1
)
{
spin_unlock
(
&
dcache_lock
);
error
=
nfs_sillyrename
(
dir
,
dentry
);
unlock_kernel
();
return
error
;
}
if
(
!
d_unhashed
(
dentry
))
{
d_drop
(
dentry
);
need_rehash
=
1
;
}
spin_unlock
(
&
dcache_lock
);
error
=
nfs_safe_remove
(
dentry
);
if
(
!
error
)
nfs_renew_times
(
dentry
);
else
if
(
need_rehash
)
d_rehash
(
dentry
);
unlock_kernel
();
return
error
;
}
...
...
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