[sheepdog] [PATCH v2] sheep: make epoch_log_read() clean

MORITA Kazutaka morita.kazutaka at gmail.com
Thu Mar 21 15:57:41 CET 2013


At Tue, 19 Mar 2013 11:36:40 +0900,
Hitoshi Mitake wrote:
> 
> Current epoch_log_read() and the way of treating epoch files are
> confusing. Because they heavily depend on the condition:
> sizeof(time_t) < sizeof(struct sd_node). The condition is true
> currently, but this requirement is implicit and hard to understand.
> 
> In addition, epoch_log_read() doesn't handle a rise of EINTR when it
> calls read(). This behavior might cause a subtle bug.
> 
> This patch eliminates the implicit requirement and adds the handling
> of EINTR. For doing it, this patch implements a new function,
> epoch_log_read_with_timestamp(). If callers require a timestamp at
> tails of epoch files, they should call this one instead of
> epoch_log_read().
> 
> Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
> ---
> 
> v2
>  - don't change the member "time" of struct epoch_log for keeping alignment
>  - avoid needless memcpy() for timestamp
> 
>  include/internal_proto.h |    2 +-
>  sheep/group.c            |   18 +++++++++++---
>  sheep/ops.c              |   23 +++++++++++------
>  sheep/sheep_priv.h       |    6 ++++-
>  sheep/store.c            |   59 ++++++++++++++++++++++++++++++++++++---------
>  5 files changed, 82 insertions(+), 26 deletions(-)

This patch cannot be applied to the current master.  Can you rebase
it?

Thanks,

Kazutaka



More information about the sheepdog mailing list