v2 deduplication: bunch neighbour data to punch together

when decide that data is no longer needed, there are two cases:
-if data neighbours previous block of "no needed" data, extend bunch
block(it holds begining and size of concequent "no needed" data) by
length of curent block and go next.
-if data not neighbours bunch block(or bunch block size will be bigger
than MAX_BUNCH_SIZE), than we punch bunch block and set bunch block
to curent block.

in the end make cleanup to punch last bunch block.

changes in v1:
punch_hole takes whole page_read
make restriction more precise

Signed-off-by: Tikhomirov Pavel <snorcht@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dedup: Cleanup checking whether we batch punching or not

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dedup: Print punch offset with %p format

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fsnotify: Don't scan irmap for tempfs

On this fs path can be resolved via proc, so even if
we're asked to do force-irmap, try to go via regular
resolve anyway.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
irmap: Add /lib/udev into hints, fake path and logging

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dedup: Print iov->len with %zu formap

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dedup: Plring iov->len + ulong with %lu format

Fix for the previous patch :\

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pie: Fix pie.lds.S.in script to work with the gold linker

The pie.lds.S.in needs two minor changes to work with the gold (/usr/bin/gold)
linker. These changes are compatible with /usr/bin/ld and make linker script
more portable.

The first change is adding a comma before /DISCARD/ so that the grammar
won't be ambiguous. A Otherwise, gold treats it as a part of the assignment
and would generate a syntax error about the "unexpected ':'".

The second change is moving initialization of __export_parasite_args
to inside the SECTIONS command because it references the dot symbol.
Otherwise, gold would generate the error "invalid reference to dot
symbol outside of SECTIONS clause.

Signed-off-by: Saied Kazemi <saied@google.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: check posix_timer with sival_ptr = NULL

Here is a regresion test cae for

commit 1934e1a9638cdb8cd546cd0499fe7804317593d8
Author: Andrey Vagin <avagin@openvz.org>
Date:   Tue Feb 18 16:53:00 2014 +0400

    posix-timer: take into account that sival_ptr can be NULL (v3)

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
fsnotify: Fix nil dereference in pre_dump_one_fanotify

pre_dump_one_fanotify calls for parse_fdinfo_pid_s where
fsn_params mut not be NULL, otherwise we get nil dereference.

Fix it by passing a real variable instead.

Reported-by: Pavel Tikhomirov <snorcht@gmail.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
arm: parasite: implement arch_get_tls() in C

This patch should simplify the routine interface change
in the following patch.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
arm: prepare syscall table generation scripts to be shared with AArch64

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Documentation: remove the linker command line switch --static from the final step described in the cross-compilation guide

Static linking of the binary criu isn't supported any more.

Reported-by: riya khanna <riyakhanna1983@gmail.com>
Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
asm: convert the ARM implementation of bit operations to the reference

The implementation of bit operations for ARM isn't actually
architecture-specific so it would rather be shared with
the upcoming port for AArch64 that won't provide optimized
implementation of bit operations.

Signed-off-by: Alexander Kartashov <alekskartashov@parallels.com>
Reviewed-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
bitops: Add comment about generic bitops header usage

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
namespace: move struct ns_id into namespace.h

It's going to be used for restoring namespaces. For example we need to
enumirate the ns_ids list for restoring mount namespaces.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>