Whamcloud - gitweb
LU-12811 ptlrpc: pass buffer size to the swabbing functions
[fs/lustre-release.git] / lustre / mdt / mdt_identity.c
index 85d782b..4846345 100644 (file)
 
 #define DEBUG_SUBSYSTEM S_MDS
 
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/kmod.h>
-#include <linux/string.h>
-#include <linux/stat.h>
-#include <linux/errno.h>
-#include <linux/version.h>
-#include <linux/unistd.h>
-#include <asm/uaccess.h>
-#include <linux/fs.h>
-#include <linux/stat.h>
-#include <asm/uaccess.h>
-#include <linux/slab.h>
-
-#include <libcfs/libcfs.h>
-#include <obd.h>
-#include <obd_class.h>
-#include <obd_support.h>
-#include <lustre_net.h>
-#include <lustre_import.h>
-#include <lustre_dlm.h>
-#include <lustre_lib.h>
-
 #include "mdt_internal.h"
 
 static void mdt_identity_entry_init(struct upcall_cache_entry *entry,
@@ -102,7 +78,7 @@ static int mdt_identity_do_upcall(struct upcall_cache *cache,
                   [1] = "PATH=/sbin:/usr/sbin",
                   [2] = NULL
         };
-        struct timeval start, end;
+       ktime_t start, end;
         int rc;
         ENTRY;
 
@@ -120,22 +96,20 @@ static int mdt_identity_do_upcall(struct upcall_cache *cache,
        argv[0] = cache->uc_upcall;
        snprintf(keystr, sizeof(keystr), "%llu", entry->ue_key);
 
-       do_gettimeofday(&start);
+       start = ktime_get();
        rc = call_usermodehelper(argv[0], argv, envp, UMH_WAIT_EXEC);
-       do_gettimeofday(&end);
+       end = ktime_get();
        if (rc < 0) {
-                CERROR("%s: error invoking upcall %s %s %s: rc %d; "
-                       "check /proc/fs/lustre/mdt/%s/identity_upcall, "
-                       "time %ldus\n",
-                       cache->uc_name, argv[0], argv[1], argv[2], rc,
-                       cache->uc_name, cfs_timeval_sub(&end, &start, NULL));
-        } else {
-                CDEBUG(D_HA, "%s: invoked upcall %s %s %s, time %ldus\n",
-                       cache->uc_name, argv[0], argv[1], argv[2],
-                       cfs_timeval_sub(&end, &start, NULL));
-                rc = 0;
-        }
-        EXIT;
+               CERROR("%s: error invoking upcall %s %s %s: rc %d; check /proc/fs/lustre/mdt/%s/identity_upcall, time %ldus\n",
+                      cache->uc_name, argv[0], argv[1], argv[2], rc,
+                      cache->uc_name, (long)ktime_us_delta(end, start));
+       } else {
+               CDEBUG(D_HA, "%s: invoked upcall %s %s %s, time %ldus\n",
+                      cache->uc_name, argv[0], argv[1], argv[2],
+                      (long)ktime_us_delta(end, start));
+               rc = 0;
+       }
+       EXIT;
 out:
        up_read(&cache->uc_upcall_rwsem);
        return rc;