X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fcopytool.c;h=9f66168f003d378708ef80129e4bc654a3359d27;hb=8fcac3f7a25c2d97974d292830dabe1611274085;hp=f89e61d7499b1680dbe7edb658b09b95a8db3520;hpb=3a1e40d92baeb54fa93d527af55105a1e3a4a289;p=fs%2Flustre-release.git diff --git a/lustre/tests/copytool.c b/lustre/tests/copytool.c index f89e61d..9f66168 100644 --- a/lustre/tests/copytool.c +++ b/lustre/tests/copytool.c @@ -39,7 +39,7 @@ * The copytool acts on action requests from Lustre to copy files to and from * an HSM archive system. * - * Note: under Linux, until llapi_copytool_fini is called (or the program is + * Note: under Linux, until llapi_hsm_copytool_fini is called (or the program is * killed), the libcfs module will be referenced and unremovable, * even after Lustre services stop. */ @@ -63,7 +63,7 @@ void handler(int signal ) { * and doesn't remove us from mtab (EINPROGRESS). The lustre client * does successfully unmount and the mount is actually gone, but the * mtab entry remains. So this just makes mtab happier. */ - llapi_copytool_fini(&ctdata); + llapi_hsm_copytool_fini(&ctdata); exit(1); } @@ -94,7 +94,7 @@ int main(int argc, char **argv) { return -EINVAL; } - rc = llapi_copytool_start(&ctdata, argv[optind], 0, + rc = llapi_hsm_copytool_start(&ctdata, argv[optind], 0, ARRAY_SIZE(archives), archives); if (rc < 0) { fprintf(stderr, "Can't start copytool interface: %s\n", @@ -103,46 +103,46 @@ int main(int argc, char **argv) { } if (test) - return -llapi_copytool_fini(&ctdata); + return -llapi_hsm_copytool_fini(&ctdata); printf("Waiting for message from kernel (pid=%d)\n", getpid()); signal(SIGINT, handler); while(1) { - struct hsm_action_list *hal; - struct hsm_action_item *hai; - int msgsize, i = 0; - - rc = llapi_copytool_recv(ctdata, &hal, &msgsize); - if (rc == -ESHUTDOWN) { - fprintf(stderr, "shutting down"); - break; - } - if (rc < 0) { - fprintf(stderr, "Message receive: %s", strerror(-rc)); - break; - } - if (msgsize == 0) - continue; /* msg not for us */ - - printf("Copytool fs=%s archive#=%d item_count=%d\n", - hal->hal_fsname, hal->hal_archive_num, hal->hal_count); - - hai = hai_zero(hal); - while (++i <= hal->hal_count) { - printf("Item %d: action %d reclen %d\n", i, - hai->hai_action, hai->hai_len); - printf(" "DFID" gid="LPU64" cookie="LPU64"\n", - PFID(&hai->hai_fid), hai->hai_gid, - hai->hai_cookie); - hai = hai_next(hai); - } - - llapi_copytool_free(&hal); + struct hsm_action_list *hal; + struct hsm_action_item *hai; + int msgsize, i = 0; + + rc = llapi_hsm_copytool_recv(ctdata, &hal, &msgsize); + if (rc == -ESHUTDOWN) { + fprintf(stderr, "shutting down"); + break; + } + if (rc < 0) { + fprintf(stderr, "Message receive: %s", strerror(-rc)); + break; + } + if (msgsize == 0) + continue; /* msg not for us */ + + printf("Copytool fs=%s archive#=%d item_count=%d\n", + hal->hal_fsname, hal->hal_archive_id, hal->hal_count); + + hai = hai_zero(hal); + while (++i <= hal->hal_count) { + printf("Item %d: action %d reclen %d\n", i, + hai->hai_action, hai->hai_len); + printf(" "DFID" gid="LPU64" cookie="LPU64"\n", + PFID(&hai->hai_fid), hai->hai_gid, + hai->hai_cookie); + hai = hai_next(hai); + } + + llapi_hsm_copytool_free(&hal); } - llapi_copytool_fini(&ctdata); + llapi_hsm_copytool_fini(&ctdata); return -rc; }