blobfs: Remove unnecessary if statement.
Change-Id: I9134ffcb9713e0613de61d3178940390291dc287 Signed-off-by: Ziye Yang <optimistyzy@gmail.com> Reviewed-on: https://review.gerrithub.io/372621 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
1c83074299
commit
b4511e39fd
@ -1604,23 +1604,21 @@ 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) {
|
||||
/*
|
||||
* 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) {
|
||||
SPDK_ERRLOG("could not allocate cache buffer\n");
|
||||
assert(false);
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
buf->buf = alloc_cache_memory_buffer(file);
|
||||
while (buf->buf == NULL) {
|
||||
/*
|
||||
* 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) {
|
||||
SPDK_ERRLOG("could not allocate cache buffer\n");
|
||||
assert(false);
|
||||
free(buf);
|
||||
return NULL;
|
||||
}
|
||||
buf->buf = alloc_cache_memory_buffer(file);
|
||||
}
|
||||
|
||||
buf->buf_size = CACHE_BUFFER_SIZE;
|
||||
|
Loading…
Reference in New Issue
Block a user