diff options
| author | Ilya Dryomov <idryomov@gmail.com> | 2015-06-25 10:47:45 -0400 |
|---|---|---|
| committer | Ilya Dryomov <idryomov@gmail.com> | 2015-07-09 13:30:34 -0400 |
| commit | 757856d2b9568a701df9ea6a4be68effbb9d6f44 (patch) | |
| tree | c6f943fd91a6e1901745f114a1387e98b8031eed /include/linux/ceph | |
| parent | d770e558e21961ad6cfdf0ff7df0eb5d7d4f0754 (diff) | |
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>
Diffstat (limited to 'include/linux/ceph')
| -rw-r--r-- | include/linux/ceph/messenger.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index e15499422fdc..37753278987a 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include <linux/radix-tree.h> | 8 | #include <linux/radix-tree.h> |
| 9 | #include <linux/uio.h> | 9 | #include <linux/uio.h> |
| 10 | #include <linux/workqueue.h> | 10 | #include <linux/workqueue.h> |
| 11 | #include <net/net_namespace.h> | ||
| 11 | 12 | ||
| 12 | #include <linux/ceph/types.h> | 13 | #include <linux/ceph/types.h> |
| 13 | #include <linux/ceph/buffer.h> | 14 | #include <linux/ceph/buffer.h> |
| @@ -56,6 +57,7 @@ struct ceph_messenger { | |||
| 56 | struct ceph_entity_addr my_enc_addr; | 57 | struct ceph_entity_addr my_enc_addr; |
| 57 | 58 | ||
| 58 | atomic_t stopping; | 59 | atomic_t stopping; |
| 60 | possible_net_t net; | ||
| 59 | bool nocrc; | 61 | bool nocrc; |
| 60 | bool tcp_nodelay; | 62 | bool tcp_nodelay; |
| 61 | 63 | ||
| @@ -267,6 +269,7 @@ extern void ceph_messenger_init(struct ceph_messenger *msgr, | |||
| 267 | u64 required_features, | 269 | u64 required_features, |
| 268 | bool nocrc, | 270 | bool nocrc, |
| 269 | bool tcp_nodelay); | 271 | bool tcp_nodelay); |
| 272 | extern void ceph_messenger_fini(struct ceph_messenger *msgr); | ||
| 270 | 273 | ||
| 271 | extern void ceph_con_init(struct ceph_connection *con, void *private, | 274 | extern void ceph_con_init(struct ceph_connection *con, void *private, |
| 272 | const struct ceph_connection_operations *ops, | 275 | const struct ceph_connection_operations *ops, |
