mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 17:22:07 +00:00
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. Signed-off-by: Bharath SM <bharathsm@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
92941c7f2c
commit
02ef599bb2
@ -990,7 +990,11 @@ int cifs_open(struct inode *inode, struct file *file)
|
||||
}
|
||||
|
||||
/* Get the cached handle as SMB2 close is deferred */
|
||||
rc = cifs_get_readable_path(tcon, full_path, &cfile);
|
||||
if (OPEN_FMODE(file->f_flags) & FMODE_WRITE) {
|
||||
rc = cifs_get_writable_path(tcon, full_path, FIND_WR_ANY, &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;
|
||||
|
Loading…
Reference in New Issue
Block a user