summaryrefslogtreecommitdiff
path: root/fs/cifs/inode.c
diff options
context:
space:
mode:
authorRohith Surabattula <rohiths@microsoft.com>2021-04-13 08:26:42 +0300
committerSteve French <stfrench@microsoft.com>2021-05-03 19:20:35 +0300
commitc3f207ab29f793b8c942ce8067ed123f18d5b81b (patch)
treeecfa1fdb80e4aa3281c34008d6962d61eb471573 /fs/cifs/inode.c
parentfee742b502894c8ed02506fff61d7605934f93cb (diff)
downloadlinux-c3f207ab29f793b8c942ce8067ed123f18d5b81b.tar.xz
cifs: Deferred close for files
When file is closed, SMB2 close request is not sent to server immediately and is deferred for acregmax defined interval. When file is reopened by same process for read or write, the file handle is reused if an oplock is held. When client receives a oplock/lease break, file is closed immediately if reference count is zero, else oplock is downgraded. Signed-off-by: Rohith Surabattula <rohiths@microsoft.com> Reviewed-by: Shyam Prasad N <sprasad@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r--fs/cifs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index a0846f788436..b4326ffcefce 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1645,6 +1645,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
goto unlink_out;
}
+ cifs_close_deferred_file(CIFS_I(inode));
if (cap_unix(tcon->ses) && (CIFS_UNIX_POSIX_PATH_OPS_CAP &
le64_to_cpu(tcon->fsUnixInfo.Capability))) {
rc = CIFSPOSIXDelFile(xid, tcon, full_path,