From b0094482bba79f198f1fe37af3627694428fc6c6 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Mon, 15 Jan 2018 13:15:07 -0600 Subject: [PATCH] LU-10515 utils: remove obd.c dependencies from lustre_rsync 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 Change-Id: I3251469d48f4c60106dd14d1bf97e159a147688c Reviewed-on: https://review.whamcloud.com/30870 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Dmitry Eremin Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/utils/lustre_rsync.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/lustre/utils/lustre_rsync.c b/lustre/utils/lustre_rsync.c index 2e23ccb..b78afab 100644 --- a/lustre/utils/lustre_rsync.c +++ b/lustre/utils/lustre_rsync.c @@ -120,12 +120,8 @@ #include #include #include -#include -#include #include -#include -#include #include #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); -- 1.8.3.1