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 | c839ff244ba2d54d0933596e29a4b03e3c846a9a (patch) | |
tree | 91c58400bd08c1e5a18ed33cca16f7b890be5dde /fs/cifs/smb2inode.c | |
parent | d143341815bdc7c45d5289a3ab5743c838332518 (diff) |
CIFS: Add SMB2 support for set_file_size
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 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c index 1921c9c87ccd..290583092293 100644 --- a/fs/cifs/smb2inode.c +++ b/fs/cifs/smb2inode.c | |||
@@ -82,6 +82,10 @@ smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon, | |||
82 | tmprc = SMB2_set_hardlink(xid, tcon, persistent_fid, | 82 | tmprc = SMB2_set_hardlink(xid, tcon, persistent_fid, |
83 | volatile_fid, (__le16 *)data); | 83 | volatile_fid, (__le16 *)data); |
84 | break; | 84 | break; |
85 | case SMB2_OP_SET_EOF: | ||
86 | tmprc = SMB2_set_eof(xid, tcon, persistent_fid, volatile_fid, | ||
87 | current->tgid, (__le64 *)data); | ||
88 | break; | ||
85 | default: | 89 | default: |
86 | cERROR(1, "Invalid command"); | 90 | cERROR(1, "Invalid command"); |
87 | break; | 91 | break; |
@@ -217,3 +221,14 @@ smb2_create_hardlink(const unsigned int xid, struct cifs_tcon *tcon, | |||
217 | return smb2_set_path_attr(xid, tcon, from_name, to_name, cifs_sb, | 221 | return smb2_set_path_attr(xid, tcon, from_name, to_name, cifs_sb, |
218 | FILE_READ_ATTRIBUTES, SMB2_OP_HARDLINK); | 222 | FILE_READ_ATTRIBUTES, SMB2_OP_HARDLINK); |
219 | } | 223 | } |
224 | |||
225 | int | ||
226 | smb2_set_path_size(const unsigned int xid, struct cifs_tcon *tcon, | ||
227 | const char *full_path, __u64 size, | ||
228 | struct cifs_sb_info *cifs_sb, bool set_alloc) | ||
229 | { | ||
230 | __le64 eof = cpu_to_le64(size); | ||
231 | return smb2_open_op_close(xid, tcon, cifs_sb, full_path, | ||
232 | FILE_WRITE_DATA, FILE_OPEN, 0, 0, &eof, | ||
233 | SMB2_OP_SET_EOF); | ||
234 | } | ||