The r variable was created unassigned and lately assigned to -1.
Even if r is always defined before its usage, sounds like initializing it to
what seems a default value (-1) from the beginning is safer for later code
inclusion.
Signed-off-by: Erwan Velu <erwan@redhat.com>
Despite read_pos & last_committed_seq, the seq variable is local and created a
few lines before.
While the reinitiliasation of read_pos & last_commited_seq is useless, the seq
variable is destroyed by the return call.
That makes the "seq = 0" being useless and a dead code. This patch simply
removes it.
Signed-off-by: Erwan Velu <erwan@redhat.com>
This assignement of r is misleading. It does assign a value to r that is never
used by any code.
When the code runs into the while loop, r is always initialized again before any
usage. There isn't any direct jump to the "out" label making this value being
used as a return code.
When the code does exit this while loop, the r value is reassigned before being
used as a return code.
This makes this assignement useless and confusing. This patch simply remove this dead/useless code.
Signed-off-by: Erwan Velu <erwan@redhat.com>
r variable wasn't initialized but set to 0 twice. Once just before an early
"goto out" code and the other before the main code of the function.
This patch simply initialize r to 0 at the begining.
This make the code easier to read and prevent any future call to "out" label without a proper value stored in r.
Signed-off-by: Erwan Velu <erwan@redhat.com>
This part of the code is setting up the ret variable just before returning
false. This code have no effect.
This patch simply remove dead/useless code.
Signed-off-by: Erwan Velu <erwan@redhat.com>
The poolid variable is assigned just before returning ENOENT but this value is
never used.
This patch just remove dead/useless code.
Signed-off-by: Erwan Velu <erwan@redhat.com>
There lacks error check after doing object_map->sync under
sync_entry, which is OK when omap deployed in the same device
with object data, but it is better to add error check in case
object_map->sync failed.
Signed-off-by: Chendi Xue <chendi.xue@intel.com>
qa: disable rbd/qemu-iotests test case 055 on RHEL/CentOSlibrbd: journal replay should honor inter-event dependencies
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
This option involves a tradeoff: When disabled, fragmentation is worse,
but large sequential writes are faster. When enabled, large sequential
writes are slower, but fragmentation is reduced.
Fixes: #14397
This decreases buffer::raw size by about 100 bytes (since RWLock occupies
104 bytes and simple_spinlock_t just 4) and also significantly decreases
time wasted by locking and unlocking, possibly reducing context switches too.
Particularly visible when using small blocksizes.
Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
we can not cast an "int *" pointer to a "bool *" and assign a bool
to it in hope to update the integer pointed by the "int *" with
1 or 0 according to the assigned boolean. because, the existing
value pointed by the "int *" pointer could be any value, if it's
non-zero, say, 0x12345678, after casting to "bool *", and assigning it
to "false", the variable would be 0x12345600. only the least
significant 8 bits are reset. so after resetting the variable pointed
by the "int *" pointer after reset it using "bool *", it still "true"!
Introduced-by: 1f85545
Signed-off-by: Kefu Chai <kchai@redhat.com>
this is a follow-up of 6edaf4e, when tcmalloc is enabled,
perfglue/heap_profiler.cc is also compiled, it includes the
google/heap-profiler.h. so to silence the the warnings like
warning: /usr/include/google/heap-profiler.h:35:2: #warning
"google/heap-profiler.h is deprecated. Use gperftools/heap-profiler.h
instead" [-Wcpp]
we also check the new location of these header files if tcmalloc
is enabled.
Signed-off-by: Kefu Chai <kchai@redhat.com>