aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/readdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r--fs/cifs/readdir.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 105761e3ba0e..9aeb58a7d369 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -82,7 +82,6 @@ static int construct_dentry(struct qstr *qstring, struct file *file,
82 if(*ptmp_inode == NULL) 82 if(*ptmp_inode == NULL)
83 return rc; 83 return rc;
84 rc = 1; 84 rc = 1;
85 d_instantiate(tmp_dentry, *ptmp_inode);
86 } 85 }
87 } else { 86 } else {
88 tmp_dentry = d_alloc(file->f_dentry, qstring); 87 tmp_dentry = d_alloc(file->f_dentry, qstring);
@@ -99,9 +98,7 @@ static int construct_dentry(struct qstr *qstring, struct file *file,
99 tmp_dentry->d_op = &cifs_dentry_ops; 98 tmp_dentry->d_op = &cifs_dentry_ops;
100 if(*ptmp_inode == NULL) 99 if(*ptmp_inode == NULL)
101 return rc; 100 return rc;
102 rc = 1; 101 rc = 2;
103 d_instantiate(tmp_dentry, *ptmp_inode);
104 d_rehash(tmp_dentry);
105 } 102 }
106 103
107 tmp_dentry->d_time = jiffies; 104 tmp_dentry->d_time = jiffies;
@@ -870,6 +867,12 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
870 pfindEntry, &obj_type, rc); 867 pfindEntry, &obj_type, rc);
871 else 868 else
872 fill_in_inode(tmp_inode, 1 /* NT */, pfindEntry, &obj_type, rc); 869 fill_in_inode(tmp_inode, 1 /* NT */, pfindEntry, &obj_type, rc);
870
871 if(rc) /* new inode - needs to be tied to dentry */ {
872 d_instantiate(tmp_dentry, tmp_inode);
873 if(rc == 2)
874 d_rehash(tmp_dentry);
875 }
873 876
874 877
875 rc = filldir(direntry,qstring.name,qstring.len,file->f_pos, 878 rc = filldir(direntry,qstring.name,qstring.len,file->f_pos,