diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index fd78a355f634..c10f0851cd21 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -106,64 +106,6 @@ static inline int cifs_get_disposition(unsigned int flags) | |||
106 | return FILE_OPEN; | 106 | return FILE_OPEN; |
107 | } | 107 | } |
108 | 108 | ||
109 | /* all arguments to this function must be checked for validity in caller */ | ||
110 | static inline int | ||
111 | cifs_posix_open_inode_helper(struct inode *inode, struct file *file, | ||
112 | struct cifsInodeInfo *pCifsInode, __u32 oplock, | ||
113 | u16 netfid) | ||
114 | { | ||
115 | |||
116 | write_lock(&GlobalSMBSeslock); | ||
117 | |||
118 | pCifsInode = CIFS_I(file->f_path.dentry->d_inode); | ||
119 | if (pCifsInode == NULL) { | ||
120 | write_unlock(&GlobalSMBSeslock); | ||
121 | return -EINVAL; | ||
122 | } | ||
123 | |||
124 | if (pCifsInode->clientCanCacheRead) { | ||
125 | /* we have the inode open somewhere else | ||
126 | no need to discard cache data */ | ||
127 | goto psx_client_can_cache; | ||
128 | } | ||
129 | |||
130 | /* BB FIXME need to fix this check to move it earlier into posix_open | ||
131 | BB fIX following section BB FIXME */ | ||
132 | |||
133 | /* if not oplocked, invalidate inode pages if mtime or file | ||
134 | size changed */ | ||
135 | /* temp = cifs_NTtimeToUnix(le64_to_cpu(buf->LastWriteTime)); | ||
136 | if (timespec_equal(&file->f_path.dentry->d_inode->i_mtime, &temp) && | ||
137 | (file->f_path.dentry->d_inode->i_size == | ||
138 | (loff_t)le64_to_cpu(buf->EndOfFile))) { | ||
139 | cFYI(1, "inode unchanged on server"); | ||
140 | } else { | ||
141 | if (file->f_path.dentry->d_inode->i_mapping) { | ||
142 | rc = filemap_write_and_wait(file->f_path.dentry->d_inode->i_mapping); | ||
143 | if (rc != 0) | ||
144 | CIFS_I(file->f_path.dentry->d_inode)->write_behind_rc = rc; | ||
145 | } | ||
146 | cFYI(1, "invalidating remote inode since open detected it " | ||
147 | "changed"); | ||
148 | invalidate_remote_inode(file->f_path.dentry->d_inode); | ||
149 | } */ | ||
150 | |||
151 | psx_client_can_cache: | ||
152 | if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { | ||
153 | pCifsInode->clientCanCacheAll = true; | ||
154 | pCifsInode->clientCanCacheRead = true; | ||
155 | cFYI(1, "Exclusive Oplock granted on inode %p", | ||
156 | file->f_path.dentry->d_inode); | ||
157 | } else if ((oplock & 0xF) == OPLOCK_READ) | ||
158 | pCifsInode->clientCanCacheRead = true; | ||
159 | |||
160 | /* will have to change the unlock if we reenable the | ||
161 | filemap_fdatawrite (which does not seem necessary */ | ||
162 | write_unlock(&GlobalSMBSeslock); | ||
163 | return 0; | ||
164 | } | ||
165 | |||
166 | /* all arguments to this function must be checked for validity in caller */ | ||
167 | static inline int cifs_open_inode_helper(struct inode *inode, | 109 | static inline int cifs_open_inode_helper(struct inode *inode, |
168 | struct cifsTconInfo *pTcon, __u32 oplock, FILE_ALL_INFO *buf, | 110 | struct cifsTconInfo *pTcon, __u32 oplock, FILE_ALL_INFO *buf, |
169 | char *full_path, int xid) | 111 | char *full_path, int xid) |
@@ -271,15 +213,6 @@ int cifs_open(struct inode *inode, struct file *file) | |||
271 | oflags, &oplock, &netfid, xid); | 213 | oflags, &oplock, &netfid, xid); |
272 | if (rc == 0) { | 214 | if (rc == 0) { |
273 | cFYI(1, "posix open succeeded"); | 215 | cFYI(1, "posix open succeeded"); |
274 | /* no need for special case handling of setting mode | ||
275 | on read only files needed here */ | ||
276 | |||
277 | rc = cifs_posix_open_inode_helper(inode, file, | ||
278 | pCifsInode, oplock, netfid); | ||
279 | if (rc != 0) { | ||
280 | CIFSSMBClose(xid, tcon, netfid); | ||
281 | goto out; | ||
282 | } | ||
283 | 216 | ||
284 | pCifsFile = cifs_new_fileinfo(inode, netfid, file, | 217 | pCifsFile = cifs_new_fileinfo(inode, netfid, file, |
285 | tlink, oflags, oplock); | 218 | tlink, oflags, oplock); |