Whamcloud - gitweb
LU-7988 hsm: remove compound_id from mdt_hsm_add_actions proto 83/19583/14
authorFrank Zago <fzago@cray.com>
Fri, 8 Apr 2016 19:14:29 +0000 (15:14 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 11 Aug 2016 05:50:46 +0000 (05:50 +0000)
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 <fzago@cray.com>
Change-Id: Iabf89497aad2cdf6364c155290c6df44487d8039
Reviewed-on: http://review.whamcloud.com/19583
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Vinayak <vinayakswami.hariharmath@seagate.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_hsm.c
lustre/mdt/mdt_hsm_cdt_client.c
lustre/mdt/mdt_internal.h

index ab0e851..acaa4a7 100644 (file)
@@ -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);
 
index beae5e2..63addc9 100644 (file)
@@ -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);
 }
-
index 68dcde9..3c8ffba 100644 (file)
@@ -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,