diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-03-21 09:52:02 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-03-26 11:49:47 -0400 |
commit | a52d726bbd928164609e6abc4dc967e819dbf09c (patch) | |
tree | 604df65589a95311ab297f80ce377e82525ce597 /fs/nfsd/nfs4callback.c | |
parent | 1df00640c9111c881633d9b219f18e66c52599ec (diff) |
nfsd: convert nfs4_client->cl_cb_flags to a generic flags field
We'll need a way to flag the nfs4_client as already being recorded on
stable storage so that we don't continually upcall. Currently, that's
recorded in the cl_firststate field of the client struct. Using an
entire u32 to store a flag is rather wasteful though.
The cl_cb_flags field is only using 2 bits right now, so repurpose that
to a generic flags field. Rename NFSD4_CLIENT_KILL to
NFSD4_CLIENT_CB_KILL to make it evident that it's part of the callback
flags. Add a mask that we can use for existing checks that look to see
whether any flags are set, so that the new flags don't interfere.
Convert all references to cl_firstate to the NFSD4_CLIENT_STABLE flag,
and add a new NFSD4_CLIENT_RECLAIM_COMPLETE flag.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index cf6e4190e41c..0840fc4f7e4a 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -754,9 +754,9 @@ static void do_probe_callback(struct nfs4_client *clp) | |||
754 | */ | 754 | */ |
755 | void nfsd4_probe_callback(struct nfs4_client *clp) | 755 | void nfsd4_probe_callback(struct nfs4_client *clp) |
756 | { | 756 | { |
757 | /* XXX: atomicity? Also, should we be using cl_cb_flags? */ | 757 | /* XXX: atomicity? Also, should we be using cl_flags? */ |
758 | clp->cl_cb_state = NFSD4_CB_UNKNOWN; | 758 | clp->cl_cb_state = NFSD4_CB_UNKNOWN; |
759 | set_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_cb_flags); | 759 | set_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags); |
760 | do_probe_callback(clp); | 760 | do_probe_callback(clp); |
761 | } | 761 | } |
762 | 762 | ||
@@ -915,7 +915,7 @@ void nfsd4_destroy_callback_queue(void) | |||
915 | /* must be called under the state lock */ | 915 | /* must be called under the state lock */ |
916 | void nfsd4_shutdown_callback(struct nfs4_client *clp) | 916 | void nfsd4_shutdown_callback(struct nfs4_client *clp) |
917 | { | 917 | { |
918 | set_bit(NFSD4_CLIENT_KILL, &clp->cl_cb_flags); | 918 | set_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags); |
919 | /* | 919 | /* |
920 | * Note this won't actually result in a null callback; | 920 | * Note this won't actually result in a null callback; |
921 | * instead, nfsd4_do_callback_rpc() will detect the killed | 921 | * instead, nfsd4_do_callback_rpc() will detect the killed |
@@ -966,15 +966,15 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb) | |||
966 | svc_xprt_put(clp->cl_cb_conn.cb_xprt); | 966 | svc_xprt_put(clp->cl_cb_conn.cb_xprt); |
967 | clp->cl_cb_conn.cb_xprt = NULL; | 967 | clp->cl_cb_conn.cb_xprt = NULL; |
968 | } | 968 | } |
969 | if (test_bit(NFSD4_CLIENT_KILL, &clp->cl_cb_flags)) | 969 | if (test_bit(NFSD4_CLIENT_CB_KILL, &clp->cl_flags)) |
970 | return; | 970 | return; |
971 | spin_lock(&clp->cl_lock); | 971 | spin_lock(&clp->cl_lock); |
972 | /* | 972 | /* |
973 | * Only serialized callback code is allowed to clear these | 973 | * Only serialized callback code is allowed to clear these |
974 | * flags; main nfsd code can only set them: | 974 | * flags; main nfsd code can only set them: |
975 | */ | 975 | */ |
976 | BUG_ON(!clp->cl_cb_flags); | 976 | BUG_ON(!(clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK)); |
977 | clear_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_cb_flags); | 977 | clear_bit(NFSD4_CLIENT_CB_UPDATE, &clp->cl_flags); |
978 | memcpy(&conn, &cb->cb_clp->cl_cb_conn, sizeof(struct nfs4_cb_conn)); | 978 | memcpy(&conn, &cb->cb_clp->cl_cb_conn, sizeof(struct nfs4_cb_conn)); |
979 | c = __nfsd4_find_backchannel(clp); | 979 | c = __nfsd4_find_backchannel(clp); |
980 | if (c) { | 980 | if (c) { |
@@ -1000,7 +1000,7 @@ void nfsd4_do_callback_rpc(struct work_struct *w) | |||
1000 | struct nfs4_client *clp = cb->cb_clp; | 1000 | struct nfs4_client *clp = cb->cb_clp; |
1001 | struct rpc_clnt *clnt; | 1001 | struct rpc_clnt *clnt; |
1002 | 1002 | ||
1003 | if (clp->cl_cb_flags) | 1003 | if (clp->cl_flags & NFSD4_CLIENT_CB_FLAG_MASK) |
1004 | nfsd4_process_cb_update(cb); | 1004 | nfsd4_process_cb_update(cb); |
1005 | 1005 | ||
1006 | clnt = clp->cl_cb_client; | 1006 | clnt = clp->cl_cb_client; |