Message ID | 1627ae51fd2896d5d24748456f1a2e10ad299e8f.1699675570.git.msakai@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/8] dm vdo memory-alloc: remove UDS_ALLOCATE_NOWAIT macro | expand |
diff --git a/drivers/md/dm-vdo/memory-alloc.c b/drivers/md/dm-vdo/memory-alloc.c index 136a19db33be..e9464d4a1e64 100644 --- a/drivers/md/dm-vdo/memory-alloc.c +++ b/drivers/md/dm-vdo/memory-alloc.c @@ -286,13 +286,9 @@ int uds_allocate_memory(size_t size, size_t align, const char *what, void *ptr) if (allocations_restricted) memalloc_noio_restore(noio_flags); - if (p == NULL) { - unsigned int duration = jiffies_to_msecs(jiffies - start_time); - + if (unlikely(p == NULL)) { uds_log_error("Could not allocate %zu bytes for %s in %u msecs", - size, - what, - duration); + size, what, jiffies_to_msecs(jiffies - start_time)); return -ENOMEM; }