From: JC Lafoucriere <jacques-charles.lafoucri...@cea.fr>

This patch implements the HSM coordinator methods
used by client to add/remove/list HSM actions on
FID.

Lustre-change: http://review.whamcloud.com/6532
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3341
Signed-off-by: JC Lafoucriere <jacques-charles.lafoucri...@cea.fr>
Reviewed-by: John L. Hammond <john.hamm...@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xi...@intel.com>
Reviewed-by: Andreas Dilger <andreas.dil...@intel.com>
Signed-off-by: Peng Tao <bergw...@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dil...@intel.com>
---
 .../lustre/lustre/include/lustre/lustre_user.h     |    7 +++----
 drivers/staging/lustre/lustre/mdc/mdc_request.c    |    4 +---
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h 
b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
index 9fd1d3b..9436166 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h
@@ -1121,11 +1121,10 @@ static inline int hal_size(struct hsm_action_list *hal)
 
        sz = sizeof(*hal) + cfs_size_round(strlen(hal->hal_fsname));
        hai = hai_zero(hal);
-       for (i = 0 ; i < hal->hal_count ; i++) {
+       for (i = 0; i < hal->hal_count; i++, hai = hai_next(hai))
                sz += cfs_size_round(hai->hai_len);
-               hai = hai_next(hai);
-       }
-       return(sz);
+
+       return sz;
 }
 
 /* Copytool progress reporting */
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c 
b/drivers/staging/lustre/lustre/mdc/mdc_request.c
index a09a5c3..8373778 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_request.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c
@@ -1919,10 +1919,8 @@ static void lustre_swab_hal(struct hsm_action_list *h)
        __swab32s(&h->hal_archive_id);
        __swab64s(&h->hal_flags);
        hai = hai_zero(h);
-       for (i = 0; i < h->hal_count; i++) {
+       for (i = 0; i < h->hal_count; i++, hai = hai_next(hai))
                lustre_swab_hai(hai);
-               hai = hai_next(hai);
-       }
 }
 
 static void lustre_swab_kuch(struct kuc_hdr *l)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to