sheepfs/http: read next cache if data of current cache has been read out

When we use command 'tar' to extract a tar-file in http interface of sheepfs,
it report error and quit. The reason is that if a read operation has almost
reach the end of current cache, it will only return the size which has not
been read in CURRENT CACHE at present.
For example, if a read operation want to read 1MB and it already reach the
offset of (63MB + 500K) in current cache, the read() will return 524K even
the file has more data to read. The tool of 'tar' read 10KB every time, so if
its read() return size below 10KB, it will think the file is end and quit
which cause problems.

The solution is simple: if current cache has almost been read out, try to
read data of next cache.

Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
test: add test-case for nog-aligned read() on http interface of sheepfs

Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep/md: add main_fn marker to for_each_object_in_wd()

We should add the main_fn marker to for_each_object_in_wd() because
the function for_each_object_in_wd() could only be called in main
threads at present.

Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>
sheep/md: called get_vnode_info() only once in for_each_object_in_wd()

get_vnode_info() should be called only once in for_each_object_in_wd()
(in the main thread) and the result should be passed to
thread_process_path() as a pthread argument.
This avoids lots of calls to get_vnode_info() and is necessary to pass
our thread checker of the sheepdog tracer.

Signed-off-by: Robin Dong <sanbai@taobao.com>
Signed-off-by: Liu Yuan <namei.unix@gmail.com>