Merge tag 'trace-seq-buf-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/roste...
[cascardo/linux.git] / fs / cifs / readdir.c
index 8fd2a95..8eaf20a 100644 (file)
@@ -123,7 +123,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
        if (!inode)
                goto out;
 
-       alias = d_materialise_unique(dentry, inode);
+       alias = d_splice_alias(inode, dentry);
        if (alias && !IS_ERR(alias))
                dput(alias);
 out:
@@ -261,7 +261,7 @@ initiate_cifs_search(const unsigned int xid, struct file *file)
        int rc = 0;
        char *full_path = NULL;
        struct cifsFileInfo *cifsFile;
-       struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
+       struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
        struct tcon_link *tlink = NULL;
        struct cifs_tcon *tcon;
        struct TCP_Server_Info *server;
@@ -561,7 +561,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon, loff_t pos,
        loff_t first_entry_in_buffer;
        loff_t index_to_find = pos;
        struct cifsFileInfo *cfile = file->private_data;
-       struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
+       struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
        struct TCP_Server_Info *server = tcon->ses->server;
        /* check if index in the buffer */
 
@@ -679,7 +679,7 @@ static int cifs_filldir(char *find_entry, struct file *file,
                char *scratch_buf, unsigned int max_len)
 {
        struct cifsFileInfo *file_info = file->private_data;
-       struct super_block *sb = file->f_path.dentry->d_sb;
+       struct super_block *sb = file_inode(file)->i_sb;
        struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
        struct cifs_dirent de = { NULL, };
        struct cifs_fattr fattr;
@@ -753,7 +753,7 @@ static int cifs_filldir(char *find_entry, struct file *file,
                 */
                fattr.cf_flags |= CIFS_FATTR_NEED_REVAL;
 
-       cifs_prime_dcache(file->f_dentry, &name, &fattr);
+       cifs_prime_dcache(file->f_path.dentry, &name, &fattr);
 
        ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid);
        return !dir_emit(ctx, name.name, name.len, ino, fattr.cf_dtype);
@@ -794,10 +794,6 @@ int cifs_readdir(struct file *file, struct dir_context *ctx)
                if it before then restart search
                if after then keep searching till find it */
 
-       if (file->private_data == NULL) {
-               rc = -EINVAL;
-               goto rddir2_exit;
-       }
        cifsFile = file->private_data;
        if (cifsFile->srch_inf.endOfSearch) {
                if (cifsFile->srch_inf.emptyDir) {