aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2016-01-18 11:51:41 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2016-01-18 11:51:41 +0000
commit4ecbccb01ec8ee3b01870e6b3029970e1a7a2e79 (patch)
treeba146f45629aef362f18f2786e5cec52d126235e /sys/fs
parent7fa6ad45da435f327f946cb9c4505a8b95c1f5aa (diff)
Notes
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/smbfs/smbfs_smb.c8
-rw-r--r--sys/fs/smbfs/smbfs_subr.h3
-rw-r--r--sys/fs/smbfs/smbfs_vnops.c3
3 files changed, 8 insertions, 6 deletions
diff --git a/sys/fs/smbfs/smbfs_smb.c b/sys/fs/smbfs/smbfs_smb.c
index 182a063540dc..6efc24f5d103 100644
--- a/sys/fs/smbfs/smbfs_smb.c
+++ b/sys/fs/smbfs/smbfs_smb.c
@@ -331,18 +331,18 @@ smbfs_smb_flush(struct smbnode *np, struct smb_cred *scred)
}
int
-smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred)
+smbfs_smb_setfsize(struct smbnode *np, int64_t newsize, struct smb_cred *scred)
{
struct smb_share *ssp = np->n_mount->sm_share;
struct smb_rq rq, *rqp = &rq;
struct mbchain *mbp;
int error;
- if (!smbfs_smb_seteof(np, (int64_t) newsize, scred)) {
+ if (!smbfs_smb_seteof(np, newsize, scred)) {
np->n_flag |= NFLUSHWIRE;
return (0);
}
-
+ /* XXX: We should use SMB_COM_WRITE_ANDX to support large offsets */
error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_WRITE, scred);
if (error)
return error;
@@ -350,7 +350,7 @@ smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred)
smb_rq_wstart(rqp);
mb_put_mem(mbp, (caddr_t)&np->n_fid, 2, MB_MSYSTEM);
mb_put_uint16le(mbp, 0);
- mb_put_uint32le(mbp, newsize);
+ mb_put_uint32le(mbp, (uint32_t)newsize);
mb_put_uint16le(mbp, 0);
smb_rq_wend(rqp);
smb_rq_bstart(rqp);
diff --git a/sys/fs/smbfs/smbfs_subr.h b/sys/fs/smbfs/smbfs_subr.h
index c0be8e05ef16..1a84e85aa194 100644
--- a/sys/fs/smbfs/smbfs_subr.h
+++ b/sys/fs/smbfs/smbfs_subr.h
@@ -127,7 +127,8 @@ int smbfs_smb_lock(struct smbnode *np, int op, caddr_t id,
off_t start, off_t end, struct smb_cred *scred);
int smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp,
struct smb_cred *scred);
-int smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred);
+int smbfs_smb_setfsize(struct smbnode *np, int64_t newsize,
+ struct smb_cred *scred);
int smbfs_smb_query_info(struct smbnode *np, const char *name, int len,
struct smbfattr *fap, struct smb_cred *scred);
diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c
index 830c249e0067..8ac43db262b6 100644
--- a/sys/fs/smbfs/smbfs_vnops.c
+++ b/sys/fs/smbfs/smbfs_vnops.c
@@ -332,7 +332,8 @@ smbfs_setattr(ap)
doclose = 1;
}
if (error == 0)
- error = smbfs_smb_setfsize(np, vap->va_size, &scred);
+ error = smbfs_smb_setfsize(np,
+ (int64_t)vap->va_size, &scred);
if (doclose)
smbfs_smb_close(ssp, np->n_fid, NULL, &scred);
if (error) {