OSDN Git Service

libceph: enable ceph in a non-default network namespace
authorIlya Dryomov <idryomov@gmail.com>
Thu, 25 Jun 2015 14:47:45 +0000 (17:47 +0300)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 9 Jul 2015 17:30:34 +0000 (20:30 +0300)
commit757856d2b9568a701df9ea6a4be68effbb9d6f44
treec6f943fd91a6e1901745f114a1387e98b8031eed
parentd770e558e21961ad6cfdf0ff7df0eb5d7d4f0754
libceph: enable ceph in a non-default network namespace

Grab a reference on a network namespace of the 'rbd map' (in case of
rbd) or 'mount' (in case of ceph) process and use that to open sockets
instead of always using init_net and bailing if network namespace is
anything but init_net.  Be careful to not share struct ceph_client
instances between different namespaces and don't add any code in the
!CONFIG_NET_NS case.

This is based on a patch from Hong Zhiguo <zhiguohong@tencent.com>.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Sage Weil <sage@redhat.com>
include/linux/ceph/messenger.h
net/ceph/ceph_common.c
net/ceph/messenger.c