diff options
author | Anna Schumaker <Anna.Schumaker@Netapp.com> | 2014-11-07 14:44:27 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-11-07 16:20:15 -0500 |
commit | b0cb9085239a20b7482ddd4839dd1d5476801dfa (patch) | |
tree | b636c01e14d11b8f565d022334b43e54f99103e2 /fs/nfsd | |
parent | 95d871f03cae6b49de040265cf88cbe2a16b9f05 (diff) |
nfsd: Add DEALLOCATE support
DEALLOCATE only returns a status value, meaning we can use the noop()
xdr encoder to reply to the client.
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 15 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 2 | ||||
-rw-r--r-- | fs/nfsd/xdr4.h | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index a261f1800922..74fb15eefc31 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -33,6 +33,7 @@ | |||
33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 33 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
34 | */ | 34 | */ |
35 | #include <linux/file.h> | 35 | #include <linux/file.h> |
36 | #include <linux/falloc.h> | ||
36 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
37 | 38 | ||
38 | #include "idmap.h" | 39 | #include "idmap.h" |
@@ -1044,6 +1045,14 @@ nfsd4_allocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
1044 | } | 1045 | } |
1045 | 1046 | ||
1046 | static __be32 | 1047 | static __be32 |
1048 | nfsd4_deallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | ||
1049 | struct nfsd4_fallocate *fallocate) | ||
1050 | { | ||
1051 | return nfsd4_fallocate(rqstp, cstate, fallocate, | ||
1052 | FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE); | ||
1053 | } | ||
1054 | |||
1055 | static __be32 | ||
1047 | nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | 1056 | nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, |
1048 | struct nfsd4_seek *seek) | 1057 | struct nfsd4_seek *seek) |
1049 | { | 1058 | { |
@@ -1965,6 +1974,12 @@ static struct nfsd4_operation nfsd4_ops[] = { | |||
1965 | .op_name = "OP_ALLOCATE", | 1974 | .op_name = "OP_ALLOCATE", |
1966 | .op_rsize_bop = (nfsd4op_rsize)nfsd4_write_rsize, | 1975 | .op_rsize_bop = (nfsd4op_rsize)nfsd4_write_rsize, |
1967 | }, | 1976 | }, |
1977 | [OP_DEALLOCATE] = { | ||
1978 | .op_func = (nfsd4op_func)nfsd4_deallocate, | ||
1979 | .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, | ||
1980 | .op_name = "OP_DEALLOCATE", | ||
1981 | .op_rsize_bop = (nfsd4op_rsize)nfsd4_write_rsize, | ||
1982 | }, | ||
1968 | [OP_SEEK] = { | 1983 | [OP_SEEK] = { |
1969 | .op_func = (nfsd4op_func)nfsd4_seek, | 1984 | .op_func = (nfsd4op_func)nfsd4_seek, |
1970 | .op_name = "OP_SEEK", | 1985 | .op_name = "OP_SEEK", |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index a60cff86fc28..0622d4f4a9a2 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -1624,7 +1624,7 @@ static nfsd4_dec nfsd4_dec_ops[] = { | |||
1624 | [OP_ALLOCATE] = (nfsd4_dec)nfsd4_decode_fallocate, | 1624 | [OP_ALLOCATE] = (nfsd4_dec)nfsd4_decode_fallocate, |
1625 | [OP_COPY] = (nfsd4_dec)nfsd4_decode_notsupp, | 1625 | [OP_COPY] = (nfsd4_dec)nfsd4_decode_notsupp, |
1626 | [OP_COPY_NOTIFY] = (nfsd4_dec)nfsd4_decode_notsupp, | 1626 | [OP_COPY_NOTIFY] = (nfsd4_dec)nfsd4_decode_notsupp, |
1627 | [OP_DEALLOCATE] = (nfsd4_dec)nfsd4_decode_notsupp, | 1627 | [OP_DEALLOCATE] = (nfsd4_dec)nfsd4_decode_fallocate, |
1628 | [OP_IO_ADVISE] = (nfsd4_dec)nfsd4_decode_notsupp, | 1628 | [OP_IO_ADVISE] = (nfsd4_dec)nfsd4_decode_notsupp, |
1629 | [OP_LAYOUTERROR] = (nfsd4_dec)nfsd4_decode_notsupp, | 1629 | [OP_LAYOUTERROR] = (nfsd4_dec)nfsd4_decode_notsupp, |
1630 | [OP_LAYOUTSTATS] = (nfsd4_dec)nfsd4_decode_notsupp, | 1630 | [OP_LAYOUTSTATS] = (nfsd4_dec)nfsd4_decode_notsupp, |
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index eeaa0d0c4f79..90a5925bd6ab 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h | |||
@@ -494,6 +494,7 @@ struct nfsd4_op { | |||
494 | 494 | ||
495 | /* NFSv4.2 */ | 495 | /* NFSv4.2 */ |
496 | struct nfsd4_fallocate allocate; | 496 | struct nfsd4_fallocate allocate; |
497 | struct nfsd4_fallocate deallocate; | ||
497 | struct nfsd4_seek seek; | 498 | struct nfsd4_seek seek; |
498 | } u; | 499 | } u; |
499 | struct nfs4_replay * replay; | 500 | struct nfs4_replay * replay; |