[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>
This commit is contained in:
parent
a6ce4932fb
commit
bc8cd4390c
2 changed files with 18 additions and 12 deletions
|
@ -162,18 +162,16 @@ cifs_fill_fileinfo(struct inode *newinode, __u16 fileHandle,
|
||||||
pCifsInode = CIFS_I(newinode);
|
pCifsInode = CIFS_I(newinode);
|
||||||
if (pCifsInode) {
|
if (pCifsInode) {
|
||||||
/* if readable file instance put first in list*/
|
/* if readable file instance put first in list*/
|
||||||
if (write_only) {
|
if (write_only)
|
||||||
list_add_tail(&pCifsFile->flist,
|
list_add_tail(&pCifsFile->flist,
|
||||||
&pCifsInode->openFileList);
|
&pCifsInode->openFileList);
|
||||||
} else {
|
else
|
||||||
list_add(&pCifsFile->flist,
|
list_add(&pCifsFile->flist, &pCifsInode->openFileList);
|
||||||
&pCifsInode->openFileList);
|
|
||||||
}
|
|
||||||
if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
|
if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
|
||||||
pCifsInode->clientCanCacheAll = true;
|
pCifsInode->clientCanCacheAll = true;
|
||||||
pCifsInode->clientCanCacheRead = true;
|
pCifsInode->clientCanCacheRead = true;
|
||||||
cFYI(1, ("Exclusive Oplock inode %p",
|
cFYI(1, ("Exclusive Oplock inode %p", newinode));
|
||||||
newinode));
|
|
||||||
} else if ((oplock & 0xF) == OPLOCK_READ)
|
} else if ((oplock & 0xF) == OPLOCK_READ)
|
||||||
pCifsInode->clientCanCacheRead = true;
|
pCifsInode->clientCanCacheRead = true;
|
||||||
}
|
}
|
||||||
|
@ -668,6 +666,16 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
|
||||||
parent_dir_inode->i_sb, mode,
|
parent_dir_inode->i_sb, mode,
|
||||||
nd->intent.open.flags, &oplock,
|
nd->intent.open.flags, &oplock,
|
||||||
&fileHandle, xid);
|
&fileHandle, xid);
|
||||||
|
/*
|
||||||
|
* This code works around a bug in
|
||||||
|
* samba posix open in samba versions 3.3.1
|
||||||
|
* and earlier where create works
|
||||||
|
* but open fails with invalid parameter.
|
||||||
|
* If either of these error codes are
|
||||||
|
* returned, follow the normal lookup.
|
||||||
|
* Otherwise, the error during posix open
|
||||||
|
* is handled.
|
||||||
|
*/
|
||||||
if ((rc != -EINVAL) && (rc != -EOPNOTSUPP))
|
if ((rc != -EINVAL) && (rc != -EOPNOTSUPP))
|
||||||
posix_open = true;
|
posix_open = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -307,11 +307,9 @@ int cifs_open(struct inode *inode, struct file *file)
|
||||||
rc = 0;
|
rc = 0;
|
||||||
FreeXid(xid);
|
FreeXid(xid);
|
||||||
return rc;
|
return rc;
|
||||||
} else {
|
} else if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL))
|
||||||
if ((file->f_flags & O_CREAT) && (file->f_flags & O_EXCL))
|
|
||||||
cERROR(1, ("could not find file instance for "
|
cERROR(1, ("could not find file instance for "
|
||||||
"new file %p", file));
|
"new file %p", file));
|
||||||
}
|
|
||||||
|
|
||||||
full_path = build_path_from_dentry(file->f_path.dentry);
|
full_path = build_path_from_dentry(file->f_path.dentry);
|
||||||
if (full_path == NULL) {
|
if (full_path == NULL) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue