aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/cifsfs.c3
-rw-r--r--fs/cifs/cifsglob.h6
-rw-r--r--fs/cifs/file.c12
-rw-r--r--fs/cifs/readdir.c6
4 files changed, 16 insertions, 11 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 9d7996e8e793..d72fe37f5420 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -209,8 +209,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
209 209
210static long cifs_fallocate(struct file *file, int mode, loff_t off, loff_t len) 210static long cifs_fallocate(struct file *file, int mode, loff_t off, loff_t len)
211{ 211{
212 struct super_block *sb = file->f_path.dentry->d_sb; 212 struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
213 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
214 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); 213 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
215 struct TCP_Server_Info *server = tcon->ses->server; 214 struct TCP_Server_Info *server = tcon->ses->server;
216 215
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 02a33e529904..6e139111fdb2 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -1168,6 +1168,12 @@ CIFS_SB(struct super_block *sb)
1168 return sb->s_fs_info; 1168 return sb->s_fs_info;
1169} 1169}
1170 1170
1171static inline struct cifs_sb_info *
1172CIFS_FILE_SB(struct file *file)
1173{
1174 return CIFS_SB(file_inode(file)->i_sb);
1175}
1176
1171static inline char CIFS_DIR_SEP(const struct cifs_sb_info *cifs_sb) 1177static inline char CIFS_DIR_SEP(const struct cifs_sb_info *cifs_sb)
1172{ 1178{
1173 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS) 1179 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_POSIX_PATHS)
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 3e4d00a06c44..d535e168a9d3 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1586,7 +1586,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
1586 cifs_read_flock(flock, &type, &lock, &unlock, &wait_flag, 1586 cifs_read_flock(flock, &type, &lock, &unlock, &wait_flag,
1587 tcon->ses->server); 1587 tcon->ses->server);
1588 1588
1589 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 1589 cifs_sb = CIFS_FILE_SB(file);
1590 netfid = cfile->fid.netfid; 1590 netfid = cfile->fid.netfid;
1591 cinode = CIFS_I(file_inode(file)); 1591 cinode = CIFS_I(file_inode(file));
1592 1592
@@ -2305,7 +2305,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
2305 struct cifs_tcon *tcon; 2305 struct cifs_tcon *tcon;
2306 struct TCP_Server_Info *server; 2306 struct TCP_Server_Info *server;
2307 struct cifsFileInfo *smbfile = file->private_data; 2307 struct cifsFileInfo *smbfile = file->private_data;
2308 struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 2308 struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
2309 struct inode *inode = file->f_mapping->host; 2309 struct inode *inode = file->f_mapping->host;
2310 2310
2311 rc = filemap_write_and_wait_range(inode->i_mapping, start, end); 2311 rc = filemap_write_and_wait_range(inode->i_mapping, start, end);
@@ -2585,7 +2585,7 @@ cifs_iovec_write(struct file *file, struct iov_iter *from, loff_t *poffset)
2585 iov_iter_truncate(from, len); 2585 iov_iter_truncate(from, len);
2586 2586
2587 INIT_LIST_HEAD(&wdata_list); 2587 INIT_LIST_HEAD(&wdata_list);
2588 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 2588 cifs_sb = CIFS_FILE_SB(file);
2589 open_file = file->private_data; 2589 open_file = file->private_data;
2590 tcon = tlink_tcon(open_file->tlink); 2590 tcon = tlink_tcon(open_file->tlink);
2591 2591
@@ -3010,7 +3010,7 @@ ssize_t cifs_user_readv(struct kiocb *iocb, struct iov_iter *to)
3010 return 0; 3010 return 0;
3011 3011
3012 INIT_LIST_HEAD(&rdata_list); 3012 INIT_LIST_HEAD(&rdata_list);
3013 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 3013 cifs_sb = CIFS_FILE_SB(file);
3014 open_file = file->private_data; 3014 open_file = file->private_data;
3015 tcon = tlink_tcon(open_file->tlink); 3015 tcon = tlink_tcon(open_file->tlink);
3016 3016
@@ -3155,7 +3155,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset)
3155 __u32 pid; 3155 __u32 pid;
3156 3156
3157 xid = get_xid(); 3157 xid = get_xid();
3158 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 3158 cifs_sb = CIFS_FILE_SB(file);
3159 3159
3160 /* FIXME: set up handlers for larger reads and/or convert to async */ 3160 /* FIXME: set up handlers for larger reads and/or convert to async */
3161 rsize = min_t(unsigned int, cifs_sb->rsize, CIFSMaxBufSize); 3161 rsize = min_t(unsigned int, cifs_sb->rsize, CIFSMaxBufSize);
@@ -3462,7 +3462,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
3462 int rc; 3462 int rc;
3463 struct list_head tmplist; 3463 struct list_head tmplist;
3464 struct cifsFileInfo *open_file = file->private_data; 3464 struct cifsFileInfo *open_file = file->private_data;
3465 struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 3465 struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
3466 struct TCP_Server_Info *server; 3466 struct TCP_Server_Info *server;
3467 pid_t pid; 3467 pid_t pid;
3468 3468
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 586e3d3b204e..d19f1996a6ea 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -261,7 +261,7 @@ initiate_cifs_search(const unsigned int xid, struct file *file)
261 int rc = 0; 261 int rc = 0;
262 char *full_path = NULL; 262 char *full_path = NULL;
263 struct cifsFileInfo *cifsFile; 263 struct cifsFileInfo *cifsFile;
264 struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 264 struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
265 struct tcon_link *tlink = NULL; 265 struct tcon_link *tlink = NULL;
266 struct cifs_tcon *tcon; 266 struct cifs_tcon *tcon;
267 struct TCP_Server_Info *server; 267 struct TCP_Server_Info *server;
@@ -561,7 +561,7 @@ find_cifs_entry(const unsigned int xid, struct cifs_tcon *tcon, loff_t pos,
561 loff_t first_entry_in_buffer; 561 loff_t first_entry_in_buffer;
562 loff_t index_to_find = pos; 562 loff_t index_to_find = pos;
563 struct cifsFileInfo *cfile = file->private_data; 563 struct cifsFileInfo *cfile = file->private_data;
564 struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 564 struct cifs_sb_info *cifs_sb = CIFS_FILE_SB(file);
565 struct TCP_Server_Info *server = tcon->ses->server; 565 struct TCP_Server_Info *server = tcon->ses->server;
566 /* check if index in the buffer */ 566 /* check if index in the buffer */
567 567
@@ -679,7 +679,7 @@ static int cifs_filldir(char *find_entry, struct file *file,
679 char *scratch_buf, unsigned int max_len) 679 char *scratch_buf, unsigned int max_len)
680{ 680{
681 struct cifsFileInfo *file_info = file->private_data; 681 struct cifsFileInfo *file_info = file->private_data;
682 struct super_block *sb = file->f_path.dentry->d_sb; 682 struct super_block *sb = file_inode(file)->i_sb;
683 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 683 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
684 struct cifs_dirent de = { NULL, }; 684 struct cifs_dirent de = { NULL, };
685 struct cifs_fattr fattr; 685 struct cifs_fattr fattr;