Loading lib/blobfs/blobfs.c +8 −6 Original line number Diff line number Diff line Loading @@ -1496,18 +1496,20 @@ cache_insert_buffer(struct spdk_file *file, uint64_t offset) buf->buf = alloc_cache_memory_buffer(file); if (buf->buf == NULL) { while (buf->buf == NULL) { count++; buf->buf = alloc_cache_memory_buffer(file); /* * TODO: __free_oldest_cache() should eventually free some buffers. * Should have a more sophisticated check here, instead of just * bailing if 100 tries does not result in getting a free buffer. * TODO: alloc_cache_memory_buffer() should eventually free * some buffers. Need a more sophisticated check here, instead * of just bailing if 100 tries does not result in getting a * free buffer. This will involve using the sync channel's * semaphore to block until a buffer becomes available. */ if (count == 100) { if (count++ == 100) { SPDK_ERRLOG("could not allocate cache buffer\n"); assert(false); free(buf); return NULL; } buf->buf = alloc_cache_memory_buffer(file); } } Loading Loading
lib/blobfs/blobfs.c +8 −6 Original line number Diff line number Diff line Loading @@ -1496,18 +1496,20 @@ cache_insert_buffer(struct spdk_file *file, uint64_t offset) buf->buf = alloc_cache_memory_buffer(file); if (buf->buf == NULL) { while (buf->buf == NULL) { count++; buf->buf = alloc_cache_memory_buffer(file); /* * TODO: __free_oldest_cache() should eventually free some buffers. * Should have a more sophisticated check here, instead of just * bailing if 100 tries does not result in getting a free buffer. * TODO: alloc_cache_memory_buffer() should eventually free * some buffers. Need a more sophisticated check here, instead * of just bailing if 100 tries does not result in getting a * free buffer. This will involve using the sync channel's * semaphore to block until a buffer becomes available. */ if (count == 100) { if (count++ == 100) { SPDK_ERRLOG("could not allocate cache buffer\n"); assert(false); free(buf); return NULL; } buf->buf = alloc_cache_memory_buffer(file); } } Loading