aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 378acdafa356..9f41a10523a1 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -314,6 +314,8 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
314 } 314 }
315 spin_unlock(&cifs_file_list_lock); 315 spin_unlock(&cifs_file_list_lock);
316 316
317 cancel_work_sync(&cifs_file->oplock_break);
318
317 if (!tcon->need_reconnect && !cifs_file->invalidHandle) { 319 if (!tcon->need_reconnect && !cifs_file->invalidHandle) {
318 int xid, rc; 320 int xid, rc;
319 321
@@ -2418,31 +2420,6 @@ void cifs_oplock_break(struct work_struct *work)
2418 cinode->clientCanCacheRead ? 1 : 0); 2420 cinode->clientCanCacheRead ? 1 : 0);
2419 cFYI(1, "Oplock release rc = %d", rc); 2421 cFYI(1, "Oplock release rc = %d", rc);
2420 } 2422 }
2421
2422 /*
2423 * We might have kicked in before is_valid_oplock_break()
2424 * finished grabbing reference for us. Make sure it's done by
2425 * waiting for cifs_file_list_lock.
2426 */
2427 spin_lock(&cifs_file_list_lock);
2428 spin_unlock(&cifs_file_list_lock);
2429
2430 cifs_oplock_break_put(cfile);
2431}
2432
2433/* must be called while holding cifs_file_list_lock */
2434void cifs_oplock_break_get(struct cifsFileInfo *cfile)
2435{
2436 cifs_sb_active(cfile->dentry->d_sb);
2437 cifsFileInfo_get(cfile);
2438}
2439
2440void cifs_oplock_break_put(struct cifsFileInfo *cfile)
2441{
2442 struct super_block *sb = cfile->dentry->d_sb;
2443
2444 cifsFileInfo_put(cfile);
2445 cifs_sb_deactive(sb);
2446} 2423}
2447 2424
2448const struct address_space_operations cifs_addr_ops = { 2425const struct address_space_operations cifs_addr_ops = {