diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2012-07-11 16:30:23 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-07-16 14:53:34 -0400 |
commit | 38527b153a7b43e5c8103f0c2d901d11cfa26d30 (patch) | |
tree | ac3736a12230b2bfe5793ac8441e0ac6ef2a78a7 | |
parent | 3e60ffdd36fa518cc1822941dbb011e7a9adf513 (diff) |
NFS: Clean up TEST_STATEID and FREE_STATEID error reporting
As a finishing touch, add appropriate documenting comments and some
debugging printk's.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/nfs4proc.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 1364569f1d1d..0cb876640781 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -6625,13 +6625,27 @@ static int _nfs41_test_stateid(struct nfs_server *server, nfs4_stateid *stateid) | |||
6625 | .rpc_resp = &res, | 6625 | .rpc_resp = &res, |
6626 | }; | 6626 | }; |
6627 | 6627 | ||
6628 | dprintk("NFS call test_stateid %p\n", stateid); | ||
6628 | nfs41_init_sequence(&args.seq_args, &res.seq_res, 0); | 6629 | nfs41_init_sequence(&args.seq_args, &res.seq_res, 0); |
6629 | status = nfs4_call_sync_sequence(server->client, server, &msg, &args.seq_args, &res.seq_res, 1); | 6630 | status = nfs4_call_sync_sequence(server->client, server, &msg, &args.seq_args, &res.seq_res, 1); |
6630 | if (status != NFS_OK) | 6631 | if (status != NFS_OK) { |
6632 | dprintk("NFS reply test_stateid: failed, %d\n", status); | ||
6631 | return status; | 6633 | return status; |
6634 | } | ||
6635 | dprintk("NFS reply test_stateid: succeeded, %d\n", -res.status); | ||
6632 | return -res.status; | 6636 | return -res.status; |
6633 | } | 6637 | } |
6634 | 6638 | ||
6639 | /** | ||
6640 | * nfs41_test_stateid - perform a TEST_STATEID operation | ||
6641 | * | ||
6642 | * @server: server / transport on which to perform the operation | ||
6643 | * @stateid: state ID to test | ||
6644 | * | ||
6645 | * Returns NFS_OK if the server recognizes that "stateid" is valid. | ||
6646 | * Otherwise a negative NFS4ERR value is returned if the operation | ||
6647 | * failed or the state ID is not currently valid. | ||
6648 | */ | ||
6635 | static int nfs41_test_stateid(struct nfs_server *server, nfs4_stateid *stateid) | 6649 | static int nfs41_test_stateid(struct nfs_server *server, nfs4_stateid *stateid) |
6636 | { | 6650 | { |
6637 | struct nfs4_exception exception = { }; | 6651 | struct nfs4_exception exception = { }; |
@@ -6656,12 +6670,25 @@ static int _nfs4_free_stateid(struct nfs_server *server, nfs4_stateid *stateid) | |||
6656 | .rpc_argp = &args, | 6670 | .rpc_argp = &args, |
6657 | .rpc_resp = &res, | 6671 | .rpc_resp = &res, |
6658 | }; | 6672 | }; |
6673 | int status; | ||
6659 | 6674 | ||
6675 | dprintk("NFS call free_stateid %p\n", stateid); | ||
6660 | nfs41_init_sequence(&args.seq_args, &res.seq_res, 0); | 6676 | nfs41_init_sequence(&args.seq_args, &res.seq_res, 0); |
6661 | return nfs4_call_sync_sequence(server->client, server, &msg, | 6677 | status = nfs4_call_sync_sequence(server->client, server, &msg, |
6662 | &args.seq_args, &res.seq_res, 1); | 6678 | &args.seq_args, &res.seq_res, 1); |
6679 | dprintk("NFS reply free_stateid: %d\n", status); | ||
6680 | return status; | ||
6663 | } | 6681 | } |
6664 | 6682 | ||
6683 | /** | ||
6684 | * nfs41_free_stateid - perform a FREE_STATEID operation | ||
6685 | * | ||
6686 | * @server: server / transport on which to perform the operation | ||
6687 | * @stateid: state ID to release | ||
6688 | * | ||
6689 | * Returns NFS_OK if the server freed "stateid". Otherwise a | ||
6690 | * negative NFS4ERR value is returned. | ||
6691 | */ | ||
6665 | static int nfs41_free_stateid(struct nfs_server *server, nfs4_stateid *stateid) | 6692 | static int nfs41_free_stateid(struct nfs_server *server, nfs4_stateid *stateid) |
6666 | { | 6693 | { |
6667 | struct nfs4_exception exception = { }; | 6694 | struct nfs4_exception exception = { }; |