[CIFS] Remove calls to to take f_owner.lock
CIFS takes/releases f_owner.lock - why? It does not change anything in the fowner state. Remove this locking. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Steve French <sfrench@us.ibm.com>
This commit is contained in:
parent
cd49b492fe
commit
124a27fe32
@ -110,7 +110,6 @@ static inline int cifs_open_inode_helper(struct inode *inode, struct file *file,
|
|||||||
&pCifsInode->openFileList);
|
&pCifsInode->openFileList);
|
||||||
}
|
}
|
||||||
write_unlock(&GlobalSMBSeslock);
|
write_unlock(&GlobalSMBSeslock);
|
||||||
write_unlock(&file->f_owner.lock);
|
|
||||||
if (pCifsInode->clientCanCacheRead) {
|
if (pCifsInode->clientCanCacheRead) {
|
||||||
/* we have the inode open somewhere else
|
/* we have the inode open somewhere else
|
||||||
no need to discard cache data */
|
no need to discard cache data */
|
||||||
@ -287,7 +286,6 @@ int cifs_open(struct inode *inode, struct file *file)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
pCifsFile = cifs_init_private(file->private_data, inode, file, netfid);
|
pCifsFile = cifs_init_private(file->private_data, inode, file, netfid);
|
||||||
write_lock(&file->f_owner.lock);
|
|
||||||
write_lock(&GlobalSMBSeslock);
|
write_lock(&GlobalSMBSeslock);
|
||||||
list_add(&pCifsFile->tlist, &pTcon->openFileList);
|
list_add(&pCifsFile->tlist, &pTcon->openFileList);
|
||||||
|
|
||||||
@ -298,7 +296,6 @@ int cifs_open(struct inode *inode, struct file *file)
|
|||||||
&oplock, buf, full_path, xid);
|
&oplock, buf, full_path, xid);
|
||||||
} else {
|
} else {
|
||||||
write_unlock(&GlobalSMBSeslock);
|
write_unlock(&GlobalSMBSeslock);
|
||||||
write_unlock(&file->f_owner.lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oplock & CIFS_CREATE_ACTION) {
|
if (oplock & CIFS_CREATE_ACTION) {
|
||||||
@ -477,7 +474,6 @@ int cifs_close(struct inode *inode, struct file *file)
|
|||||||
pTcon = cifs_sb->tcon;
|
pTcon = cifs_sb->tcon;
|
||||||
if (pSMBFile) {
|
if (pSMBFile) {
|
||||||
pSMBFile->closePend = TRUE;
|
pSMBFile->closePend = TRUE;
|
||||||
write_lock(&file->f_owner.lock);
|
|
||||||
if (pTcon) {
|
if (pTcon) {
|
||||||
/* no sense reconnecting to close a file that is
|
/* no sense reconnecting to close a file that is
|
||||||
already closed */
|
already closed */
|
||||||
@ -492,23 +488,18 @@ int cifs_close(struct inode *inode, struct file *file)
|
|||||||
the struct would be in each open file,
|
the struct would be in each open file,
|
||||||
but this should give enough time to
|
but this should give enough time to
|
||||||
clear the socket */
|
clear the socket */
|
||||||
write_unlock(&file->f_owner.lock);
|
|
||||||
cERROR(1,("close with pending writes"));
|
cERROR(1,("close with pending writes"));
|
||||||
msleep(timeout);
|
msleep(timeout);
|
||||||
write_lock(&file->f_owner.lock);
|
|
||||||
timeout *= 4;
|
timeout *= 4;
|
||||||
}
|
}
|
||||||
write_unlock(&file->f_owner.lock);
|
|
||||||
rc = CIFSSMBClose(xid, pTcon,
|
rc = CIFSSMBClose(xid, pTcon,
|
||||||
pSMBFile->netfid);
|
pSMBFile->netfid);
|
||||||
write_lock(&file->f_owner.lock);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
write_lock(&GlobalSMBSeslock);
|
write_lock(&GlobalSMBSeslock);
|
||||||
list_del(&pSMBFile->flist);
|
list_del(&pSMBFile->flist);
|
||||||
list_del(&pSMBFile->tlist);
|
list_del(&pSMBFile->tlist);
|
||||||
write_unlock(&GlobalSMBSeslock);
|
write_unlock(&GlobalSMBSeslock);
|
||||||
write_unlock(&file->f_owner.lock);
|
|
||||||
kfree(pSMBFile->search_resume_name);
|
kfree(pSMBFile->search_resume_name);
|
||||||
kfree(file->private_data);
|
kfree(file->private_data);
|
||||||
file->private_data = NULL;
|
file->private_data = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user