diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-26 12:52:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-26 12:52:14 -0400 |
commit | 32e51f141fd8d880f57b6a2eb53ce72856254d4a (patch) | |
tree | d8d7a0d503533a03fb07b2ebd5eccd9043f2d228 /fs/hpfs | |
parent | ca16d140af91febe25daeb9e032bf8bd46b8c31f (diff) | |
parent | b6ff24a333267a6810e28ee5b9fc539d149c52f0 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (25 commits)
cifs: remove unnecessary dentry_unhash on rmdir/rename_dir
ocfs2: remove unnecessary dentry_unhash on rmdir/rename_dir
exofs: remove unnecessary dentry_unhash on rmdir/rename_dir
nfs: remove unnecessary dentry_unhash on rmdir/rename_dir
ext2: remove unnecessary dentry_unhash on rmdir/rename_dir
ext3: remove unnecessary dentry_unhash on rmdir/rename_dir
ext4: remove unnecessary dentry_unhash on rmdir/rename_dir
btrfs: remove unnecessary dentry_unhash in rmdir/rename_dir
ceph: remove unnecessary dentry_unhash calls
vfs: clean up vfs_rename_other
vfs: clean up vfs_rename_dir
vfs: clean up vfs_rmdir
vfs: fix vfs_rename_dir for FS_RENAME_DOES_D_MOVE filesystems
libfs: drop unneeded dentry_unhash
vfs: update dentry_unhash() comment
vfs: push dentry_unhash on rename_dir into file systems
vfs: push dentry_unhash on rmdir into file systems
vfs: remove dget() from dentry_unhash()
vfs: dentry_unhash immediately prior to rmdir
vfs: Block mmapped writes while the fs is frozen
...
Diffstat (limited to 'fs/hpfs')
-rw-r--r-- | fs/hpfs/namei.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c index 1f05839c27a7..ff0ce21c0867 100644 --- a/fs/hpfs/namei.c +++ b/fs/hpfs/namei.c | |||
@@ -395,7 +395,6 @@ again: | |||
395 | 395 | ||
396 | dentry_unhash(dentry); | 396 | dentry_unhash(dentry); |
397 | if (!d_unhashed(dentry)) { | 397 | if (!d_unhashed(dentry)) { |
398 | dput(dentry); | ||
399 | hpfs_unlock(dir->i_sb); | 398 | hpfs_unlock(dir->i_sb); |
400 | return -ENOSPC; | 399 | return -ENOSPC; |
401 | } | 400 | } |
@@ -403,7 +402,6 @@ again: | |||
403 | !S_ISREG(inode->i_mode) || | 402 | !S_ISREG(inode->i_mode) || |
404 | get_write_access(inode)) { | 403 | get_write_access(inode)) { |
405 | d_rehash(dentry); | 404 | d_rehash(dentry); |
406 | dput(dentry); | ||
407 | } else { | 405 | } else { |
408 | struct iattr newattrs; | 406 | struct iattr newattrs; |
409 | /*printk("HPFS: truncating file before delete.\n");*/ | 407 | /*printk("HPFS: truncating file before delete.\n");*/ |
@@ -411,7 +409,6 @@ again: | |||
411 | newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; | 409 | newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; |
412 | err = notify_change(dentry, &newattrs); | 410 | err = notify_change(dentry, &newattrs); |
413 | put_write_access(inode); | 411 | put_write_access(inode); |
414 | dput(dentry); | ||
415 | if (!err) | 412 | if (!err) |
416 | goto again; | 413 | goto again; |
417 | } | 414 | } |
@@ -442,6 +439,8 @@ static int hpfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
442 | int err; | 439 | int err; |
443 | int r; | 440 | int r; |
444 | 441 | ||
442 | dentry_unhash(dentry); | ||
443 | |||
445 | hpfs_adjust_length(name, &len); | 444 | hpfs_adjust_length(name, &len); |
446 | hpfs_lock(dir->i_sb); | 445 | hpfs_lock(dir->i_sb); |
447 | err = -ENOENT; | 446 | err = -ENOENT; |
@@ -535,6 +534,10 @@ static int hpfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
535 | struct buffer_head *bh; | 534 | struct buffer_head *bh; |
536 | struct fnode *fnode; | 535 | struct fnode *fnode; |
537 | int err; | 536 | int err; |
537 | |||
538 | if (new_inode && S_ISDIR(new_inode->i_mode)) | ||
539 | dentry_unhash(new_dentry); | ||
540 | |||
538 | if ((err = hpfs_chk_name(new_name, &new_len))) return err; | 541 | if ((err = hpfs_chk_name(new_name, &new_len))) return err; |
539 | err = 0; | 542 | err = 0; |
540 | hpfs_adjust_length(old_name, &old_len); | 543 | hpfs_adjust_length(old_name, &old_len); |