diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-09-19 09:22:44 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 22:46:33 -0400 |
commit | b8c32dbb0deb287a5fcb78251e4eae6c7275760d (patch) | |
tree | fa3cddfd4595846921f51a922b7e1722b1e35fa4 /fs/cifs/dir.c | |
parent | 579f9053236c796d718162c37c72bb3bd32d008c (diff) |
CIFS: Request SMB2.1 leases
if server supports them and we need oplocks.
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/dir.c')
-rw-r--r-- | fs/cifs/dir.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index b99a1670dad4..4f2147c5adb6 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -340,6 +340,8 @@ cifs_create_get_file_info: | |||
340 | rc = cifs_get_inode_info(&newinode, full_path, buf, inode->i_sb, | 340 | rc = cifs_get_inode_info(&newinode, full_path, buf, inode->i_sb, |
341 | xid, &fid->netfid); | 341 | xid, &fid->netfid); |
342 | if (newinode) { | 342 | if (newinode) { |
343 | if (server->ops->set_lease_key) | ||
344 | server->ops->set_lease_key(newinode, fid); | ||
343 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) | 345 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM) |
344 | newinode->i_mode = mode; | 346 | newinode->i_mode = mode; |
345 | if ((*oplock & CIFS_CREATE_ACTION) && | 347 | if ((*oplock & CIFS_CREATE_ACTION) && |
@@ -418,6 +420,9 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry, | |||
418 | tcon = tlink_tcon(tlink); | 420 | tcon = tlink_tcon(tlink); |
419 | server = tcon->ses->server; | 421 | server = tcon->ses->server; |
420 | 422 | ||
423 | if (server->ops->new_lease_key) | ||
424 | server->ops->new_lease_key(&fid); | ||
425 | |||
421 | rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, | 426 | rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, |
422 | &oplock, &fid, opened); | 427 | &oplock, &fid, opened); |
423 | 428 | ||
@@ -473,10 +478,14 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode, | |||
473 | if (IS_ERR(tlink)) | 478 | if (IS_ERR(tlink)) |
474 | goto out_free_xid; | 479 | goto out_free_xid; |
475 | 480 | ||
476 | rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, | ||
477 | &oplock, &fid, &created); | ||
478 | tcon = tlink_tcon(tlink); | 481 | tcon = tlink_tcon(tlink); |
479 | server = tcon->ses->server; | 482 | server = tcon->ses->server; |
483 | |||
484 | if (server->ops->new_lease_key) | ||
485 | server->ops->new_lease_key(&fid); | ||
486 | |||
487 | rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, | ||
488 | &oplock, &fid, &created); | ||
480 | if (!rc && server->ops->close) | 489 | if (!rc && server->ops->close) |
481 | server->ops->close(xid, tcon, &fid); | 490 | server->ops->close(xid, tcon, &fid); |
482 | 491 | ||