From 7a60efab35fc682e8e2c8d921842969aff2cdeeb Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 10 Aug 2021 14:47:03 +0800 Subject: [PATCH] fs/nfs: Support 64bit file length Signed-off-by: Xiang Xiao --- fs/nfs/nfs_vfsops.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/nfs/nfs_vfsops.c b/fs/nfs/nfs_vfsops.c index ca3868eee0..e580c5f6b6 100644 --- a/fs/nfs/nfs_vfsops.c +++ b/fs/nfs/nfs_vfsops.c @@ -116,7 +116,7 @@ static int nfs_filecreate(FAR struct nfsmount *nmp, FAR struct nfsnode *np, FAR const char *relpath, mode_t mode); static int nfs_filetruncate(FAR struct nfsmount *nmp, - FAR struct nfsnode *np, uint32_t length); + FAR struct nfsnode *np, off_t length); static int nfs_fileopen(FAR struct nfsmount *nmp, FAR struct nfsnode *np, FAR const char *relpath, int oflags, mode_t mode); @@ -389,7 +389,7 @@ static int nfs_filecreate(FAR struct nfsmount *nmp, FAR struct nfsnode *np, ****************************************************************************/ static int nfs_filetruncate(FAR struct nfsmount *nmp, - FAR struct nfsnode *np, uint32_t length) + FAR struct nfsnode *np, off_t length) { FAR uint32_t *ptr; int reqlen; @@ -417,8 +417,8 @@ static int nfs_filetruncate(FAR struct nfsmount *nmp, *ptr++ = nfs_false; /* Don't change uid */ *ptr++ = nfs_false; /* Don't change gid */ *ptr++ = nfs_true; /* Use the following size */ - *ptr++ = 0; - *ptr++ = txdr_unsigned(length); /* Truncate to the specified length */ + *ptr++ = txdr_unsigned(length >> 32); /* Truncate to the specified length */ + *ptr++ = txdr_unsigned(length); *ptr++ = HTONL(NFSV3SATTRTIME_TOSERVER); /* Use the server's time */ *ptr++ = HTONL(NFSV3SATTRTIME_TOSERVER); /* Use the server's time */ *ptr++ = nfs_false; /* No guard value */