Commit b8ea3b1f authored by Bharath SM's avatar Bharath SM Committed by Steve French
Browse files

smb: enable reuse of deferred file handles for write operations



Previously, deferred file handles were reused only for read
operations, this commit extends to reusing deferred handles
for write operations. By reusing these handles we can reduce
the need for open/close operations over the wire.

Signed-off-by: default avatarBharath SM <bharathsm@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 4bbf9020
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -990,7 +990,11 @@ int cifs_open(struct inode *inode, struct file *file)
	}

	/* Get the cached handle as SMB2 close is deferred */
	if (OPEN_FMODE(file->f_flags) & FMODE_WRITE) {
		rc = cifs_get_writable_path(tcon, full_path, FIND_WR_FSUID_ONLY, &cfile);
	} else {
		rc = cifs_get_readable_path(tcon, full_path, &cfile);
	}
	if (rc == 0) {
		if (file->f_flags == cfile->f_flags) {
			file->private_data = cfile;