]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, inode: allow for rename and link ops
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 10 Dec 2015 21:33:49 +0000 (22:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sat, 12 Dec 2015 23:44:23 +0000 (18:44 -0500)
commitfe693308fa08a662f36e46236043625d85a9dccd
tree0d73c2838c5e47b170ffe834001a19d5e8d750bf
parentd4a29ca22207ab40af12b4c4c9f249a15fc46cc1
bpf, inode: allow for rename and link ops

Add support for renaming and hard links to the fs. Most of this can be
implemented by using simple library operations under the same constraints
that we don't use a reserved name like elsewhere. Linking can be useful
to share/manage things like maps across subsystem users. It works within
the file system boundary, but is not allowed for directories.

Symbolic links are explicitly not implemented here, as it can be better
done already by doing bind mounts inside bpf fs to set up shared directories
f.e. useful when using volumes in docker containers that map a private
working directory into /sys/fs/bpf/ which contains itself a bind mounted
path from the host's /sys/fs/bpf/ mount that is shared among multiple
containers. For single maps instead of whole directory, hard links can
be easily used to do the same.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/inode.c