criu/include
Kir Kolyshkin 447388d79b open_proc() and friends: hide pid_dir
This patch tries to introduce lazy and hidden pid_dir support,
meaning one don't have to worry about pid_dir but the optimization
is still there.

The patch relies on the fact that we work with many /proc/pid files for
one pid, then for another pid and so on, i.e. not in a random manner.

The idea is when we call open_proc() with a new pid for the first time,
the appropriate /proc/PID directory is opened and its fd is stored.
Next call to open_proc() with the same PID only need to check that
the PID is not changed. In case PID is changed, we close the old one
and open/store a new one.

Now the code using open_proc() and friends:
- does not need to carry proc_pid around, pid is enough
- does not need to call open_pid_proc()

The only thing that can't be done in that "lazy" mode is closing the last
PID fd, thus close_pid_proc().

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
2012-02-17 16:46:25 +04:00
..
atomic.h Gather futex helpers into lock.h 2011-12-26 23:54:18 +04:00
bitops.h restore: Add mutexes via futex syscall and order threads creation 2011-11-18 16:09:01 +04:00
compiler.h compiler: Add compiler noinline attribute and barrier helper 2012-02-14 17:18:09 +04:00
crtools.h IPC: dump semaphores set 2012-02-15 13:33:46 +04:00
files.h restore: Learn to work with shared struct file-s 2012-01-11 16:01:44 +04:00
image.h IPC: dump semaphores set 2012-02-15 13:33:46 +04:00
inet_diag.h Trivial whitespace cleanup 2012-01-30 21:29:42 +04:00
ipc_ns.h IPC: show semaphores set 2012-02-15 13:33:46 +04:00
libnetlink.h net: Define named constant for nlmsg_seq 2011-12-27 20:13:18 +04:00
list.h list: Cleanup spaces/tabs mess 2012-02-01 14:38:49 +04:00
lock.h lock: add a new primitive cr_wait_until_greater (v2) 2012-01-19 16:16:58 +04:00
log.h Move logging functions to log.c 2011-12-19 18:52:50 +04:00
namespaces.h namespaces: parametrized namespace option introduced 2012-01-31 22:32:22 +04:00
parasite-syscall.h open_proc() and friends: hide pid_dir 2012-02-17 16:46:25 +04:00
parasite.h parasite: Some code style tuning in header 2012-02-14 17:18:08 +04:00
proc_parse.h open_proc() and friends: hide pid_dir 2012-02-17 16:46:25 +04:00
processor-flags.h Add processor-flags.h 2012-02-14 17:18:08 +04:00
ptrace.h Rework parasite code 2012-02-16 22:05:28 +04:00
restorer-log.h restorer: move log descriptor from crtools (v2) 2012-01-17 18:08:03 +03:00
restorer.h restore: Add checkpoint/restore for /proc/pid/exe symlink 2012-02-07 20:08:01 +04:00
sockets.h socket.c: use const whenever possible 2012-02-10 18:07:19 +04:00
syscall-codes.h restore: support SYSV IPC vma 2012-02-15 13:30:34 +04:00
syscall.h restore: support SYSV IPC vma 2012-02-15 13:30:34 +04:00
sysctl.h Add sysctl handling engine 2012-02-02 21:22:20 +04:00
types.h include/types.h cleanup: remove *_FILENO 2012-02-14 21:16:00 +04:00
unix_diag.h sockets: Update unix_diag.h 2012-01-10 17:26:50 +04:00
util-net.h util: move recv_fd and send_fd in a separate file 2012-02-01 19:26:41 +04:00
util.h open_proc() and friends: hide pid_dir 2012-02-17 16:46:25 +04:00
uts_ns.h namespaces: split UTS and generic code 2012-01-31 13:43:28 +04:00