diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2013-07-09 10:20:30 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-07-10 14:08:40 -0400 |
commit | 064f6047a123d61dd52bb44605c999cd8ef727d9 (patch) | |
tree | 1be5444dd6726a51682b3581418e97488251f168 /fs/cifs/smb2inode.c | |
parent | 226730b4d8adae393dc07092655cdd29d2a2ff07 (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/smb2inode.c')
-rw-r--r-- | fs/cifs/smb2inode.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c index f50eefd9e005..9841df771f08 100644 --- a/fs/cifs/smb2inode.c +++ b/fs/cifs/smb2inode.c | |||
@@ -44,17 +44,22 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon, | |||
44 | __u32 create_options, void *data, int command) | 44 | __u32 create_options, void *data, int command) |
45 | { | 45 | { |
46 | int rc, tmprc = 0; | 46 | int rc, tmprc = 0; |
47 | u64 persistent_fid, volatile_fid; | ||
48 | __le16 *utf16_path; | 47 | __le16 *utf16_path; |
49 | __u8 oplock = SMB2_OPLOCK_LEVEL_NONE; | 48 | __u8 oplock = SMB2_OPLOCK_LEVEL_NONE; |
49 | struct cifs_open_parms oparms; | ||
50 | struct cifs_fid fid; | ||
50 | 51 | ||
51 | utf16_path = cifs_convert_path_to_utf16(full_path, cifs_sb); | 52 | utf16_path = cifs_convert_path_to_utf16(full_path, cifs_sb); |
52 | if (!utf16_path) | 53 | if (!utf16_path) |
53 | return -ENOMEM; | 54 | return -ENOMEM; |
54 | 55 | ||
55 | rc = SMB2_open(xid, tcon, utf16_path, &persistent_fid, &volatile_fid, | 56 | oparms.tcon = tcon; |
56 | desired_access, create_disposition, create_options, | 57 | oparms.desired_access = desired_access; |
57 | &oplock, NULL); | 58 | oparms.disposition = create_disposition; |
59 | oparms.create_options = create_options; | ||
60 | oparms.fid = &fid; | ||
61 | |||
62 | rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL); | ||
58 | if (rc) { | 63 | if (rc) { |
59 | kfree(utf16_path); | 64 | kfree(utf16_path); |
60 | return rc; | 65 | return rc; |
@@ -64,8 +69,8 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon, | |||
64 | case SMB2_OP_DELETE: | 69 | case SMB2_OP_DELETE: |
65 | break; | 70 | break; |
66 | case SMB2_OP_QUERY_INFO: | 71 | case SMB2_OP_QUERY_INFO: |
67 | tmprc = SMB2_query_info(xid, tcon, persistent_fid, | 72 | tmprc = SMB2_query_info(xid, tcon, fid.persistent_fid, |
68 | volatile_fid, | 73 | fid.volatile_fid, |
69 | (struct smb2_file_all_info *)data); | 74 | (struct smb2_file_all_info *)data); |
70 | break; | 75 | break; |
71 | case SMB2_OP_MKDIR: | 76 | case SMB2_OP_MKDIR: |
@@ -75,19 +80,21 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon, | |||
75 | */ | 80 | */ |
76 | break; | 81 | break; |
77 | case SMB2_OP_RENAME: | 82 | case SMB2_OP_RENAME: |
78 | tmprc = SMB2_rename(xid, tcon, persistent_fid, volatile_fid, | 83 | tmprc = SMB2_rename(xid, tcon, fid.persistent_fid, |
79 | (__le16 *)data); | 84 | fid.volatile_fid, (__le16 *)data); |
80 | break; | 85 | break; |
81 | case SMB2_OP_HARDLINK: | 86 | case SMB2_OP_HARDLINK: |
82 | tmprc = SMB2_set_hardlink(xid, tcon, persistent_fid, | 87 | tmprc = SMB2_set_hardlink(xid, tcon, fid.persistent_fid, |
83 | volatile_fid, (__le16 *)data); | 88 | fid.volatile_fid, (__le16 *)data); |
84 | break; | 89 | break; |
85 | case SMB2_OP_SET_EOF: | 90 | case SMB2_OP_SET_EOF: |
86 | tmprc = SMB2_set_eof(xid, tcon, persistent_fid, volatile_fid, | 91 | tmprc = SMB2_set_eof(xid, tcon, fid.persistent_fid, |
87 | current->tgid, (__le64 *)data); | 92 | fid.volatile_fid, current->tgid, |
93 | (__le64 *)data); | ||
88 | break; | 94 | break; |
89 | case SMB2_OP_SET_INFO: | 95 | case SMB2_OP_SET_INFO: |
90 | tmprc = SMB2_set_info(xid, tcon, persistent_fid, volatile_fid, | 96 | tmprc = SMB2_set_info(xid, tcon, fid.persistent_fid, |
97 | fid.volatile_fid, | ||
91 | (FILE_BASIC_INFO *)data); | 98 | (FILE_BASIC_INFO *)data); |
92 | break; | 99 | break; |
93 | default: | 100 | default: |
@@ -95,7 +102,7 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon, | |||
95 | break; | 102 | break; |
96 | } | 103 | } |
97 | 104 | ||
98 | rc = SMB2_close(xid, tcon, persistent_fid, volatile_fid); | 105 | rc = SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid); |
99 | if (tmprc) | 106 | if (tmprc) |
100 | rc = tmprc; | 107 | rc = tmprc; |
101 | kfree(utf16_path); | 108 | kfree(utf16_path); |