summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smb2ops.c
diff options
context:
space:
mode:
authorPavel Shilovsky2012-09-19 01:20:32 +0200
committerSteve French2012-09-25 04:46:29 +0200
commitc839ff244ba2d54d0933596e29a4b03e3c846a9a (patch)
tree91c58400bd08c1e5a18ed33cca16f7b890be5dde /fs/cifs/smb2ops.c
parentCIFS: Move set_file_size to ops struct (diff)
downloadkernel-qcow2-linux-c839ff244ba2d54d0933596e29a4b03e3c846a9a.tar.gz
kernel-qcow2-linux-c839ff244ba2d54d0933596e29a4b03e3c846a9a.tar.xz
kernel-qcow2-linux-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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 75693e983e76..e0daf3a4dcc2 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,