• Cyrill Gorcunov's avatar
    files: Add ability to use read link in dump_one_reg_file · 4531f0ac
    Cyrill Gorcunov authored
    To be able to dump procfs namespace entries we will need to
    analyze the link name first and then figure out if the file
    referred indeed a procfs entry or it's plain regular file.
    
    This means we read link early, and to escape double reading
    of same link, once we read it we remember it in fd_parms
    structure which we pass to dump_one_reg_file.
    
    Still the dump_one_reg_file is not solely used from inside
    of dump_one_file, but from a number of other places (fifo,
    special files) where fd_parms is filled only partially
    and fill_fd_params is not even called. Thus dump_one_reg_file
    must be ready for such scenario and read the link name by own
    if the caller has not provided one.
    
    To achieve all this we do
    
     - extend fd_parms structure to have a reference on a new
       fd_link structure, thus if caller already read the link
       name it might assign the reference and call for dump_one_reg_file
    
     - tune up dump_one_reg_file to fill own copy of fd_link
       structure if the caller has not provied one
    
      [ xemul: Added const to fill_fdlink arg ]
    Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    4531f0ac
Name
Last commit
Last update
Documentation Loading commit data...
arch Loading commit data...
include Loading commit data...
pie Loading commit data...
protobuf Loading commit data...
scripts Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Makefile Loading commit data...
Makefile.crtools Loading commit data...
Makefile.inc Loading commit data...
README Loading commit data...
cr-check.c Loading commit data...
cr-dump.c Loading commit data...
cr-exec.c Loading commit data...
cr-restore.c Loading commit data...
cr-show.c Loading commit data...
crtools Loading commit data...
crtools.c Loading commit data...
eventfd.c Loading commit data...
eventpoll.c Loading commit data...
fifo.c Loading commit data...
file-ids.c Loading commit data...
file-lock.c Loading commit data...
files-reg.c Loading commit data...
files.c Loading commit data...
fsnotify.c Loading commit data...
image.c Loading commit data...
ipc_ns.c Loading commit data...
kcmp-ids.c Loading commit data...
kerndat.c Loading commit data...
libnetlink.c Loading commit data...
log.c Loading commit data...
mem.c Loading commit data...
mount.c Loading commit data...
namespaces.c Loading commit data...
net.c Loading commit data...
netfilter.c Loading commit data...
page-pipe.c Loading commit data...
page-read.c Loading commit data...
page-xfer.c Loading commit data...
parasite-syscall.c Loading commit data...
pipes.c Loading commit data...
proc_parse.c Loading commit data...
protobuf.c Loading commit data...
pstree.c Loading commit data...
ptrace.c Loading commit data...
rbtree.c Loading commit data...
shmem.c Loading commit data...
signalfd.c Loading commit data...
sk-inet.c Loading commit data...
sk-netlink.c Loading commit data...
sk-packet.c Loading commit data...
sk-queue.c Loading commit data...
sk-tcp.c Loading commit data...
sk-unix.c Loading commit data...
sockets.c Loading commit data...
stats.c Loading commit data...
sysctl.c Loading commit data...
tty.c Loading commit data...
util.c Loading commit data...
uts_ns.c Loading commit data...