From 8d91c1e411f55d7ea91b1183a2e9f8088fb4d5be Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Tue, 15 Dec 2015 14:52:16 -0300 Subject: Linux-libre 4.3.2-gnu --- .../staging/lustre/include/linux/libcfs/libcfs.h | 15 +++++++++++- .../lustre/include/linux/libcfs/libcfs_debug.h | 1 - .../lustre/include/linux/libcfs/libcfs_fail.h | 18 +++++++------- .../lustre/include/linux/libcfs/libcfs_private.h | 28 +--------------------- .../lustre/include/linux/libcfs/libcfs_string.h | 2 -- .../staging/lustre/include/linux/lnet/lib-lnet.h | 2 +- 6 files changed, 26 insertions(+), 40 deletions(-) (limited to 'drivers/staging/lustre/include/linux') diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 5dd9cdfae..01961d9e6 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -134,7 +134,7 @@ void cfs_get_random_bytes(void *buf, int size); /* container_of depends on "likely" which is defined in libcfs_private.h */ static inline void *__container_of(void *ptr, unsigned long shift) { - if (unlikely(IS_ERR(ptr) || ptr == NULL)) + if (IS_ERR_OR_NULL(ptr)) return ptr; return (char *)ptr - shift; } @@ -148,4 +148,17 @@ void *libcfs_kvzalloc(size_t size, gfp_t flags); void *libcfs_kvzalloc_cpt(struct cfs_cpt_table *cptab, int cpt, size_t size, gfp_t flags); +extern struct miscdevice libcfs_dev; +/** + * The path of debug log dump upcall script. + */ +extern char lnet_upcall[1024]; +extern char lnet_debug_log_upcall[1024]; + +extern void libcfs_init_nidstrings(void); + +extern struct cfs_psdev_ops libcfs_psdev_ops; + +extern struct cfs_wi_sched *cfs_sched_rehash; + #endif /* _LIBCFS_H */ diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index 8251ac932..a3aa64415 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -50,7 +50,6 @@ extern unsigned int libcfs_stack; extern unsigned int libcfs_debug; extern unsigned int libcfs_printk; extern unsigned int libcfs_console_ratelimit; -extern unsigned int libcfs_watchdog_ratelimit; extern unsigned int libcfs_console_max_delay; extern unsigned int libcfs_console_min_delay; extern unsigned int libcfs_console_backoff; diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h index eea55d94e..aa69c6a33 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_fail.h @@ -79,14 +79,16 @@ static inline int cfs_fail_check_set(__u32 id, __u32 value, { int ret = 0; - if (unlikely(CFS_FAIL_PRECHECK(id) && - (ret = __cfs_fail_check_set(id, value, set)))) { - if (quiet) { - CDEBUG(D_INFO, "*** cfs_fail_loc=%x, val=%u***\n", - id, value); - } else { - LCONSOLE_INFO("*** cfs_fail_loc=%x, val=%u***\n", - id, value); + if (unlikely(CFS_FAIL_PRECHECK(id))) { + ret = __cfs_fail_check_set(id, value, set); + if (ret) { + if (quiet) { + CDEBUG(D_INFO, "*** cfs_fail_loc=%x, val=%u***\n", + id, value); + } else { + LCONSOLE_INFO("*** cfs_fail_loc=%x, val=%u***\n", + id, value); + } } } diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index ed37d26eb..9544860e3 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -87,24 +87,6 @@ do { \ lbug_with_loc(&msgdata); \ } while (0) -extern atomic_t libcfs_kmemory; -/* - * Memory - */ - -# define libcfs_kmem_inc(ptr, size) \ -do { \ - atomic_add(size, &libcfs_kmemory); \ -} while (0) - -# define libcfs_kmem_dec(ptr, size) \ -do { \ - atomic_sub(size, &libcfs_kmemory); \ -} while (0) - -# define libcfs_kmem_read() \ - atomic_read(&libcfs_kmemory) - #ifndef LIBCFS_VMALLOC_SIZE #define LIBCFS_VMALLOC_SIZE (2 << PAGE_CACHE_SHIFT) /* 2 pages */ #endif @@ -121,14 +103,9 @@ do { \ if (unlikely((ptr) == NULL)) { \ CERROR("LNET: out of memory at %s:%d (tried to alloc '" \ #ptr "' = %d)\n", __FILE__, __LINE__, (int)(size)); \ - CERROR("LNET: %d total bytes allocated by lnet\n", \ - libcfs_kmem_read()); \ } else { \ memset((ptr), 0, (size)); \ - libcfs_kmem_inc((ptr), (size)); \ - CDEBUG(D_MALLOC, "alloc '" #ptr "': %d at %p (tot %d).\n", \ - (int)(size), (ptr), libcfs_kmem_read()); \ - } \ + } \ } while (0) /** @@ -180,9 +157,6 @@ do { \ "%s:%d\n", s, __FILE__, __LINE__); \ break; \ } \ - libcfs_kmem_dec((ptr), s); \ - CDEBUG(D_MALLOC, "kfreed '" #ptr "': %d at %p (tot %d).\n", \ - s, (ptr), libcfs_kmem_read()); \ if (unlikely(s > LIBCFS_VMALLOC_SIZE)) \ vfree(ptr); \ else \ diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h index 509dc1e5c..478e9582f 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h @@ -102,6 +102,4 @@ int cfs_ip_addr_parse(char *str, int len, struct list_head *list); int cfs_ip_addr_match(__u32 addr, struct list_head *list); void cfs_ip_addr_free(struct list_head *list); -#define strtoul(str, endp, base) simple_strtoul(str, endp, base) - #endif diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index a9c9a077c..bc3d907fd 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -680,7 +680,7 @@ void lnet_debug_peer(lnet_nid_t nid); static inline void lnet_peer_set_alive(lnet_peer_t *lp) { - lp->lp_last_alive = lp->lp_last_query = get_seconds(); + lp->lp_last_alive = lp->lp_last_query = jiffies; if (!lp->lp_alive) lnet_notify_locked(lp, 0, 1, lp->lp_last_alive); } -- cgit v1.2.3-54-g00ecf