From: Frank Zago Date: Fri, 8 Apr 2016 19:14:29 +0000 (-0400) Subject: LU-7988 hsm: remove compound_id from mdt_hsm_add_actions proto X-Git-Tag: 2.8.57~58 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=250e826cd3902cd8e06cb7ee5167f2814219f63f;p=fs%2Flustre-release.git LU-7988 hsm: remove compound_id from mdt_hsm_add_actions proto mdt_hsm_request is the only caller of mdt_hsm_add_actions and it doesn't care about compound_id, so make it a local variable, instead of an output variable. Test-Parameters: trivial testlist=sanity-hsm Signed-off-by: frank zago Change-Id: Iabf89497aad2cdf6364c155290c6df44487d8039 Reviewed-on: http://review.whamcloud.com/19583 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Vinayak Reviewed-by: Patrick Farrell Reviewed-by: Ben Evans Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdt/mdt_hsm.c b/lustre/mdt/mdt_hsm.c index ab0e851..acaa4a7 100644 --- a/lustre/mdt/mdt_hsm.c +++ b/lustre/mdt/mdt_hsm.c @@ -496,7 +496,6 @@ int mdt_hsm_request(struct tgt_session_info *tsi) int hui_list_size; int data_size; enum hsm_copytool_action action = HSMA_NONE; - __u64 compound_id; int hal_size, i, rc; ENTRY; @@ -583,7 +582,7 @@ int mdt_hsm_request(struct tgt_session_info *tsi) hal->hal_count++; } - rc = mdt_hsm_add_actions(info, hal, &compound_id); + rc = mdt_hsm_add_actions(info, hal); MDT_HSM_FREE(hal, hal_size); diff --git a/lustre/mdt/mdt_hsm_cdt_client.c b/lustre/mdt/mdt_hsm_cdt_client.c index beae5e2..63addc9 100644 --- a/lustre/mdt/mdt_hsm_cdt_client.c +++ b/lustre/mdt/mdt_hsm_cdt_client.c @@ -290,13 +290,12 @@ hsm_action_permission(struct mdt_thread_info *mti, * register a list of requests * \param mti [IN] * \param hal [IN] list of requests - * \param compound_id [OUT] id of the compound request * \retval 0 success * \retval -ve failure * in case of restore, caller must hold layout lock */ int mdt_hsm_add_actions(struct mdt_thread_info *mti, - struct hsm_action_list *hal, __u64 *compound_id) + struct hsm_action_list *hal) { struct mdt_device *mdt = mti->mti_mdt; struct coordinator *cdt = &mdt->mdt_coordinator; @@ -305,6 +304,7 @@ int mdt_hsm_add_actions(struct mdt_thread_info *mti, int rc = 0, i; struct md_hsm mh; bool is_restore = false; + __u64 compound_id; ENTRY; /* no coordinator started, so we cannot serve requests */ @@ -314,7 +314,7 @@ int mdt_hsm_add_actions(struct mdt_thread_info *mti, if (!hal_is_sane(hal)) RETURN(-EINVAL); - *compound_id = atomic_inc_return(&cdt->cdt_compound_id); + compound_id = atomic_inc_return(&cdt->cdt_compound_id); /* search for compatible request, if found hai_cookie is set * to the request cookie @@ -452,7 +452,7 @@ int mdt_hsm_add_actions(struct mdt_thread_info *mti, } record: /* record request */ - rc = mdt_agent_record_add(mti->mti_env, mdt, *compound_id, + rc = mdt_agent_record_add(mti->mti_env, mdt, compound_id, archive_id, flags, hai); if (rc) GOTO(out, rc); @@ -600,4 +600,3 @@ int mdt_hsm_get_actions(struct mdt_thread_info *mti, RETURN(0); } - diff --git a/lustre/mdt/mdt_internal.h b/lustre/mdt/mdt_internal.h index 68dcde9..3c8ffba 100644 --- a/lustre/mdt/mdt_internal.h +++ b/lustre/mdt/mdt_internal.h @@ -819,7 +819,7 @@ int mdt_hsm_coordinator_update(struct mdt_thread_info *mti, struct hsm_progress_kernel *pgs); /* mdt/mdt_hsm_cdt_client.c */ int mdt_hsm_add_actions(struct mdt_thread_info *info, - struct hsm_action_list *hal, __u64 *compound_id); + struct hsm_action_list *hal); int mdt_hsm_get_actions(struct mdt_thread_info *mti, struct hsm_action_list *hal); int mdt_hsm_get_running(struct mdt_thread_info *mti,