Fixes build failure on the 2.6.36 kernel branch which misses the
vzalloc() function.

Signed-off-by: Michael Jeanson <mjean...@efficios.com>
---
 lttng-events.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lttng-events.c b/lttng-events.c
index b49851b..422a2dd 100644
--- a/lttng-events.c
+++ b/lttng-events.c
@@ -133,7 +133,12 @@ struct lttng_session *lttng_session_create(void)
                        GFP_KERNEL);
        if (!metadata_cache)
                goto err_free_session;
+#if LTTNG_KERNEL_RANGE(2,6,36, 2,6,37)
+       metadata_cache->data = vmalloc(METADATA_CACHE_DEFAULT_SIZE);
+       memset(metadata_cache->data, 0, METADATA_CACHE_DEFAULT_SIZE);
+#else
        metadata_cache->data = vzalloc(METADATA_CACHE_DEFAULT_SIZE);
+#endif
        if (!metadata_cache->data)
                goto err_free_cache;
        metadata_cache->cache_alloc = METADATA_CACHE_DEFAULT_SIZE;
@@ -1531,7 +1536,12 @@ int lttng_metadata_printf(struct lttng_session *session,
                tmp_cache_alloc_size = max_t(unsigned int,
                                session->metadata_cache->cache_alloc + len,
                                session->metadata_cache->cache_alloc << 1);
+#if LTTNG_KERNEL_RANGE(2,6,36, 2,6,37)
+               tmp_cache_realloc = vmalloc(tmp_cache_alloc_size);
+               memset(tmp_cache_realloc, 0, tmp_cache_alloc_size);
+#else
                tmp_cache_realloc = vzalloc(tmp_cache_alloc_size);
+#endif
                if (!tmp_cache_realloc)
                        goto err;
                if (session->metadata_cache->data) {
-- 
1.9.1


_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to