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.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index cdd6ff48246b..df40cc5fd13a 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -82,12 +82,10 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
82 82
83 cFYI(1, "%s: for %s", __func__, name->name); 83 cFYI(1, "%s: for %s", __func__, name->name);
84 84
85 if (parent->d_op && parent->d_op->d_hash) 85 dentry = d_hash_and_lookup(parent, name);
86 parent->d_op->d_hash(parent, parent->d_inode, name); 86 if (unlikely(IS_ERR(dentry)))
87 else 87 return;
88 name->hash = full_name_hash(name->name, name->len);
89 88
90 dentry = d_lookup(parent, name);
91 if (dentry) { 89 if (dentry) {
92 int err; 90 int err;
93 91
@@ -505,7 +503,7 @@ static int cifs_entry_is_dot(struct cifs_dirent *de, bool is_unicode)
505 whether we can use the cached search results from the previous search */ 503 whether we can use the cached search results from the previous search */
506static int is_dir_changed(struct file *file) 504static int is_dir_changed(struct file *file)
507{ 505{
508 struct inode *inode = file->f_path.dentry->d_inode; 506 struct inode *inode = file_inode(file);
509 struct cifsInodeInfo *cifsInfo = CIFS_I(inode); 507 struct cifsInodeInfo *cifsInfo = CIFS_I(inode);
510 508
511 if (cifsInfo->time == 0) 509 if (cifsInfo->time == 0)
@@ -778,7 +776,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
778 switch ((int) file->f_pos) { 776 switch ((int) file->f_pos) {
779 case 0: 777 case 0:
780 if (filldir(direntry, ".", 1, file->f_pos, 778 if (filldir(direntry, ".", 1, file->f_pos,
781 file->f_path.dentry->d_inode->i_ino, DT_DIR) < 0) { 779 file_inode(file)->i_ino, DT_DIR) < 0) {
782 cERROR(1, "Filldir for current dir failed"); 780 cERROR(1, "Filldir for current dir failed");
783 rc = -ENOMEM; 781 rc = -ENOMEM;
784 break; 782 break;