diff options
author | Pavel Shilovsky <pshilovsky@samba.org> | 2012-09-18 16:20:32 -0700 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2012-09-24 21:46:29 -0500 |
commit | c839ff244ba2d54d0933596e29a4b03e3c846a9a (patch) | |
tree | 91c58400bd08c1e5a18ed33cca16f7b890be5dde /fs/cifs/smb2ops.c | |
parent | d143341815bdc7c45d5289a3ab5743c838332518 (diff) | |
download | linux-3.10-c839ff244ba2d54d0933596e29a4b03e3c846a9a.tar.gz linux-3.10-c839ff244ba2d54d0933596e29a4b03e3c846a9a.tar.bz2 linux-3.10-c839ff244ba2d54d0933596e29a4b03e3c846a9a.zip |
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/smb2ops.c')
-rw-r--r-- | fs/cifs/smb2ops.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 75693e983e7..e0daf3a4dcc 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -415,6 +415,15 @@ smb2_sync_write(const unsigned int xid, struct cifsFileInfo *cfile, return SMB2_write(xid, parms, written, iov, nr_segs); } +static int +smb2_set_file_size(const unsigned int xid, struct cifs_tcon *tcon, + struct cifsFileInfo *cfile, __u64 size, bool set_alloc) +{ + __le64 eof = cpu_to_le64(size); + return SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid, + cfile->fid.volatile_fid, cfile->pid, &eof); +} + struct smb_version_operations smb21_operations = { .setup_request = smb2_setup_request, .setup_async_request = smb2_setup_async_request, @@ -446,6 +455,8 @@ struct smb_version_operations smb21_operations = { .query_path_info = smb2_query_path_info, .get_srv_inum = smb2_get_srv_inum, .query_file_info = smb2_query_file_info, + .set_path_size = smb2_set_path_size, + .set_file_size = smb2_set_file_size, .build_path_to_root = smb2_build_path_to_root, .mkdir = smb2_mkdir, .mkdir_setinfo = smb2_mkdir_setinfo, |