Skip to content

Commit

Permalink
cifs: use type __u32 instead of int for the oplock parameter
Browse files Browse the repository at this point in the history
... and avoid implicit casting from a signed type. Also, pass oplock by value
instead by reference as we don't intend to change the value in
cifs_open_inode_helper().

Thanks to Jeff Layton for spotting this.

Reviewed-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
  • Loading branch information
Suresh Jayaraman authored and Steve French committed Sep 29, 2010
1 parent 899611e commit a347ecb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ cifs_posix_open_inode_helper(struct inode *inode, struct file *file,

/* all arguments to this function must be checked for validity in caller */
static inline int cifs_open_inode_helper(struct inode *inode,
struct cifsTconInfo *pTcon, int *oplock, FILE_ALL_INFO *buf,
struct cifsTconInfo *pTcon, __u32 oplock, FILE_ALL_INFO *buf,
char *full_path, int xid)
{
struct cifsInodeInfo *pCifsInode = CIFS_I(inode);
Expand Down Expand Up @@ -207,11 +207,11 @@ static inline int cifs_open_inode_helper(struct inode *inode,
rc = cifs_get_inode_info(&inode, full_path, buf, inode->i_sb,
xid, NULL);

if ((*oplock & 0xF) == OPLOCK_EXCLUSIVE) {
if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
pCifsInode->clientCanCacheAll = true;
pCifsInode->clientCanCacheRead = true;
cFYI(1, "Exclusive Oplock granted on inode %p", inode);
} else if ((*oplock & 0xF) == OPLOCK_READ)
} else if ((oplock & 0xF) == OPLOCK_READ)
pCifsInode->clientCanCacheRead = true;

return rc;
Expand Down Expand Up @@ -365,7 +365,7 @@ int cifs_open(struct inode *inode, struct file *file)
goto out;
}

rc = cifs_open_inode_helper(inode, tcon, &oplock, buf, full_path, xid);
rc = cifs_open_inode_helper(inode, tcon, oplock, buf, full_path, xid);
if (rc != 0)
goto out;

Expand Down

0 comments on commit a347ecb

Please sign in to comment.