diff options
author | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2014-11-07 14:44:26 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-11-07 16:19:49 -0500 |
commit | 95d871f03cae6b49de040265cf88cbe2a16b9f05 (patch) | |
tree | 911d8bed4226e4e87e1411145c7fe0e275dea545 /fs/nfsd/nfs4xdr.c | |
parent | 72c72bdf7bf53353d2d8e055194d27f0128be92b (diff) |
nfsd: Add ALLOCATE support
The ALLOCATE operation is used to preallocate space in a file. I can do
this by using vfs_fallocate() to do the actual preallocation.
ALLOCATE only returns a status indicator, so we don't need to write a
special encode() function.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index eeea7a90eb87..a60cff86fc28 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -1514,6 +1514,23 @@ static __be32 nfsd4_decode_reclaim_complete(struct nfsd4_compoundargs *argp, str | |||
1514 | } | 1514 | } |
1515 | 1515 | ||
1516 | static __be32 | 1516 | static __be32 |
1517 | nfsd4_decode_fallocate(struct nfsd4_compoundargs *argp, | ||
1518 | struct nfsd4_fallocate *fallocate) | ||
1519 | { | ||
1520 | DECODE_HEAD; | ||
1521 | |||
1522 | status = nfsd4_decode_stateid(argp, &fallocate->falloc_stateid); | ||
1523 | if (status) | ||
1524 | return status; | ||
1525 | |||
1526 | READ_BUF(16); | ||
1527 | p = xdr_decode_hyper(p, &fallocate->falloc_offset); | ||
1528 | xdr_decode_hyper(p, &fallocate->falloc_length); | ||
1529 | |||
1530 | DECODE_TAIL; | ||
1531 | } | ||
1532 | |||
1533 | static __be32 | ||
1517 | nfsd4_decode_seek(struct nfsd4_compoundargs *argp, struct nfsd4_seek *seek) | 1534 | nfsd4_decode_seek(struct nfsd4_compoundargs *argp, struct nfsd4_seek *seek) |
1518 | { | 1535 | { |
1519 | DECODE_HEAD; | 1536 | DECODE_HEAD; |
@@ -1604,7 +1621,7 @@ static nfsd4_dec nfsd4_dec_ops[] = { | |||
1604 | [OP_RECLAIM_COMPLETE] = (nfsd4_dec)nfsd4_decode_reclaim_complete, | 1621 | [OP_RECLAIM_COMPLETE] = (nfsd4_dec)nfsd4_decode_reclaim_complete, |
1605 | 1622 | ||
1606 | /* new operations for NFSv4.2 */ | 1623 | /* new operations for NFSv4.2 */ |
1607 | [OP_ALLOCATE] = (nfsd4_dec)nfsd4_decode_notsupp, | 1624 | [OP_ALLOCATE] = (nfsd4_dec)nfsd4_decode_fallocate, |
1608 | [OP_COPY] = (nfsd4_dec)nfsd4_decode_notsupp, | 1625 | [OP_COPY] = (nfsd4_dec)nfsd4_decode_notsupp, |
1609 | [OP_COPY_NOTIFY] = (nfsd4_dec)nfsd4_decode_notsupp, | 1626 | [OP_COPY_NOTIFY] = (nfsd4_dec)nfsd4_decode_notsupp, |
1610 | [OP_DEALLOCATE] = (nfsd4_dec)nfsd4_decode_notsupp, | 1627 | [OP_DEALLOCATE] = (nfsd4_dec)nfsd4_decode_notsupp, |