sheep: teach journal file to handle epoch and config write

journal_write_epoch and journal_write_confi is a placeholder for future use.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: use new journal API for config file

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: rename journal_file.c as journal.c

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: journaling epoch file write

Also bundle two writes into one.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: handle broken epoch file at get_latest_epoch

Without journaling enabled, we might have empty epoch file or
partial write file.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
collie: rename SUBCMD_FLAG_NEED_THIRD_ARG

THIRD is very misleading and this is a prepare patch.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
collie: introduce do_generic_subcommand()

This helper will check required argument if SUBCMD_FLAG_NEED_ARG is set and
call update_node_list if SUBCMD_FLAG_NEED_NODELIST is set.

Argument check is fatal to fix segfault by later patch.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
collie: fix segfault when required argument is not set

Currently, command like 'collie node md plug' without arugment will cause 
segfault because the lack of the argument check.

Use do_generic_subcommand() helper to fix this problem.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>