aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/dcache.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/dcache.c b/fs/dcache.c
index 3d4be6f8e49e..85c9e2bff8e6 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -683,8 +683,6 @@ EXPORT_SYMBOL(dget_parent);
683/** 683/**
684 * d_find_alias - grab a hashed alias of inode 684 * d_find_alias - grab a hashed alias of inode
685 * @inode: inode in question 685 * @inode: inode in question
686 * @want_discon: flag, used by d_splice_alias, to request
687 * that only a DISCONNECTED alias be returned.
688 * 686 *
689 * If inode has a hashed alias, or is a directory and has any alias, 687 * If inode has a hashed alias, or is a directory and has any alias,
690 * acquire the reference to alias and return it. Otherwise return NULL. 688 * acquire the reference to alias and return it. Otherwise return NULL.
@@ -693,10 +691,9 @@ EXPORT_SYMBOL(dget_parent);
693 * of a filesystem. 691 * of a filesystem.
694 * 692 *
695 * If the inode has an IS_ROOT, DCACHE_DISCONNECTED alias, then prefer 693 * If the inode has an IS_ROOT, DCACHE_DISCONNECTED alias, then prefer
696 * any other hashed alias over that one unless @want_discon is set, 694 * any other hashed alias over that.
697 * in which case only return an IS_ROOT, DCACHE_DISCONNECTED alias.
698 */ 695 */
699static struct dentry *__d_find_alias(struct inode *inode, int want_discon) 696static struct dentry *__d_find_alias(struct inode *inode)
700{ 697{
701 struct dentry *alias, *discon_alias; 698 struct dentry *alias, *discon_alias;
702 699
@@ -708,7 +705,7 @@ again:
708 if (IS_ROOT(alias) && 705 if (IS_ROOT(alias) &&
709 (alias->d_flags & DCACHE_DISCONNECTED)) { 706 (alias->d_flags & DCACHE_DISCONNECTED)) {
710 discon_alias = alias; 707 discon_alias = alias;
711 } else if (!want_discon) { 708 } else {
712 __dget_dlock(alias); 709 __dget_dlock(alias);
713 spin_unlock(&alias->d_lock); 710 spin_unlock(&alias->d_lock);
714 return alias; 711 return alias;
@@ -739,7 +736,7 @@ struct dentry *d_find_alias(struct inode *inode)
739 736
740 if (!list_empty(&inode->i_dentry)) { 737 if (!list_empty(&inode->i_dentry)) {
741 spin_lock(&inode->i_lock); 738 spin_lock(&inode->i_lock);
742 de = __d_find_alias(inode, 0); 739 de = __d_find_alias(inode);
743 spin_unlock(&inode->i_lock); 740 spin_unlock(&inode->i_lock);
744 } 741 }
745 return de; 742 return de;
@@ -2481,7 +2478,7 @@ struct dentry *d_materialise_unique(struct dentry *dentry, struct inode *inode)
2481 struct dentry *alias; 2478 struct dentry *alias;
2482 2479
2483 /* Does an aliased dentry already exist? */ 2480 /* Does an aliased dentry already exist? */
2484 alias = __d_find_alias(inode, 0); 2481 alias = __d_find_alias(inode);
2485 if (alias) { 2482 if (alias) {
2486 actual = alias; 2483 actual = alias;
2487 write_seqlock(&rename_lock); 2484 write_seqlock(&rename_lock);