diff options
author | J. Bruce Fields <bfields@redhat.com> | 2012-11-05 15:10:26 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-11-07 19:40:04 -0500 |
commit | 57725155dc1b8c78b7a96886d5cdc69dc89e9c54 (patch) | |
tree | 41f86cc189fe5a04b661e3fa8fab415d52569175 | |
parent | cb73a9f4649bf63c0397e565a15abf8a91ecf56f (diff) |
nfsd4: common helper to initialize callback work
I've found it confusing having the only references to
nfsd4_do_callback_rpc() in a different file.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/nfsd/nfs4callback.c | 7 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 4 | ||||
-rw-r--r-- | fs/nfsd/state.h | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index b32639ee0a42..a1aa18db08fb 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -1016,7 +1016,7 @@ static void nfsd4_process_cb_update(struct nfsd4_callback *cb) | |||
1016 | run_nfsd4_cb(cb); | 1016 | run_nfsd4_cb(cb); |
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | void nfsd4_do_callback_rpc(struct work_struct *w) | 1019 | static void nfsd4_do_callback_rpc(struct work_struct *w) |
1020 | { | 1020 | { |
1021 | struct nfsd4_callback *cb = container_of(w, struct nfsd4_callback, cb_work); | 1021 | struct nfsd4_callback *cb = container_of(w, struct nfsd4_callback, cb_work); |
1022 | struct nfs4_client *clp = cb->cb_clp; | 1022 | struct nfs4_client *clp = cb->cb_clp; |
@@ -1036,6 +1036,11 @@ void nfsd4_do_callback_rpc(struct work_struct *w) | |||
1036 | cb->cb_ops, cb); | 1036 | cb->cb_ops, cb); |
1037 | } | 1037 | } |
1038 | 1038 | ||
1039 | void nfsd4_init_callback(struct nfsd4_callback *cb) | ||
1040 | { | ||
1041 | INIT_WORK(&cb->cb_work, nfsd4_do_callback_rpc); | ||
1042 | } | ||
1043 | |||
1039 | void nfsd4_cb_recall(struct nfs4_delegation *dp) | 1044 | void nfsd4_cb_recall(struct nfs4_delegation *dp) |
1040 | { | 1045 | { |
1041 | struct nfsd4_callback *cb = &dp->dl_recall; | 1046 | struct nfsd4_callback *cb = &dp->dl_recall; |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 4023e77687ee..13f3471b02a2 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -340,7 +340,7 @@ alloc_init_deleg(struct nfs4_client *clp, struct nfs4_ol_stateid *stp, struct sv | |||
340 | fh_copy_shallow(&dp->dl_fh, ¤t_fh->fh_handle); | 340 | fh_copy_shallow(&dp->dl_fh, ¤t_fh->fh_handle); |
341 | dp->dl_time = 0; | 341 | dp->dl_time = 0; |
342 | atomic_set(&dp->dl_count, 1); | 342 | atomic_set(&dp->dl_count, 1); |
343 | INIT_WORK(&dp->dl_recall.cb_work, nfsd4_do_callback_rpc); | 343 | nfsd4_init_callback(&dp->dl_recall); |
344 | return dp; | 344 | return dp; |
345 | } | 345 | } |
346 | 346 | ||
@@ -1313,7 +1313,7 @@ static struct nfs4_client *create_client(struct xdr_netobj name, char *recdir, | |||
1313 | INIT_LIST_HEAD(&clp->cl_lru); | 1313 | INIT_LIST_HEAD(&clp->cl_lru); |
1314 | INIT_LIST_HEAD(&clp->cl_callbacks); | 1314 | INIT_LIST_HEAD(&clp->cl_callbacks); |
1315 | spin_lock_init(&clp->cl_lock); | 1315 | spin_lock_init(&clp->cl_lock); |
1316 | INIT_WORK(&clp->cl_cb_null.cb_work, nfsd4_do_callback_rpc); | 1316 | nfsd4_init_callback(&clp->cl_cb_null); |
1317 | clp->cl_time = get_seconds(); | 1317 | clp->cl_time = get_seconds(); |
1318 | clear_bit(0, &clp->cl_cb_slot_busy); | 1318 | clear_bit(0, &clp->cl_cb_slot_busy); |
1319 | rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table"); | 1319 | rpc_init_wait_queue(&clp->cl_cb_waitq, "Backchannel slot table"); |
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 758bc9c2646b..0fd342a2174e 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -470,10 +470,10 @@ extern __be32 nfs4_check_open_reclaim(clientid_t *clid, bool sessions); | |||
470 | extern void nfs4_free_openowner(struct nfs4_openowner *); | 470 | extern void nfs4_free_openowner(struct nfs4_openowner *); |
471 | extern void nfs4_free_lockowner(struct nfs4_lockowner *); | 471 | extern void nfs4_free_lockowner(struct nfs4_lockowner *); |
472 | extern int set_callback_cred(void); | 472 | extern int set_callback_cred(void); |
473 | extern void nfsd4_init_callback(struct nfsd4_callback *); | ||
473 | extern void nfsd4_probe_callback(struct nfs4_client *clp); | 474 | extern void nfsd4_probe_callback(struct nfs4_client *clp); |
474 | extern void nfsd4_probe_callback_sync(struct nfs4_client *clp); | 475 | extern void nfsd4_probe_callback_sync(struct nfs4_client *clp); |
475 | extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *); | 476 | extern void nfsd4_change_callback(struct nfs4_client *clp, struct nfs4_cb_conn *); |
476 | extern void nfsd4_do_callback_rpc(struct work_struct *); | ||
477 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); | 477 | extern void nfsd4_cb_recall(struct nfs4_delegation *dp); |
478 | extern int nfsd4_create_callback_queue(void); | 478 | extern int nfsd4_create_callback_queue(void); |
479 | extern void nfsd4_destroy_callback_queue(void); | 479 | extern void nfsd4_destroy_callback_queue(void); |