local: return false for all blocking events in local_process_event

This fixes a regression in

   "cluster/local: process multiple events in local_handler"

after that patch we may busy loop under the shared memory area lock
when waiting for a join request to be answered, or when another
blocking even arrives while one is already beeing processed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
cluster/corosync: fix double call to sd_block_handler

After corosync_unblock() is called and before the unblock message is
delived, sheep can perform the same block event which was previously
peformed.  It is because cluster_op_running is false during the time.
This fixes the race condition.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
farm: add flock in read_working_object()

We should lock the object when read it in read_working_object
just as we did in farm_read

Signed-off-by: levin li <xingke.lwp@taobao.com>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: fix type warnings on 32 bit machines

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
configure: remove farm option

farm is the only storage driver now, so we cannot disable it.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
work: fix exit_work_queue compile error

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
configure: exit if --enable-trace is used with debug options

Sheepdog tracer assumes that inline functions are inlined, so we
cannot use it with the gcc -O0 option.

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
configure: exit if --enable-trace is specified on non x86_64 architectures

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
configure: disable tracer for 0.4.0 release

Current tracer can't work with fully dynamic(short) worker threads due to its
per thread ring buffer implementation, as it can in fact only work with static
threads.

Some of its infrastructure needs rewriting to adopt it to short threads. For now
let's disable it.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
farm: remove unused zlib.h header

We don't need it at all for now

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

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
sheep: built-in two std headers for util.h

Without, we have to include these two headers every time in source file to avoid
compile error.

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
gateway: refactor write and remove functions

They share almost the same logic, so let's extract the core out and wrap it a
stand-alone function.

- add sheep_do_op_work()
- opencode do_gateway_write_obj()

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
gateway: init forward hrd in gateway_forward_request()

- add a helper to init hdr
- add a map table to mape gateway opcode to peer opcode

Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
script: fix simple2farm unary operator error

Fit this: fix simple2farm: line 31: [: ==: unary operator expected

Signed-off-by: Jens Weber <jweber@tek2b.org>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: print symbolic command names

Printing the commands as plain text instead of an opcode makes debugging
a lot easier.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: improve cluster request debugging

Add a few more printfs, print the symbolic command name where available.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: log a message when retrying requests

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: factor cache update out of object_cache_rw

We'll grow another copy of this code soon, so move it into a separate
function in preparation of that.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>
sheep: simplify object_cache_read

Just call read_cache_object directly instead of going through the effort
of finding a cache object and faking up a request first.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Liu Yuan <tailai.ly@taobao.com>