diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-09-18 16:20:26 -0700 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 21:46:26 -0500 |
commit | f0df737ee820ec62055baf2b28e24db4fb1ad71d (patch) | |
tree | bb2aa80babbe6afaa1edcfb1885ad3b8250171c0 /fs/cifs/smb2ops.c | |
parent | 0ff78a221bf7839a7f20be9929433d17e868e987 (diff) | |
download | linux-f0df737ee820ec62055baf2b28e24db4fb1ad71d.tar.gz linux-f0df737ee820ec62055baf2b28e24db4fb1ad71d.tar.bz2 linux-f0df737ee820ec62055baf2b28e24db4fb1ad71d.zip |
CIFS: Add open/close file support for SMB2
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r-- | fs/cifs/smb2ops.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index bf9b318cfa4b..eba12b31dc60 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -170,7 +170,7 @@ smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon, return -ENOMEM; rc = SMB2_open(xid, tcon, utf16_path, &persistent_fid, &volatile_fid, - FILE_READ_ATTRIBUTES, FILE_OPEN, 0, 0); + FILE_READ_ATTRIBUTES, FILE_OPEN, 0, 0, NULL); if (rc) { kfree(utf16_path); return rc; @@ -292,6 +292,23 @@ smb2_print_stats(struct seq_file *m, struct cifs_tcon *tcon) #endif } +static void +smb2_set_fid(struct cifsFileInfo *cfile, struct cifs_fid *fid, __u32 oplock) +{ + /* struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); */ + cfile->fid.persistent_fid = fid->persistent_fid; + cfile->fid.volatile_fid = fid->volatile_fid; + /* cifs_set_oplock_level(cinode, oplock); */ + /* cinode->can_cache_brlcks = cinode->clientCanCacheAll; */ +} + +static int +smb2_close_file(const unsigned int xid, struct cifs_tcon *tcon, + struct cifs_fid *fid) +{ + return SMB2_close(xid, tcon, fid->persistent_fid, fid->volatile_fid); +} + struct smb_version_operations smb21_operations = { .setup_request = smb2_setup_request, .setup_async_request = smb2_setup_async_request, @@ -322,6 +339,9 @@ struct smb_version_operations smb21_operations = { .mkdir_setinfo = smb2_mkdir_setinfo, .rmdir = smb2_rmdir, .unlink = smb2_unlink, + .open = smb2_open_file, + .set_fid = smb2_set_fid, + .close = smb2_close_file, }; struct smb_version_values smb21_values = { |