From 7a0bd0f561803dd2e8f2cefd43851627f7da2b3f Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Fri, 1 Jul 2016 17:33:05 -0700 Subject: [PATCH] rmtfs: Don't mark memory busy We don't have a way to notice if the remote crashes and free the memory, so for now don't mark it as busy and just hand out the same memory the next time. Signed-off-by: Bjorn Andersson --- sharedmem.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sharedmem.c b/sharedmem.c index 00d85e2..8802fc7 100644 --- a/sharedmem.c +++ b/sharedmem.c @@ -15,7 +15,6 @@ static int rmtfs_mem_enumerate(void); static uint64_t rmtfs_mem_address; static uint64_t rmtfs_mem_size; static void *rmtfs_mem_base; -static bool rmtfs_mem_busy; static int rmtfs_mem_fd; int rmtfs_mem_open(void) @@ -48,11 +47,6 @@ int rmtfs_mem_open(void) int64_t rmtfs_mem_alloc(size_t alloc_size) { - if (rmtfs_mem_busy) { - fprintf(stderr, "[RMTFS] rmtfs shared memory already allocated\n"); - return -EBUSY; - } - if (alloc_size > rmtfs_mem_size) { fprintf(stderr, "[RMTFS] rmtfs shared memory not large enough for allocation request 0x%zx vs 0x%lx\n", @@ -60,14 +54,11 @@ int64_t rmtfs_mem_alloc(size_t alloc_size) return -EINVAL; } - rmtfs_mem_busy = true; - return rmtfs_mem_address; } void rmtfs_mem_free(void) { - rmtfs_mem_busy = false; } void *rmtfs_mem_ptr(unsigned phys_address, size_t len)