Whamcloud - gitweb
LU-6261 gnilnd: Fix LIBCFS_ALLOC_POST incompatibility. 35/15435/2
authorChris Horn <hornc@cray.com>
Mon, 29 Jun 2015 18:54:34 +0000 (13:54 -0500)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 25 Jul 2015 03:08:12 +0000 (03:08 +0000)
master has changed LIBCFS_ALLOC to use vzalloc so LIBCFS_ALLOC_POST
does not contain a memset anymore.
kgnilnd_vmalloc() used LIBCFS_ALLOC_POST to zero memory allocated but
master removed the memset in favor of using vzalloc.
Use the __GFP_ZERO flag in (now named) kgnilnd_vzalloc to zero memory
allocated.

Signed-off-by: Chris Horn <hornc@cray.com>
Change-Id: Ia014c18f13e4e263eccb51d49d375fc4b3bc8b61
Reviewed-on: http://review.whamcloud.com/15435
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: James Shimek <jshimek@cray.com>
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lnet/klnds/gnilnd/gnilnd.c
lnet/klnds/gnilnd/gnilnd.h

index d29749e..285c5b0 100644 (file)
@@ -249,7 +249,7 @@ kgnilnd_create_conn(kgn_conn_t **connp, kgn_device_t *dev)
        }
 
        conn->gnc_tx_ref_table =
-               kgnilnd_vmalloc(GNILND_MAX_MSG_ID * sizeof(void *));
+               kgnilnd_vzalloc(GNILND_MAX_MSG_ID * sizeof(void *));
        if (conn->gnc_tx_ref_table == NULL) {
                CERROR("Can't allocate conn tx_ref_table\n");
                GOTO(failed, rc = -ENOMEM);
index 2b9c039..b75d850 100644 (file)
@@ -964,9 +964,10 @@ static inline int kgnilnd_trylock(struct mutex *cq_lock,
                return __kgnilnd_mutex_trylock(c_lock);
 }
 
-static inline void *kgnilnd_vmalloc(int size)
+static inline void *kgnilnd_vzalloc(int size)
 {
-       void *ret = __vmalloc(size, __GFP_HIGHMEM | GFP_NOFS, PAGE_KERNEL);
+       void *ret = __vmalloc(size, __GFP_HIGHMEM | GFP_NOFS | __GFP_ZERO,
+                             PAGE_KERNEL);
        LIBCFS_ALLOC_POST(ret, size);
        return ret;
 }