Whamcloud - gitweb
LU-5710 all: second batch of corrected typos and grammar errors
[fs/lustre-release.git] / lustre / utils / lhsmtool_posix.c
index 12ead32..8eef8e6 100644 (file)
@@ -43,6 +43,7 @@
 #include <dirent.h>
 #include <errno.h>
 #include <getopt.h>
+#include <pthread.h>
 #include <time.h>
 #include <utime.h>
 #include <sys/time.h>
 # define NSEC_PER_SEC 1000000000UL
 #endif
 
-/* copytool uses a 32b bitmask field to register with kuc
- * archive num = 0 => all
- * archive num from 1 to 32
- */
-#define MAX_ARCHIVE_CNT (sizeof(__u32) * 8)
-
 enum ct_action {
        CA_IMPORT = 1,
        CA_REBIND,
@@ -86,7 +81,7 @@ struct options {
        int                      o_verbose;
        int                      o_copy_xattrs;
        int                      o_archive_cnt;
-       int                      o_archive_id[MAX_ARCHIVE_CNT];
+       int                      o_archive_id[LL_HSM_MAX_ARCHIVE];
        int                      o_report_int;
        unsigned long long       o_bandwidth;
        size_t                   o_chunk_size;
@@ -246,11 +241,11 @@ static int ct_parseopts(int argc, char * const *argv)
                                long_opts, NULL)) != -1) {
                switch (c) {
                case 'A':
-                       if ((opt.o_archive_cnt >= MAX_ARCHIVE_CNT) ||
-                           (atoi(optarg) >= MAX_ARCHIVE_CNT)) {
+                       if ((opt.o_archive_cnt >= LL_HSM_MAX_ARCHIVE) ||
+                           (atoi(optarg) >= LL_HSM_MAX_ARCHIVE)) {
                                rc = -E2BIG;
                                CT_ERROR(rc, "archive number must be less"
-                                        "than %zu", MAX_ARCHIVE_CNT);
+                                        "than %zu", LL_HSM_MAX_ARCHIVE);
                                return rc;
                        }
                        opt.o_archive_id[opt.o_archive_cnt] = atoi(optarg);
@@ -352,7 +347,7 @@ static int ct_parseopts(int argc, char * const *argv)
        CT_TRACE("action=%d src=%s dst=%s mount_point=%s",
                 opt.o_action, opt.o_src, opt.o_dst, opt.o_mnt);
 
-       if (!opt.o_dry_run && opt.o_hsm_root == NULL) {
+       if (opt.o_hsm_root == NULL) {
                rc = -EINVAL;
                CT_ERROR(rc, "must specify a root directory for the backend");
                return rc;
@@ -1655,7 +1650,7 @@ static int ct_rebind_list(const char *list)
        if (line)
                free(line);
 
-       /* return 0 if all rebinds were sucessful */
+       /* return 0 if all rebinds were successful */
        CT_TRACE("%u lines read from '%s', %u rebind successful", nl, list, ok);
 
        return ok == nl ? 0 : -1;