diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-09-18 19:20:32 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 22:46:29 -0400 |
commit | 1feeaac753e0a9b3864740556b7840643642abdb (patch) | |
tree | 0a13bb908611afd528521f66b3f1f36d60112c9b /fs/cifs/smb2inode.c | |
parent | 6bdf6dbd662176c0da5c3ac8ed10ac94e7776c85 (diff) |
CIFS: Add set_file_info support for SMB2
Signed-off-by: Pavel Shilovsky <pshilovsky@samba.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs/cifs/smb2inode.c')
-rw-r--r-- | fs/cifs/smb2inode.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c index 290583092293..1bd6b0f0c10e 100644 --- a/fs/cifs/smb2inode.c +++ b/fs/cifs/smb2inode.c | |||
@@ -86,6 +86,10 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon, | |||
86 | tmprc = SMB2_set_eof(xid, tcon, persistent_fid, volatile_fid, | 86 | tmprc = SMB2_set_eof(xid, tcon, persistent_fid, volatile_fid, |
87 | current->tgid, (__le64 *)data); | 87 | current->tgid, (__le64 *)data); |
88 | break; | 88 | break; |
89 | case SMB2_OP_SET_INFO: | ||
90 | tmprc = SMB2_set_info(xid, tcon, persistent_fid, volatile_fid, | ||
91 | (FILE_BASIC_INFO *)data); | ||
92 | break; | ||
89 | default: | 93 | default: |
90 | cERROR(1, "Invalid command"); | 94 | cERROR(1, "Invalid command"); |
91 | break; | 95 | break; |
@@ -232,3 +236,21 @@ smb2_set_path_size(const unsigned int xid, struct cifs_tcon *tcon, | |||
232 | FILE_WRITE_DATA, FILE_OPEN, 0, 0, &eof, | 236 | FILE_WRITE_DATA, FILE_OPEN, 0, 0, &eof, |
233 | SMB2_OP_SET_EOF); | 237 | SMB2_OP_SET_EOF); |
234 | } | 238 | } |
239 | |||
240 | int | ||
241 | smb2_set_file_info(struct inode *inode, const char *full_path, | ||
242 | FILE_BASIC_INFO *buf, const unsigned int xid) | ||
243 | { | ||
244 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | ||
245 | struct tcon_link *tlink; | ||
246 | int rc; | ||
247 | |||
248 | tlink = cifs_sb_tlink(cifs_sb); | ||
249 | if (IS_ERR(tlink)) | ||
250 | return PTR_ERR(tlink); | ||
251 | rc = smb2_open_op_close(xid, tlink_tcon(tlink), cifs_sb, full_path, | ||
252 | FILE_WRITE_ATTRIBUTES, FILE_OPEN, 0, 0, buf, | ||
253 | SMB2_OP_SET_INFO); | ||
254 | cifs_put_tlink(tlink); | ||
255 | return rc; | ||
256 | } | ||