aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifsfs.c4
-rw-r--r--fs/cifs/fcntl.c4
-rw-r--r--fs/cifs/file.c114
-rw-r--r--fs/cifs/readdir.c32
4 files changed, 77 insertions, 77 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 71bc87a37fc1..10c90294cd18 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -498,7 +498,7 @@ cifs_get_sb(struct file_system_type *fs_type,
498static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, 498static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
499 unsigned long nr_segs, loff_t pos) 499 unsigned long nr_segs, loff_t pos)
500{ 500{
501 struct inode *inode = iocb->ki_filp->f_dentry->d_inode; 501 struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode;
502 ssize_t written; 502 ssize_t written;
503 503
504 written = generic_file_aio_write(iocb, iov, nr_segs, pos); 504 written = generic_file_aio_write(iocb, iov, nr_segs, pos);
@@ -511,7 +511,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
511{ 511{
512 /* origin == SEEK_END => we must revalidate the cached file length */ 512 /* origin == SEEK_END => we must revalidate the cached file length */
513 if (origin == SEEK_END) { 513 if (origin == SEEK_END) {
514 int retval = cifs_revalidate(file->f_dentry); 514 int retval = cifs_revalidate(file->f_path.dentry);
515 if (retval < 0) 515 if (retval < 0)
516 return (loff_t)retval; 516 return (loff_t)retval;
517 } 517 }
diff --git a/fs/cifs/fcntl.c b/fs/cifs/fcntl.c
index d91a3d44e9e3..da12b482ebe5 100644
--- a/fs/cifs/fcntl.c
+++ b/fs/cifs/fcntl.c
@@ -83,10 +83,10 @@ int cifs_dir_notify(struct file * file, unsigned long arg)
83 return 0; 83 return 0;
84 84
85 xid = GetXid(); 85 xid = GetXid();
86 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 86 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
87 pTcon = cifs_sb->tcon; 87 pTcon = cifs_sb->tcon;
88 88
89 full_path = build_path_from_dentry(file->f_dentry); 89 full_path = build_path_from_dentry(file->f_path.dentry);
90 90
91 if(full_path == NULL) { 91 if(full_path == NULL) {
92 rc = -ENOMEM; 92 rc = -ENOMEM;
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 2436ed8fc840..1aa95a50cac2 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -122,34 +122,34 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file,
122 /* if not oplocked, invalidate inode pages if mtime or file 122 /* if not oplocked, invalidate inode pages if mtime or file
123 size changed */ 123 size changed */
124 temp = cifs_NTtimeToUnix(le64_to_cpu(buf->LastWriteTime)); 124 temp = cifs_NTtimeToUnix(le64_to_cpu(buf->LastWriteTime));
125 if (timespec_equal(&file->f_dentry->d_inode->i_mtime, &temp) && 125 if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) &&
126 (file->f_dentry->d_inode->i_size == 126 (file->f_path.dentry->d_inode->i_size ==
127 (loff_t)le64_to_cpu(buf->EndOfFile))) { 127 (loff_t)le64_to_cpu(buf->EndOfFile))) {
128 cFYI(1, ("inode unchanged on server")); 128 cFYI(1, ("inode unchanged on server"));
129 } else { 129 } else {
130 if (file->f_dentry->d_inode->i_mapping) { 130 if (file->f_path.dentry->d_inode->i_mapping) {
131 /* BB no need to lock inode until after invalidate 131 /* BB no need to lock inode until after invalidate
132 since namei code should already have it locked? */ 132 since namei code should already have it locked? */
133 filemap_write_and_wait(file->f_dentry->d_inode->i_mapping); 133 filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping);
134 } 134 }
135 cFYI(1, ("invalidating remote inode since open detected it " 135 cFYI(1, ("invalidating remote inode since open detected it "
136 "changed")); 136 "changed"));
137 invalidate_remote_inode(file->f_dentry->d_inode); 137 invalidate_remote_inode(file->f_path.dentry->d_inode);
138 } 138 }
139 139
140client_can_cache: 140client_can_cache:
141 if (pTcon->ses->capabilities & CAP_UNIX) 141 if (pTcon->ses->capabilities & CAP_UNIX)
142 rc = cifs_get_inode_info_unix(&file->f_dentry->d_inode, 142 rc = cifs_get_inode_info_unix(&file->f_path.dentry->d_inode,
143 full_path, inode->i_sb, xid); 143 full_path, inode->i_sb, xid);
144 else 144 else
145 rc = cifs_get_inode_info(&file->f_dentry->d_inode, 145 rc = cifs_get_inode_info(&file->f_path.dentry->d_inode,
146 full_path, buf, inode->i_sb, xid); 146 full_path, buf, inode->i_sb, xid);
147 147
148 if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) { 148 if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) {
149 pCifsInode->clientCanCacheAll = TRUE; 149 pCifsInode->clientCanCacheAll = TRUE;
150 pCifsInode->clientCanCacheRead = TRUE; 150 pCifsInode->clientCanCacheRead = TRUE;
151 cFYI(1, ("Exclusive Oplock granted on inode %p", 151 cFYI(1, ("Exclusive Oplock granted on inode %p",
152 file->f_dentry->d_inode)); 152 file->f_path.dentry->d_inode));
153 } else if ((*oplock & 0xF) == OPLOCK_READ) 153 } else if ((*oplock & 0xF) == OPLOCK_READ)
154 pCifsInode->clientCanCacheRead = TRUE; 154 pCifsInode->clientCanCacheRead = TRUE;
155 155
@@ -178,7 +178,7 @@ int cifs_open(struct inode *inode, struct file *file)
178 178
179 if (file->f_flags & O_CREAT) { 179 if (file->f_flags & O_CREAT) {
180 /* search inode for this file and fill in file->private_data */ 180 /* search inode for this file and fill in file->private_data */
181 pCifsInode = CIFS_I(file->f_dentry->d_inode); 181 pCifsInode = CIFS_I(file->f_path.dentry->d_inode);
182 read_lock(&GlobalSMBSeslock); 182 read_lock(&GlobalSMBSeslock);
183 list_for_each(tmp, &pCifsInode->openFileList) { 183 list_for_each(tmp, &pCifsInode->openFileList) {
184 pCifsFile = list_entry(tmp, struct cifsFileInfo, 184 pCifsFile = list_entry(tmp, struct cifsFileInfo,
@@ -206,7 +206,7 @@ int cifs_open(struct inode *inode, struct file *file)
206 } 206 }
207 } 207 }
208 208
209 full_path = build_path_from_dentry(file->f_dentry); 209 full_path = build_path_from_dentry(file->f_path.dentry);
210 if (full_path == NULL) { 210 if (full_path == NULL) {
211 FreeXid(xid); 211 FreeXid(xid);
212 return -ENOMEM; 212 return -ENOMEM;
@@ -291,7 +291,7 @@ int cifs_open(struct inode *inode, struct file *file)
291 write_lock(&GlobalSMBSeslock); 291 write_lock(&GlobalSMBSeslock);
292 list_add(&pCifsFile->tlist, &pTcon->openFileList); 292 list_add(&pCifsFile->tlist, &pTcon->openFileList);
293 293
294 pCifsInode = CIFS_I(file->f_dentry->d_inode); 294 pCifsInode = CIFS_I(file->f_path.dentry->d_inode);
295 if (pCifsInode) { 295 if (pCifsInode) {
296 rc = cifs_open_inode_helper(inode, file, pCifsInode, 296 rc = cifs_open_inode_helper(inode, file, pCifsInode,
297 pCifsFile, pTcon, 297 pCifsFile, pTcon,
@@ -366,7 +366,7 @@ static int cifs_reopen_file(struct inode *inode, struct file *file,
366 return 0; 366 return 0;
367 } 367 }
368 368
369 if (file->f_dentry == NULL) { 369 if (file->f_path.dentry == NULL) {
370 up(&pCifsFile->fh_sem); 370 up(&pCifsFile->fh_sem);
371 cFYI(1, ("failed file reopen, no valid name if dentry freed")); 371 cFYI(1, ("failed file reopen, no valid name if dentry freed"));
372 FreeXid(xid); 372 FreeXid(xid);
@@ -378,7 +378,7 @@ static int cifs_reopen_file(struct inode *inode, struct file *file,
378 those that already have the rename sem can end up causing writepage 378 those that already have the rename sem can end up causing writepage
379 to get called and if the server was down that means we end up here, 379 to get called and if the server was down that means we end up here,
380 and we can never tell if the caller already has the rename_sem */ 380 and we can never tell if the caller already has the rename_sem */
381 full_path = build_path_from_dentry(file->f_dentry); 381 full_path = build_path_from_dentry(file->f_path.dentry);
382 if (full_path == NULL) { 382 if (full_path == NULL) {
383 up(&pCifsFile->fh_sem); 383 up(&pCifsFile->fh_sem);
384 FreeXid(xid); 384 FreeXid(xid);
@@ -444,7 +444,7 @@ static int cifs_reopen_file(struct inode *inode, struct file *file,
444 pCifsInode->clientCanCacheAll = TRUE; 444 pCifsInode->clientCanCacheAll = TRUE;
445 pCifsInode->clientCanCacheRead = TRUE; 445 pCifsInode->clientCanCacheRead = TRUE;
446 cFYI(1, ("Exclusive Oplock granted on inode %p", 446 cFYI(1, ("Exclusive Oplock granted on inode %p",
447 file->f_dentry->d_inode)); 447 file->f_path.dentry->d_inode));
448 } else if ((oplock & 0xF) == OPLOCK_READ) { 448 } else if ((oplock & 0xF) == OPLOCK_READ) {
449 pCifsInode->clientCanCacheRead = TRUE; 449 pCifsInode->clientCanCacheRead = TRUE;
450 pCifsInode->clientCanCacheAll = FALSE; 450 pCifsInode->clientCanCacheAll = FALSE;
@@ -551,7 +551,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
551 551
552 if (pCFileStruct) { 552 if (pCFileStruct) {
553 struct cifsTconInfo *pTcon; 553 struct cifsTconInfo *pTcon;
554 struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_dentry->d_sb); 554 struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
555 555
556 pTcon = cifs_sb->tcon; 556 pTcon = cifs_sb->tcon;
557 557
@@ -664,7 +664,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
664 } else 664 } else
665 cFYI(1, ("Unknown type of lock")); 665 cFYI(1, ("Unknown type of lock"));
666 666
667 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 667 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
668 pTcon = cifs_sb->tcon; 668 pTcon = cifs_sb->tcon;
669 669
670 if (file->private_data == NULL) { 670 if (file->private_data == NULL) {
@@ -791,10 +791,10 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
791 int xid, long_op; 791 int xid, long_op;
792 struct cifsFileInfo *open_file; 792 struct cifsFileInfo *open_file;
793 793
794 if (file->f_dentry == NULL) 794 if (file->f_path.dentry == NULL)
795 return -EBADF; 795 return -EBADF;
796 796
797 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 797 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
798 if (cifs_sb == NULL) 798 if (cifs_sb == NULL)
799 return -EBADF; 799 return -EBADF;
800 800
@@ -802,7 +802,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
802 802
803 /* cFYI(1, 803 /* cFYI(1,
804 (" write %d bytes to offset %lld of %s", write_size, 804 (" write %d bytes to offset %lld of %s", write_size,
805 *poffset, file->f_dentry->d_name.name)); */ 805 *poffset, file->f_path.dentry->d_name.name)); */
806 806
807 if (file->private_data == NULL) 807 if (file->private_data == NULL)
808 return -EBADF; 808 return -EBADF;
@@ -810,12 +810,12 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
810 open_file = (struct cifsFileInfo *) file->private_data; 810 open_file = (struct cifsFileInfo *) file->private_data;
811 811
812 xid = GetXid(); 812 xid = GetXid();
813 if (file->f_dentry->d_inode == NULL) { 813 if (file->f_path.dentry->d_inode == NULL) {
814 FreeXid(xid); 814 FreeXid(xid);
815 return -EBADF; 815 return -EBADF;
816 } 816 }
817 817
818 if (*poffset > file->f_dentry->d_inode->i_size) 818 if (*poffset > file->f_path.dentry->d_inode->i_size)
819 long_op = 2; /* writes past end of file can take a long time */ 819 long_op = 2; /* writes past end of file can take a long time */
820 else 820 else
821 long_op = 1; 821 long_op = 1;
@@ -840,8 +840,8 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
840 return -EBADF; 840 return -EBADF;
841 } 841 }
842 if (open_file->invalidHandle) { 842 if (open_file->invalidHandle) {
843 if ((file->f_dentry == NULL) || 843 if ((file->f_path.dentry == NULL) ||
844 (file->f_dentry->d_inode == NULL)) { 844 (file->f_path.dentry->d_inode == NULL)) {
845 FreeXid(xid); 845 FreeXid(xid);
846 return total_written; 846 return total_written;
847 } 847 }
@@ -849,7 +849,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
849 filemap_fdatawait from here so tell 849 filemap_fdatawait from here so tell
850 reopen_file not to flush data to server 850 reopen_file not to flush data to server
851 now */ 851 now */
852 rc = cifs_reopen_file(file->f_dentry->d_inode, 852 rc = cifs_reopen_file(file->f_path.dentry->d_inode,
853 file, FALSE); 853 file, FALSE);
854 if (rc != 0) 854 if (rc != 0)
855 break; 855 break;
@@ -878,17 +878,17 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
878 cifs_stats_bytes_written(pTcon, total_written); 878 cifs_stats_bytes_written(pTcon, total_written);
879 879
880 /* since the write may have blocked check these pointers again */ 880 /* since the write may have blocked check these pointers again */
881 if (file->f_dentry) { 881 if (file->f_path.dentry) {
882 if (file->f_dentry->d_inode) { 882 if (file->f_path.dentry->d_inode) {
883 struct inode *inode = file->f_dentry->d_inode; 883 struct inode *inode = file->f_path.dentry->d_inode;
884 inode->i_ctime = inode->i_mtime = 884 inode->i_ctime = inode->i_mtime =
885 current_fs_time(inode->i_sb); 885 current_fs_time(inode->i_sb);
886 if (total_written > 0) { 886 if (total_written > 0) {
887 if (*poffset > file->f_dentry->d_inode->i_size) 887 if (*poffset > file->f_path.dentry->d_inode->i_size)
888 i_size_write(file->f_dentry->d_inode, 888 i_size_write(file->f_path.dentry->d_inode,
889 *poffset); 889 *poffset);
890 } 890 }
891 mark_inode_dirty_sync(file->f_dentry->d_inode); 891 mark_inode_dirty_sync(file->f_path.dentry->d_inode);
892 } 892 }
893 } 893 }
894 FreeXid(xid); 894 FreeXid(xid);
@@ -906,17 +906,17 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
906 int xid, long_op; 906 int xid, long_op;
907 struct cifsFileInfo *open_file; 907 struct cifsFileInfo *open_file;
908 908
909 if (file->f_dentry == NULL) 909 if (file->f_path.dentry == NULL)
910 return -EBADF; 910 return -EBADF;
911 911
912 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 912 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
913 if (cifs_sb == NULL) 913 if (cifs_sb == NULL)
914 return -EBADF; 914 return -EBADF;
915 915
916 pTcon = cifs_sb->tcon; 916 pTcon = cifs_sb->tcon;
917 917
918 cFYI(1,("write %zd bytes to offset %lld of %s", write_size, 918 cFYI(1,("write %zd bytes to offset %lld of %s", write_size,
919 *poffset, file->f_dentry->d_name.name)); 919 *poffset, file->f_path.dentry->d_name.name));
920 920
921 if (file->private_data == NULL) 921 if (file->private_data == NULL)
922 return -EBADF; 922 return -EBADF;
@@ -924,12 +924,12 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
924 open_file = (struct cifsFileInfo *)file->private_data; 924 open_file = (struct cifsFileInfo *)file->private_data;
925 925
926 xid = GetXid(); 926 xid = GetXid();
927 if (file->f_dentry->d_inode == NULL) { 927 if (file->f_path.dentry->d_inode == NULL) {
928 FreeXid(xid); 928 FreeXid(xid);
929 return -EBADF; 929 return -EBADF;
930 } 930 }
931 931
932 if (*poffset > file->f_dentry->d_inode->i_size) 932 if (*poffset > file->f_path.dentry->d_inode->i_size)
933 long_op = 2; /* writes past end of file can take a long time */ 933 long_op = 2; /* writes past end of file can take a long time */
934 else 934 else
935 long_op = 1; 935 long_op = 1;
@@ -955,8 +955,8 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
955 return -EBADF; 955 return -EBADF;
956 } 956 }
957 if (open_file->invalidHandle) { 957 if (open_file->invalidHandle) {
958 if ((file->f_dentry == NULL) || 958 if ((file->f_path.dentry == NULL) ||
959 (file->f_dentry->d_inode == NULL)) { 959 (file->f_path.dentry->d_inode == NULL)) {
960 FreeXid(xid); 960 FreeXid(xid);
961 return total_written; 961 return total_written;
962 } 962 }
@@ -964,7 +964,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
964 filemap_fdatawait from here so tell 964 filemap_fdatawait from here so tell
965 reopen_file not to flush data to 965 reopen_file not to flush data to
966 server now */ 966 server now */
967 rc = cifs_reopen_file(file->f_dentry->d_inode, 967 rc = cifs_reopen_file(file->f_path.dentry->d_inode,
968 file, FALSE); 968 file, FALSE);
969 if (rc != 0) 969 if (rc != 0)
970 break; 970 break;
@@ -1011,16 +1011,16 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
1011 cifs_stats_bytes_written(pTcon, total_written); 1011 cifs_stats_bytes_written(pTcon, total_written);
1012 1012
1013 /* since the write may have blocked check these pointers again */ 1013 /* since the write may have blocked check these pointers again */
1014 if (file->f_dentry) { 1014 if (file->f_path.dentry) {
1015 if (file->f_dentry->d_inode) { 1015 if (file->f_path.dentry->d_inode) {
1016 file->f_dentry->d_inode->i_ctime = 1016 file->f_path.dentry->d_inode->i_ctime =
1017 file->f_dentry->d_inode->i_mtime = CURRENT_TIME; 1017 file->f_path.dentry->d_inode->i_mtime = CURRENT_TIME;
1018 if (total_written > 0) { 1018 if (total_written > 0) {
1019 if (*poffset > file->f_dentry->d_inode->i_size) 1019 if (*poffset > file->f_path.dentry->d_inode->i_size)
1020 i_size_write(file->f_dentry->d_inode, 1020 i_size_write(file->f_path.dentry->d_inode,
1021 *poffset); 1021 *poffset);
1022 } 1022 }
1023 mark_inode_dirty_sync(file->f_dentry->d_inode); 1023 mark_inode_dirty_sync(file->f_path.dentry->d_inode);
1024 } 1024 }
1025 } 1025 }
1026 FreeXid(xid); 1026 FreeXid(xid);
@@ -1384,7 +1384,7 @@ static int cifs_commit_write(struct file *file, struct page *page,
1384 if ((open_file->invalidHandle) && 1384 if ((open_file->invalidHandle) &&
1385 (!open_file->closePend)) { 1385 (!open_file->closePend)) {
1386 rc = cifs_reopen_file( 1386 rc = cifs_reopen_file(
1387 file->f_dentry->d_inode, file); 1387 file->f_path.dentry->d_inode, file);
1388 if (rc != 0) 1388 if (rc != 0)
1389 break; 1389 break;
1390 } 1390 }
@@ -1434,7 +1434,7 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
1434{ 1434{
1435 int xid; 1435 int xid;
1436 int rc = 0; 1436 int rc = 0;
1437 struct inode *inode = file->f_dentry->d_inode; 1437 struct inode *inode = file->f_path.dentry->d_inode;
1438 1438
1439 xid = GetXid(); 1439 xid = GetXid();
1440 1440
@@ -1482,7 +1482,7 @@ int cifs_fsync(struct file *file, struct dentry *dentry, int datasync)
1482 */ 1482 */
1483int cifs_flush(struct file *file, fl_owner_t id) 1483int cifs_flush(struct file *file, fl_owner_t id)
1484{ 1484{
1485 struct inode * inode = file->f_dentry->d_inode; 1485 struct inode * inode = file->f_path.dentry->d_inode;
1486 int rc = 0; 1486 int rc = 0;
1487 1487
1488 /* Rather than do the steps manually: 1488 /* Rather than do the steps manually:
@@ -1519,7 +1519,7 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
1519 struct smb_com_read_rsp *pSMBr; 1519 struct smb_com_read_rsp *pSMBr;
1520 1520
1521 xid = GetXid(); 1521 xid = GetXid();
1522 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 1522 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
1523 pTcon = cifs_sb->tcon; 1523 pTcon = cifs_sb->tcon;
1524 1524
1525 if (file->private_data == NULL) { 1525 if (file->private_data == NULL) {
@@ -1542,7 +1542,7 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
1542 int buf_type = CIFS_NO_BUFFER; 1542 int buf_type = CIFS_NO_BUFFER;
1543 if ((open_file->invalidHandle) && 1543 if ((open_file->invalidHandle) &&
1544 (!open_file->closePend)) { 1544 (!open_file->closePend)) {
1545 rc = cifs_reopen_file(file->f_dentry->d_inode, 1545 rc = cifs_reopen_file(file->f_path.dentry->d_inode,
1546 file, TRUE); 1546 file, TRUE);
1547 if (rc != 0) 1547 if (rc != 0)
1548 break; 1548 break;
@@ -1601,7 +1601,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
1601 int buf_type = CIFS_NO_BUFFER; 1601 int buf_type = CIFS_NO_BUFFER;
1602 1602
1603 xid = GetXid(); 1603 xid = GetXid();
1604 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 1604 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
1605 pTcon = cifs_sb->tcon; 1605 pTcon = cifs_sb->tcon;
1606 1606
1607 if (file->private_data == NULL) { 1607 if (file->private_data == NULL) {
@@ -1629,7 +1629,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
1629 while (rc == -EAGAIN) { 1629 while (rc == -EAGAIN) {
1630 if ((open_file->invalidHandle) && 1630 if ((open_file->invalidHandle) &&
1631 (!open_file->closePend)) { 1631 (!open_file->closePend)) {
1632 rc = cifs_reopen_file(file->f_dentry->d_inode, 1632 rc = cifs_reopen_file(file->f_path.dentry->d_inode,
1633 file, TRUE); 1633 file, TRUE);
1634 if (rc != 0) 1634 if (rc != 0)
1635 break; 1635 break;
@@ -1658,7 +1658,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
1658 1658
1659int cifs_file_mmap(struct file *file, struct vm_area_struct *vma) 1659int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
1660{ 1660{
1661 struct dentry *dentry = file->f_dentry; 1661 struct dentry *dentry = file->f_path.dentry;
1662 int rc, xid; 1662 int rc, xid;
1663 1663
1664 xid = GetXid(); 1664 xid = GetXid();
@@ -1744,7 +1744,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
1744 return -EBADF; 1744 return -EBADF;
1745 } 1745 }
1746 open_file = (struct cifsFileInfo *)file->private_data; 1746 open_file = (struct cifsFileInfo *)file->private_data;
1747 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 1747 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
1748 pTcon = cifs_sb->tcon; 1748 pTcon = cifs_sb->tcon;
1749 1749
1750 pagevec_init(&lru_pvec, 0); 1750 pagevec_init(&lru_pvec, 0);
@@ -1786,7 +1786,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
1786 while (rc == -EAGAIN) { 1786 while (rc == -EAGAIN) {
1787 if ((open_file->invalidHandle) && 1787 if ((open_file->invalidHandle) &&
1788 (!open_file->closePend)) { 1788 (!open_file->closePend)) {
1789 rc = cifs_reopen_file(file->f_dentry->d_inode, 1789 rc = cifs_reopen_file(file->f_path.dentry->d_inode,
1790 file, TRUE); 1790 file, TRUE);
1791 if (rc != 0) 1791 if (rc != 0)
1792 break; 1792 break;
@@ -1880,8 +1880,8 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
1880 else 1880 else
1881 cFYI(1, ("Bytes read %d",rc)); 1881 cFYI(1, ("Bytes read %d",rc));
1882 1882
1883 file->f_dentry->d_inode->i_atime = 1883 file->f_path.dentry->d_inode->i_atime =
1884 current_fs_time(file->f_dentry->d_inode->i_sb); 1884 current_fs_time(file->f_path.dentry->d_inode->i_sb);
1885 1885
1886 if (PAGE_CACHE_SIZE > rc) 1886 if (PAGE_CACHE_SIZE > rc)
1887 memset(read_data + rc, 0, PAGE_CACHE_SIZE - rc); 1887 memset(read_data + rc, 0, PAGE_CACHE_SIZE - rc);
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index ed18c3965f7b..99dfb5337e31 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -68,30 +68,30 @@ static int construct_dentry(struct qstr *qstring, struct file *file,
68 int rc = 0; 68 int rc = 0;
69 69
70 cFYI(1, ("For %s", qstring->name)); 70 cFYI(1, ("For %s", qstring->name));
71 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 71 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
72 pTcon = cifs_sb->tcon; 72 pTcon = cifs_sb->tcon;
73 73
74 qstring->hash = full_name_hash(qstring->name, qstring->len); 74 qstring->hash = full_name_hash(qstring->name, qstring->len);
75 tmp_dentry = d_lookup(file->f_dentry, qstring); 75 tmp_dentry = d_lookup(file->f_path.dentry, qstring);
76 if (tmp_dentry) { 76 if (tmp_dentry) {
77 cFYI(0, ("existing dentry with inode 0x%p", tmp_dentry->d_inode)); 77 cFYI(0, ("existing dentry with inode 0x%p", tmp_dentry->d_inode));
78 *ptmp_inode = tmp_dentry->d_inode; 78 *ptmp_inode = tmp_dentry->d_inode;
79/* BB overwrite old name? i.e. tmp_dentry->d_name and tmp_dentry->d_name.len??*/ 79/* BB overwrite old name? i.e. tmp_dentry->d_name and tmp_dentry->d_name.len??*/
80 if(*ptmp_inode == NULL) { 80 if(*ptmp_inode == NULL) {
81 *ptmp_inode = new_inode(file->f_dentry->d_sb); 81 *ptmp_inode = new_inode(file->f_path.dentry->d_sb);
82 if(*ptmp_inode == NULL) 82 if(*ptmp_inode == NULL)
83 return rc; 83 return rc;
84 rc = 1; 84 rc = 1;
85 } 85 }
86 } else { 86 } else {
87 tmp_dentry = d_alloc(file->f_dentry, qstring); 87 tmp_dentry = d_alloc(file->f_path.dentry, qstring);
88 if(tmp_dentry == NULL) { 88 if(tmp_dentry == NULL) {
89 cERROR(1,("Failed allocating dentry")); 89 cERROR(1,("Failed allocating dentry"));
90 *ptmp_inode = NULL; 90 *ptmp_inode = NULL;
91 return rc; 91 return rc;
92 } 92 }
93 93
94 *ptmp_inode = new_inode(file->f_dentry->d_sb); 94 *ptmp_inode = new_inode(file->f_path.dentry->d_sb);
95 if (pTcon->nocase) 95 if (pTcon->nocase)
96 tmp_dentry->d_op = &cifs_ci_dentry_ops; 96 tmp_dentry->d_op = &cifs_ci_dentry_ops;
97 else 97 else
@@ -432,10 +432,10 @@ static int initiate_cifs_search(const int xid, struct file *file)
432 cifsFile->invalidHandle = TRUE; 432 cifsFile->invalidHandle = TRUE;
433 cifsFile->srch_inf.endOfSearch = FALSE; 433 cifsFile->srch_inf.endOfSearch = FALSE;
434 434
435 if(file->f_dentry == NULL) 435 if(file->f_path.dentry == NULL)
436 return -ENOENT; 436 return -ENOENT;
437 437
438 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 438 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
439 if(cifs_sb == NULL) 439 if(cifs_sb == NULL)
440 return -EINVAL; 440 return -EINVAL;
441 441
@@ -443,7 +443,7 @@ static int initiate_cifs_search(const int xid, struct file *file)
443 if(pTcon == NULL) 443 if(pTcon == NULL)
444 return -EINVAL; 444 return -EINVAL;
445 445
446 full_path = build_path_from_dentry(file->f_dentry); 446 full_path = build_path_from_dentry(file->f_path.dentry);
447 447
448 if(full_path == NULL) { 448 if(full_path == NULL) {
449 return -ENOMEM; 449 return -ENOMEM;
@@ -609,10 +609,10 @@ static int is_dir_changed(struct file * file)
609 struct inode * inode; 609 struct inode * inode;
610 struct cifsInodeInfo *cifsInfo; 610 struct cifsInodeInfo *cifsInfo;
611 611
612 if(file->f_dentry == NULL) 612 if(file->f_path.dentry == NULL)
613 return 0; 613 return 0;
614 614
615 inode = file->f_dentry->d_inode; 615 inode = file->f_path.dentry->d_inode;
616 616
617 if(inode == NULL) 617 if(inode == NULL)
618 return 0; 618 return 0;
@@ -839,7 +839,7 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
839 if((scratch_buf == NULL) || (pfindEntry == NULL) || (pCifsF == NULL)) 839 if((scratch_buf == NULL) || (pfindEntry == NULL) || (pCifsF == NULL))
840 return -ENOENT; 840 return -ENOENT;
841 841
842 if(file->f_dentry == NULL) 842 if(file->f_path.dentry == NULL)
843 return -ENOENT; 843 return -ENOENT;
844 844
845 rc = cifs_entry_is_dot(pfindEntry,pCifsF); 845 rc = cifs_entry_is_dot(pfindEntry,pCifsF);
@@ -847,7 +847,7 @@ static int cifs_filldir(char *pfindEntry, struct file *file,
847 if(rc != 0) 847 if(rc != 0)
848 return 0; 848 return 0;
849 849
850 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 850 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
851 851
852 qstring.name = scratch_buf; 852 qstring.name = scratch_buf;
853 rc = cifs_get_name_from_search_buf(&qstring,pfindEntry, 853 rc = cifs_get_name_from_search_buf(&qstring,pfindEntry,
@@ -985,12 +985,12 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
985 985
986 xid = GetXid(); 986 xid = GetXid();
987 987
988 if(file->f_dentry == NULL) { 988 if(file->f_path.dentry == NULL) {
989 FreeXid(xid); 989 FreeXid(xid);
990 return -EIO; 990 return -EIO;
991 } 991 }
992 992
993 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 993 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
994 pTcon = cifs_sb->tcon; 994 pTcon = cifs_sb->tcon;
995 if(pTcon == NULL) 995 if(pTcon == NULL)
996 return -EINVAL; 996 return -EINVAL;
@@ -998,7 +998,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
998 switch ((int) file->f_pos) { 998 switch ((int) file->f_pos) {
999 case 0: 999 case 0:
1000 if (filldir(direntry, ".", 1, file->f_pos, 1000 if (filldir(direntry, ".", 1, file->f_pos,
1001 file->f_dentry->d_inode->i_ino, DT_DIR) < 0) { 1001 file->f_path.dentry->d_inode->i_ino, DT_DIR) < 0) {
1002 cERROR(1, ("Filldir for current dir failed")); 1002 cERROR(1, ("Filldir for current dir failed"));
1003 rc = -ENOMEM; 1003 rc = -ENOMEM;
1004 break; 1004 break;
@@ -1006,7 +1006,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
1006 file->f_pos++; 1006 file->f_pos++;
1007 case 1: 1007 case 1:
1008 if (filldir(direntry, "..", 2, file->f_pos, 1008 if (filldir(direntry, "..", 2, file->f_pos,
1009 file->f_dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) { 1009 file->f_path.dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) {
1010 cERROR(1, ("Filldir for parent dir failed")); 1010 cERROR(1, ("Filldir for parent dir failed"));
1011 rc = -ENOMEM; 1011 rc = -ENOMEM;
1012 break; 1012 break;