diff options
author | Pavel Shilovsky <pshilovsky@etersoft.ru> | 2012-09-19 06:22:43 -0700 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 21:46:33 -0500 |
commit | f7ba7fe685bc3ed8fd0687870e68b2567d17357f (patch) | |
tree | 364ff08cf616cc740467d44d5026a05ce9d0c33c /fs/cifs/smb2ops.c | |
parent | 027e8eec31d8141a6231f772e10ccae60c9d5c13 (diff) |
CIFS: Add brlock support for SMB2
Signed-off-by: Pavel Shilovsky <pshilovsky@etersoft.ru>
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r-- | fs/cifs/smb2ops.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index e4a59d1f06b1..caed2c57896d 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -544,6 +544,17 @@ smb2_compare_fids(struct cifsFileInfo *ob1, struct cifsFileInfo *ob2) ob1->fid.volatile_fid == ob2->fid.volatile_fid; } +static int +smb2_mand_lock(const unsigned int xid, struct cifsFileInfo *cfile, __u64 offset, + __u64 length, __u32 type, int lock, int unlock, bool wait) +{ + if (unlock && !lock) + type = SMB2_LOCKFLAG_UNLOCK; + return SMB2_lock(xid, tlink_tcon(cfile->tlink), + cfile->fid.persistent_fid, cfile->fid.volatile_fid, + current->tgid, length, offset, type, wait); +} + struct smb_version_operations smb21_operations = { .compare_fids = smb2_compare_fids, .setup_request = smb2_setup_request, @@ -602,6 +613,8 @@ struct smb_version_operations smb21_operations = { .is_status_pending = smb2_is_status_pending, .oplock_response = smb2_oplock_response, .queryfs = smb2_queryfs, + .mand_lock = smb2_mand_lock, + .mand_unlock_range = smb2_unlock_range, }; struct smb_version_values smb21_values = { |