diff options
author | Yan, Zheng <zyan@redhat.com> | 2019-07-25 15:16:39 +0300 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2019-09-16 13:06:23 +0300 |
commit | 120a75ea9f4ba02f852171e75d44f29139b9c83e (patch) | |
tree | 6944f51971e6adea422725866c0e81e5249ebc18 /net/ceph/osd_client.c | |
parent | e09580b343aa117fd07c1bb7f7dfc5bc630a2953 (diff) | |
download | linux-120a75ea9f4ba02f852171e75d44f29139b9c83e.tar.xz |
libceph: add function that reset client's entity addr
This function also re-open connections to OSD/MON, and re-send in-flight
OSD requests after re-opening connections to OSD.
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'net/ceph/osd_client.c')
-rw-r--r-- | net/ceph/osd_client.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index 78ae6e8c953d..a252ba80dd82 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c @@ -5087,6 +5087,24 @@ out_put_req: EXPORT_SYMBOL(ceph_osdc_call); /* + * reset all osd connections + */ +void ceph_osdc_reopen_osds(struct ceph_osd_client *osdc) +{ + struct rb_node *n; + + down_write(&osdc->lock); + for (n = rb_first(&osdc->osds); n; ) { + struct ceph_osd *osd = rb_entry(n, struct ceph_osd, o_node); + + n = rb_next(n); + if (!reopen_osd(osd)) + kick_osd_requests(osd); + } + up_write(&osdc->lock); +} + +/* * init, shutdown */ int ceph_osdc_init(struct ceph_osd_client *osdc, struct ceph_client *client) |