make: LIBS should not be in prerequisites

Use them explicitly. This fixes problem

 |  LINK     crtools
 | /usr/lib/librt.so: could not read symbols: File in wrong format
 | collect2: ld returned 1 exit status
 | make[1]: *** [crtools] Error 1
 | make: *** [all] Error 2

Acked-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
files: Print symbolic meaning of file restoring status

 |	Restoring fd 5 (state -> create)
 |		Create fd for 5
 |			Going to dup 5 into 5
 |	Restoring fd 0 (state -> receive)

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
proc_parse.c: Add read_proc_selffd_link helper

It'll be needed for fifo restore and dump_one_reg_file,
so make a common routine.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
dump: Use read_proc_selffd_link in dump_one_reg_file

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Rename PIPE_NONALIG_DATA to PIPE_MAX_NONALIG_SIZE

And make it dep. on PIPE_DEF_BUFFERS, this points to
a limit from kernel side.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
types: Add PAGE_MASK

Will need it for pipes data dumping.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Add dump_one_pipe_data helpers

Will need it for fifo data dumping. At moment
the helper is pushed out of compilation procedure
for easier review, and will be real used in next
patch.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Make dump_one_pipe to use dump_one_pipe_data

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Make pipes_with_data being static

There is no need to make it xmalloc'ed, it's
global for all processes dumped.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Eliminate parasite \t

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Cleanup for pipes.h

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Add missing void into func arguments

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Get rid of dangling line in dump_pipe

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Reorder functions

Checkpoint and restore do use fdtype_ops
and file_desc_ops intensively so reorder
pipes functions, this allow us to make
them static and drop additional declarations.

No func changes.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Shrink pipe_should_open_transport to want_transport

It's static function near the file_desc_ops,
no need for a long name.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Style tune up for pipe_info members

 - align members
 - comment with empty line

No func changes.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Add missing curve braces to list_for_each_entry

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Don't call for restore_fown if open failed

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Add c/r for fifo files

Basically pipes are superset over fifos,
so we integrate fifo c/r into pipes.c.

There os acatually a trick used to open fifo files --
since fifo may block on opening we create a fake fifo
to be able to proceed without sleeping.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
pipes: Don't forget to init pipe_info::create

Otherwise its value might be taken from heap (it's xmalloc'ed).

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>