NFSv4: Split out NFS v4.2 copy completion functions
Subsystems (2)
PATCH 1/1 NFSv4: Split out NFS v4.2 copy completion functions
From: Anna Schumaker <[email protected]>
The convention in the rest of the code is to have a separate function for anything that might be ifdef-ed out.
Signed-off-by Anna Schumaker <[email protected]>
--- fs/nfs/nfs4state.c | 41 ++++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 15 deletions(-)
fs/nfs/nfs4state.c +26 -15
@@ -1549,6 +1549,31 @@ static int nfs4_reclaim_locks(struct nfs4_state *state, const struct nfs4_state_return status; } +#ifdef CONFIG_NFS_V4_2 +static void nfs42_complete_copies (struct nfs4_state_owner *sp,struct nfs4_state *state) +{ +struct nfs4_copy_state *copy; + +if (!test_bit (NFS_CLNT_DST_SSC_COPY_STATE , &state->flags)) +return ; + +spin_lock (&sp->so_server->nfs_client->cl_lock); +list_for_each_entry (copy, &sp->so_server->ss_copies, copies) { +if (nfs4_stateid_match_other (&state->stateid, ©->parent_state->stateid)) +continue ; + copy->flags =1 ; +complete (©->completion); +break ; + } +spin_unlock (&sp->so_server->nfs_client->cl_lock); +} +#else /* !CONFIG_NFS_V4_2 */ +static inline void nfs42_complete_copies (struct nfs4_state_owner *sp, +struct nfs4_state *state) +{ +} +#endif /* CONFIG_NFS_V4_2 */ +static int __nfs4_reclaim_open_state (struct nfs4_state_owner *sp,struct nfs4_state *state,const struct nfs4_state_recovery_ops *ops) {
@@ -1572,21 +1597,7 @@ static int __nfs4_reclaim_open_state(struct nfs4_state_owner *sp, struct nfs4_stspin_unlock (&state->state_lock); } -#ifdef CONFIG_NFS_V4_2 -if (test_bit (NFS_CLNT_DST_SSC_COPY_STATE , &state->flags)) { -struct nfs4_copy_state *copy; -spin_lock (&sp->so_server->nfs_client->cl_lock); -list_for_each_entry (copy, &sp->so_server->ss_copies, copies) { -if (nfs4_stateid_match_other (&state->stateid, ©->parent_state->stateid)) -continue ; - copy->flags =1 ; -complete (©->completion); -break ; - } -spin_unlock (&sp->so_server->nfs_client->cl_lock); - } -#endif /* CONFIG_NFS_V4_2 */ - +nfs42_complete_copies (sp, state);clear_bit (NFS_STATE_RECLAIM_NOGRACE , &state->flags);return status; }
Signature · 1 line
2.19.0