Whamcloud - gitweb
LU-5557 mdt: track reint operations in MDS service stats
[fs/lustre-release.git] / libcfs / libcfs / upcall_cache.c
index e481ed7..c794eb6 100644 (file)
@@ -40,6 +40,7 @@
 #define DEBUG_SUBSYSTEM S_SEC
 
 #include <libcfs/lucache.h>
+#include <lnet/types.h>
 
 static struct upcall_cache_entry *alloc_entry(struct upcall_cache *cache,
                                               __u64 key, void *args)
@@ -441,9 +442,9 @@ struct upcall_cache *upcall_cache_init(const char *name, const char *upcall,
        rwlock_init(&cache->uc_upcall_rwlock);
         for (i = 0; i < UC_CACHE_HASH_SIZE; i++)
                INIT_LIST_HEAD(&cache->uc_hashtable[i]);
-       strncpy(cache->uc_name, name, sizeof(cache->uc_name) - 1);
+       strlcpy(cache->uc_name, name, sizeof(cache->uc_name));
        /* upcall pathname proc tunable */
-       strncpy(cache->uc_upcall, upcall, sizeof(cache->uc_upcall) - 1);
+       strlcpy(cache->uc_upcall, upcall, sizeof(cache->uc_upcall));
        cache->uc_entry_expire = 20 * 60;
        cache->uc_acquire_expire = 30;
        cache->uc_ops = ops;