staging/lustre/mdt: HSM coordinator client interface
authorJC Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Tue, 26 Nov 2013 02:05:01 +0000 (10:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Nov 2013 03:28:04 +0000 (19:28 -0800)
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.lafoucriere@cea.fr>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/lustre/lustre_user.h
drivers/staging/lustre/lustre/mdc/mdc_request.c

index 9fd1d3ba2a63a82c33a5377a9042affbd9cde137..9436166c6ef215b21bda78807196ac8d545b6089 100644 (file)
@@ -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 */
index a09a5c3141aa15525d3126314458a215f8959fe9..8373778c2e780fbb914fc450b80f3aab594ee5de 100644 (file)
@@ -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)