Whamcloud - gitweb
LU-10515 utils: remove obd.c dependencies from lustre_rsync 70/30870/4
authorJohn L. Hammond <john.hammond@intel.com>
Mon, 15 Jan 2018 19:15:07 +0000 (13:15 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 25 Jan 2018 04:48:10 +0000 (04:48 +0000)
lustre_rsync does not depend on /dev/obd and therefore should not call
register_ioc_dev(OBD_DEV_ID, OBD_DEV_PATH). So remove the
call. Replace erroneous uses of D_TRACE with the locally defined
DTRACE constant. Remove unneeded includes.

Test-Parameters: trivial testlist=lustre-rsync-test

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I3251469d48f4c60106dd14d1bf97e159a147688c
Reviewed-on: https://review.whamcloud.com/30870
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/utils/lustre_rsync.c

index 2e23ccb..b78afab 100644 (file)
 #include <time.h>
 #include <sys/xattr.h>
 #include <linux/types.h>
-#include <linux/lustre/lustre_ioctl.h>
 
-#include <libcfs/util/ioctl.h>
 #include <libcfs/util/string.h>
-#include <libcfs/util/parser.h>
-#include <linux/lnet/libcfs_debug.h>
 #include <lustre/lustreapi.h>
 #include "lustre_rsync.h"
 
@@ -238,16 +234,6 @@ void lr_usage()
                 "\t--dry-run        don't write anything\n");
 }
 
-#define DEBUG_ENTRY(info)                                                     \
-       lr_debug(D_TRACE, "***** Start %lld %s (%d) %s %s %s *****\n",         \
-                (info)->recno, changelog_type2str((info)->type),              \
-                (info)->type, (info)->tfid, (info)->pfid, (info)->name);
-
-#define DEBUG_EXIT(info, rc)                                                  \
-       lr_debug(D_TRACE, "##### End %lld %s (%d) %s %s %s rc=%d #####\n",     \
-                (info)->recno, changelog_type2str((info)->type),              \
-                (info)->type, (info)->tfid, (info)->pfid, (info)->name, rc);
-
 /* Print debug information. This is controlled by the value of the
    global variable 'debug' */
 void lr_debug(int level, const char *fmt, ...)
@@ -1599,7 +1585,9 @@ int lr_replicate()
                 if (dryrun)
                         continue;
 
-               DEBUG_ENTRY(info);
+               lr_debug(DTRACE, "***** Start %lld %s (%d) %s %s %s *****\n",
+                        info->recno, changelog_type2str(info->type),
+                        info->type, info->tfid, info->pfid, info->name);
 
                 switch(info->type) {
                 case CL_CREATE:
@@ -1635,7 +1623,11 @@ int lr_replicate()
                default:
                        break;
                }
-               DEBUG_EXIT(info, rc);
+
+               lr_debug(DTRACE, "##### End %lld %s (%d) %s %s %s rc=%d #####\n",
+                        info->recno, changelog_type2str(info->type),
+                        info->type, info->tfid, info->pfid, info->name, rc);
+
                 if (rc && rc != -ENOENT) {
                         lr_print_failure(info, rc);
                         errors++;
@@ -1820,10 +1812,6 @@ int main(int argc, char *argv[])
                 return -1;
         }
 
-        /* This plumbing is needed for some of the ioctls behind
-           llapi calls to work. */
-       register_ioc_dev(OBD_DEV_ID, OBD_DEV_PATH);
-
         rc = lr_locate_rsync();
         if (use_rsync && rc != 0) {
                 fprintf(stderr, "Error: unable to locate %s.\n", RSYNC);