aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2009-04-12 14:18:40 -0400
committerSteve French <sfrench@us.ibm.com>2009-04-16 21:26:49 -0400
commitbc8cd4390c9129fbd286b10fa99972dfb68cd069 (patch)
tree1092fce44f8b785eb7be1b59d9c6215aa56d44c1 /fs
parenta6ce4932fbdbcd8f8e8c6df76812014351c32892 (diff)
[CIFS] Fix sparse warnings
Signed-off-by: Shirish Pargaonkar <shirishp@us.ibm.com> CC: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/dir.c26
-rw-r--r--fs/cifs/file.c4
2 files changed, 18 insertions, 12 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index d9006b04324e..e937da7522ef 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -149,7 +149,7 @@ cifs_fill_fileinfo(struct inode *newinode, __u16 fileHandle,
149 pCifsFile->pid = current->tgid; 149 pCifsFile->pid = current->tgid;
150 pCifsFile->pInode = newinode; 150 pCifsFile->pInode = newinode;
151 pCifsFile->invalidHandle = false; 151 pCifsFile->invalidHandle = false;
152 pCifsFile->closePend = false; 152 pCifsFile->closePend = false;
153 mutex_init(&pCifsFile->fh_mutex); 153 mutex_init(&pCifsFile->fh_mutex);
154 mutex_init(&pCifsFile->lock_mutex); 154 mutex_init(&pCifsFile->lock_mutex);
155 INIT_LIST_HEAD(&pCifsFile->llist); 155 INIT_LIST_HEAD(&pCifsFile->llist);
@@ -162,20 +162,18 @@ cifs_fill_fileinfo(struct inode *newinode, __u16 fileHandle,
162 pCifsInode = CIFS_I(newinode); 162 pCifsInode = CIFS_I(newinode);
163 if (pCifsInode) { 163 if (pCifsInode) {
164 /* if readable file instance put first in list*/ 164 /* if readable file instance put first in list*/
165 if (write_only) { 165 if (write_only)
166 list_add_tail(&pCifsFile->flist, 166 list_add_tail(&pCifsFile->flist,
167 &pCifsInode->openFileList); 167 &pCifsInode->openFileList);
168 } else { 168 else
169 list_add(&pCifsFile->flist, 169 list_add(&pCifsFile->flist, &pCifsInode->openFileList);
170 &pCifsInode->openFileList); 170
171 }
172 if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { 171 if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
173 pCifsInode->clientCanCacheAll = true; 172 pCifsInode->clientCanCacheAll = true;
174 pCifsInode->clientCanCacheRead = true; 173 pCifsInode->clientCanCacheRead = true;
175 cFYI(1, ("Exclusive Oplock inode %p", 174 cFYI(1, ("Exclusive Oplock inode %p", newinode));
176 newinode));
177 } else if ((oplock & 0xF) == OPLOCK_READ) 175 } else if ((oplock & 0xF) == OPLOCK_READ)
178 pCifsInode->clientCanCacheRead = true; 176 pCifsInode->clientCanCacheRead = true;
179 } 177 }
180 write_unlock(&GlobalSMBSeslock); 178 write_unlock(&GlobalSMBSeslock);
181} 179}
@@ -668,6 +666,16 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
668 parent_dir_inode->i_sb, mode, 666 parent_dir_inode->i_sb, mode,
669 nd->intent.open.flags, &oplock, 667 nd->intent.open.flags, &oplock,
670 &fileHandle, xid); 668 &fileHandle, xid);
669 /*
670 * This code works around a bug in
671 * samba posix open in samba versions 3.3.1
672 * and earlier where create works
673 * but open fails with invalid parameter.
674 * If either of these error codes are
675 * returned, follow the normal lookup.
676 * Otherwise, the error during posix open
677 * is handled.
678 */
671 if ((rc != -EINVAL) && (rc != -EOPNOTSUPP)) 679 if ((rc != -EINVAL) && (rc != -EOPNOTSUPP))
672 posix_open = true; 680 posix_open = true;
673 } 681 }
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 48c9ae09f3d6..50ca088d8860 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -307,11 +307,9 @@ int cifs_open(struct inode *inode, struct file *file)
307 rc = 0; 307 rc = 0;
308 FreeXid(xid); 308 FreeXid(xid);
309 return rc; 309 return rc;
310 } else { 310 } else if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL))
311 if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL))
312 cERROR(1, ("could not find file instance for " 311 cERROR(1, ("could not find file instance for "
313 "new file %p", file)); 312 "new file %p", file));
314 }
315 313
316 full_path = build_path_from_dentry(file->f_path.dentry); 314 full_path = build_path_from_dentry(file->f_path.dentry);
317 if (full_path == NULL) { 315 if (full_path == NULL) {