]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
libceph: replace ceph_monc_request_next_osdmap()
authorIlya Dryomov <idryomov@gmail.com>
Thu, 28 Apr 2016 14:07:28 +0000 (16:07 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Wed, 25 May 2016 23:15:30 +0000 (01:15 +0200)
... with a wrapper around maybe_request_map() - no need for two
osdmap-specific functions.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
drivers/block/rbd.c
include/linux/ceph/mon_client.h
include/linux/ceph/osd_client.h
net/ceph/mon_client.c
net/ceph/osd_client.c

index 8eae6f56194dd02540445130db1598ae9eaf593e..81666a56415e2bc6f960a3f5ac2220108c2b7ed1 100644 (file)
@@ -4902,7 +4902,7 @@ again:
                        return ret;
 
                if (rbdc->client->osdc.osdmap->epoch < newest_epoch) {
-                       ceph_monc_request_next_osdmap(&rbdc->client->monc);
+                       ceph_osdc_maybe_request_map(&rbdc->client->osdc);
                        (void) ceph_monc_wait_osdmap(&rbdc->client->monc,
                                                     newest_epoch,
                                                     opts->mount_timeout);
index 19800d9b45f3e51544e44754ba44b054d2a2935f..1d730993c3f8f7bd6ffa6680e34439048100be0d 100644 (file)
@@ -128,7 +128,6 @@ bool ceph_monc_want_map(struct ceph_mon_client *monc, int sub, u32 epoch,
 void ceph_monc_got_map(struct ceph_mon_client *monc, int sub, u32 epoch);
 void ceph_monc_renew_subs(struct ceph_mon_client *monc);
 
-extern void ceph_monc_request_next_osdmap(struct ceph_mon_client *monc);
 extern int ceph_monc_wait_osdmap(struct ceph_mon_client *monc, u32 epoch,
                                 unsigned long timeout);
 
index 3e7bf72e407815d83c463e55873e429119626c07..19b14862d3e0d9afdc2a524e940f62944428ca89 100644 (file)
@@ -381,6 +381,7 @@ extern int ceph_osdc_wait_request(struct ceph_osd_client *osdc,
 extern void ceph_osdc_sync(struct ceph_osd_client *osdc);
 
 extern void ceph_osdc_flush_notifies(struct ceph_osd_client *osdc);
+void ceph_osdc_maybe_request_map(struct ceph_osd_client *osdc);
 
 extern int ceph_osdc_readpages(struct ceph_osd_client *osdc,
                               struct ceph_vino vino,
index 4e49b2296920437d8c13c631e959249ab39d9a46..72a910bf7819d766030bd26d5a786cac14a33486 100644 (file)
@@ -384,20 +384,6 @@ void ceph_monc_renew_subs(struct ceph_mon_client *monc)
 }
 EXPORT_SYMBOL(ceph_monc_renew_subs);
 
-/*
- * Register interest in the next osdmap
- */
-void ceph_monc_request_next_osdmap(struct ceph_mon_client *monc)
-{
-       dout("%s have %u\n", __func__, monc->subs[CEPH_SUB_OSDMAP].have);
-       mutex_lock(&monc->mutex);
-       if (__ceph_monc_want_map(monc, CEPH_SUB_OSDMAP,
-                                monc->subs[CEPH_SUB_OSDMAP].have + 1, false))
-               __send_subscribe(monc);
-       mutex_unlock(&monc->mutex);
-}
-EXPORT_SYMBOL(ceph_monc_request_next_osdmap);
-
 /*
  * Wait for an osdmap with a given epoch.
  *
index ece2d10a12081f4adf4cd7c8714e6a1a53f7df6f..55cafd3a2ff0849b716d592460f8be9a02ee90ff 100644 (file)
@@ -3869,6 +3869,13 @@ void ceph_osdc_flush_notifies(struct ceph_osd_client *osdc)
 }
 EXPORT_SYMBOL(ceph_osdc_flush_notifies);
 
+void ceph_osdc_maybe_request_map(struct ceph_osd_client *osdc)
+{
+       down_read(&osdc->lock);
+       maybe_request_map(osdc);
+       up_read(&osdc->lock);
+}
+EXPORT_SYMBOL(ceph_osdc_maybe_request_map);
 
 /*
  * init, shutdown