@@ -42,6 +42,7 @@
#include "cifsproto.h"
#include "cifs_debug.h"
#include "cifs_fs_sb.h"
+#include "cifs_lock_storage.h"
#include <linux/mm.h>
#include <linux/key-type.h>
#include "dns_resolve.h"
@@ -1049,6 +1050,7 @@ init_cifs(void)
memset(Local_System_Name, 0, 15);
rwlock_init(&GlobalSMBSeslock);
spin_lock_init(&GlobalMid_Lock);
+ cifs_lock_storage_init();
if (cifs_max_pending < 2) {
cifs_max_pending = 2;
@@ -38,6 +38,7 @@
#include "cifs_unicode.h"
#include "cifs_debug.h"
#include "cifs_fs_sb.h"
+#include "cifs_lock_storage.h"
static inline struct cifsFileInfo *cifs_init_private(
struct cifsFileInfo *private_data, struct inode *inode,
@@ -486,8 +487,6 @@ int cifs_close(struct inode *inode, struct file *file)
cifs_sb = CIFS_SB(inode->i_sb);
pTcon = cifs_sb->tcon;
if (pSMBFile) {
- struct cifsLockInfo *li, *tmp;
-
pSMBFile->closePend = true;
if (pTcon) {
/* no sense reconnecting to close a file that is
@@ -516,15 +515,6 @@ int cifs_close(struct inode *inode, struct file *file)
}
}
- /* Delete any outstanding lock records.
- We'll lose them when the file is closed anyway. */
- mutex_lock(&pSMBFile->lock_mutex);
- list_for_each_entry_safe(li, tmp, &pSMBFile->llist, llist) {
- list_del(&li->llist);
- kfree(li);
- }
- mutex_unlock(&pSMBFile->lock_mutex);
-
write_lock(&GlobalSMBSeslock);
list_del(&pSMBFile->flist);
list_del(&pSMBFile->tlist);
@@ -612,22 +602,6 @@ int cifs_closedir(struct inode *inode, struct file
*file)
return rc;
}
-static int store_file_lock(struct cifsFileInfo *fid, __u64 len,
- __u64 offset, __u8 lockType)
-{
- struct cifsLockInfo *li =
- kmalloc(sizeof(struct cifsLockInfo), GFP_KERNEL);
- if (li == NULL)
- return -ENOMEM;
- li->offset = offset;
- li->length = len;
- li->type = lockType;
- mutex_lock(&fid->lock_mutex);
- list_add(&li->llist, &fid->llist);
- mutex_unlock(&fid->lock_mutex);
- return 0;
-}
-
int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
{