aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2pdu.c
diff options
context:
space:
mode:
authorPavel Shilovsky <pshilovsky@samba.org>2013-07-09 10:20:30 -0400
committerSteve French <smfrench@gmail.com>2013-07-10 14:08:40 -0400
commit064f6047a123d61dd52bb44605c999cd8ef727d9 (patch)
tree1be5444dd6726a51682b3581418e97488251f168 /fs/cifs/smb2pdu.c
parent226730b4d8adae393dc07092655cdd29d2a2ff07 (diff)
CIFS: Make SMB2_open use cifs_open_parms struct
to prepare it for further durable handle reconnect processing. Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org> Signed-off-by: Steven French <steven@steven-GA-970A-DS3.(none)>
Diffstat (limited to 'fs/cifs/smb2pdu.c')
-rw-r--r--fs/cifs/smb2pdu.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 140a613073fb..9d7341d696fc 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -946,14 +946,13 @@ add_durable_context(struct kvec *iov, unsigned int *num_iovec)
946} 946}
947 947
948int 948int
949SMB2_open(const unsigned int xid, struct cifs_tcon *tcon, __le16 *path, 949SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
950 u64 *persistent_fid, u64 *volatile_fid, __u32 desired_access, 950 __u8 *oplock, struct smb2_file_all_info *buf)
951 __u32 create_disposition, __u32 create_options, __u8 *oplock,
952 struct smb2_file_all_info *buf)
953{ 951{
954 struct smb2_create_req *req; 952 struct smb2_create_req *req;
955 struct smb2_create_rsp *rsp; 953 struct smb2_create_rsp *rsp;
956 struct TCP_Server_Info *server; 954 struct TCP_Server_Info *server;
955 struct cifs_tcon *tcon = oparms->tcon;
957 struct cifs_ses *ses = tcon->ses; 956 struct cifs_ses *ses = tcon->ses;
958 struct kvec iov[4]; 957 struct kvec iov[4];
959 int resp_buftype; 958 int resp_buftype;
@@ -975,16 +974,16 @@ SMB2_open(const unsigned int xid, struct cifs_tcon *tcon, __le16 *path,
975 if (rc) 974 if (rc)
976 return rc; 975 return rc;
977 976
978 if (create_options & CREATE_OPTION_READONLY) 977 if (oparms->create_options & CREATE_OPTION_READONLY)
979 file_attributes |= ATTR_READONLY; 978 file_attributes |= ATTR_READONLY;
980 979
981 req->ImpersonationLevel = IL_IMPERSONATION; 980 req->ImpersonationLevel = IL_IMPERSONATION;
982 req->DesiredAccess = cpu_to_le32(desired_access); 981 req->DesiredAccess = cpu_to_le32(oparms->desired_access);
983 /* File attributes ignored on open (used in create though) */ 982 /* File attributes ignored on open (used in create though) */
984 req->FileAttributes = cpu_to_le32(file_attributes); 983 req->FileAttributes = cpu_to_le32(file_attributes);
985 req->ShareAccess = FILE_SHARE_ALL_LE; 984 req->ShareAccess = FILE_SHARE_ALL_LE;
986 req->CreateDisposition = cpu_to_le32(create_disposition); 985 req->CreateDisposition = cpu_to_le32(oparms->disposition);
987 req->CreateOptions = cpu_to_le32(create_options & CREATE_OPTIONS_MASK); 986 req->CreateOptions = cpu_to_le32(oparms->create_options & CREATE_OPTIONS_MASK);
988 uni_path_len = (2 * UniStrnlen((wchar_t *)path, PATH_MAX)) + 2; 987 uni_path_len = (2 * UniStrnlen((wchar_t *)path, PATH_MAX)) + 2;
989 /* do not count rfc1001 len field */ 988 /* do not count rfc1001 len field */
990 req->NameOffset = cpu_to_le16(sizeof(struct smb2_create_req) - 4); 989 req->NameOffset = cpu_to_le16(sizeof(struct smb2_create_req) - 4);
@@ -1055,8 +1054,8 @@ SMB2_open(const unsigned int xid, struct cifs_tcon *tcon, __le16 *path,
1055 goto creat_exit; 1054 goto creat_exit;
1056 } 1055 }
1057 1056
1058 *persistent_fid = rsp->PersistentFileId; 1057 oparms->fid->persistent_fid = rsp->PersistentFileId;
1059 *volatile_fid = rsp->VolatileFileId; 1058 oparms->fid->volatile_fid = rsp->VolatileFileId;
1060 1059
1061 if (buf) { 1060 if (buf) {
1062 memcpy(buf, &rsp->CreationTime, 32); 1061 memcpy(buf, &rsp->CreationTime, 32);