diff options
author | Pavel Shilovsky <piastryyy@gmail.com> | 2011-07-19 04:56:37 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-07-27 16:17:43 -0400 |
commit | a0e731839dd461eee0fe2dc026e0965e961e2730 (patch) | |
tree | a263e2f49d0c427154c2cfb0446dbe29e53612ce /fs/cifs/smb2inode.c | |
parent | f436720e94ac53413e20c48b02d16e2ef180e166 (diff) |
CIFS: Add SMB2 support for mkdir operation
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2inode.c')
-rw-r--r-- | fs/cifs/smb2inode.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c index 1ba5c405315c..e129527a707a 100644 --- a/fs/cifs/smb2inode.c +++ b/fs/cifs/smb2inode.c | |||
@@ -122,3 +122,33 @@ out: | |||
122 | kfree(smb2_data); | 122 | kfree(smb2_data); |
123 | return rc; | 123 | return rc; |
124 | } | 124 | } |
125 | |||
126 | int | ||
127 | smb2_mkdir(const unsigned int xid, struct cifs_tcon *tcon, const char *name, | ||
128 | struct cifs_sb_info *cifs_sb) | ||
129 | { | ||
130 | return smb2_open_op_close(xid, tcon, cifs_sb, name, | ||
131 | FILE_WRITE_ATTRIBUTES, FILE_CREATE, 0, | ||
132 | CREATE_NOT_FILE, NULL, SMB2_OP_MKDIR); | ||
133 | } | ||
134 | |||
135 | void | ||
136 | smb2_mkdir_setinfo(struct inode *inode, const char *name, | ||
137 | struct cifs_sb_info *cifs_sb, struct cifs_tcon *tcon, | ||
138 | const unsigned int xid) | ||
139 | { | ||
140 | FILE_BASIC_INFO data; | ||
141 | struct cifsInodeInfo *cifs_i; | ||
142 | u32 dosattrs; | ||
143 | int tmprc; | ||
144 | |||
145 | memset(&data, 0, sizeof(data)); | ||
146 | cifs_i = CIFS_I(inode); | ||
147 | dosattrs = cifs_i->cifsAttrs | ATTR_READONLY; | ||
148 | data.Attributes = cpu_to_le32(dosattrs); | ||
149 | tmprc = smb2_open_op_close(xid, tcon, cifs_sb, name, | ||
150 | FILE_WRITE_ATTRIBUTES, FILE_CREATE, 0, | ||
151 | CREATE_NOT_FILE, &data, SMB2_OP_SET_INFO); | ||
152 | if (tmprc == 0) | ||
153 | cifs_i->cifsAttrs = dosattrs; | ||
154 | } | ||