diff mbox series

[2/2] rbd: drop wait_for_latest_osdmap()

Message ID 20190320145642.31214-2-idryomov@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/2] libceph: wait for latest osdmap in ceph_monc_blacklist_add() | expand

Commit Message

Ilya Dryomov March 20, 2019, 2:56 p.m. UTC
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
---
 drivers/block/rbd.c | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

Comments

Jason Dillaman March 20, 2019, 3 p.m. UTC | #1
On Wed, Mar 20, 2019 at 10:56 AM Ilya Dryomov <idryomov@gmail.com> wrote:
>
> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
> ---
>  drivers/block/rbd.c | 20 ++------------------
>  1 file changed, 2 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index e037f1ab2fde..bae0668db84b 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -925,23 +925,6 @@ static void rbd_put_client(struct rbd_client *rbdc)
>                 kref_put(&rbdc->kref, rbd_client_release);
>  }
>
> -static int wait_for_latest_osdmap(struct ceph_client *client)
> -{
> -       u64 newest_epoch;
> -       int ret;
> -
> -       ret = ceph_monc_get_version(&client->monc, "osdmap", &newest_epoch);
> -       if (ret)
> -               return ret;
> -
> -       if (client->osdc.osdmap->epoch >= newest_epoch)
> -               return 0;
> -
> -       ceph_osdc_maybe_request_map(&client->osdc);
> -       return ceph_monc_wait_osdmap(&client->monc, newest_epoch,
> -                                    client->options->mount_timeout);
> -}
> -
>  /*
>   * Get a ceph client with specific addr and configuration, if one does
>   * not exist create it.  Either way, ceph_opts is consumed by this
> @@ -961,7 +944,8 @@ static struct rbd_client *rbd_get_client(struct ceph_options *ceph_opts)
>                  * Using an existing client.  Make sure ->pg_pools is up to
>                  * date before we look up the pool id in do_rbd_add().
>                  */
> -               ret = wait_for_latest_osdmap(rbdc->client);
> +               ret = ceph_wait_for_latest_osdmap(rbdc->client,
> +                                       rbdc->client->options->mount_timeout);
>                 if (ret) {
>                         rbd_warn(NULL, "failed to get latest osdmap: %d", ret);
>                         rbd_put_client(rbdc);
> --
> 2.19.2
>

Reviewed-by: Jason Dillaman <dillaman@redhat.com>
diff mbox series

Patch

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index e037f1ab2fde..bae0668db84b 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -925,23 +925,6 @@  static void rbd_put_client(struct rbd_client *rbdc)
 		kref_put(&rbdc->kref, rbd_client_release);
 }
 
-static int wait_for_latest_osdmap(struct ceph_client *client)
-{
-	u64 newest_epoch;
-	int ret;
-
-	ret = ceph_monc_get_version(&client->monc, "osdmap", &newest_epoch);
-	if (ret)
-		return ret;
-
-	if (client->osdc.osdmap->epoch >= newest_epoch)
-		return 0;
-
-	ceph_osdc_maybe_request_map(&client->osdc);
-	return ceph_monc_wait_osdmap(&client->monc, newest_epoch,
-				     client->options->mount_timeout);
-}
-
 /*
  * Get a ceph client with specific addr and configuration, if one does
  * not exist create it.  Either way, ceph_opts is consumed by this
@@ -961,7 +944,8 @@  static struct rbd_client *rbd_get_client(struct ceph_options *ceph_opts)
 		 * Using an existing client.  Make sure ->pg_pools is up to
 		 * date before we look up the pool id in do_rbd_add().
 		 */
-		ret = wait_for_latest_osdmap(rbdc->client);
+		ret = ceph_wait_for_latest_osdmap(rbdc->client,
+					rbdc->client->options->mount_timeout);
 		if (ret) {
 			rbd_warn(NULL, "failed to get latest osdmap: %d", ret);
 			rbd_put_client(rbdc);