aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Dryomov2016-04-28 16:07:28 +0200
committerIlya Dryomov2016-05-26 01:15:30 +0200
commit7cca78c9dcd1afa243e46edc31896730df85d2b5 (patch)
tree1d3b677c6196ace6c87fae54c00e415e28e9bb67
parentb4f34795697de9d1ee84a10c8439b4b9970ebd96 (diff)
libceph: replace ceph_monc_request_next_osdmap()
... with a wrapper around maybe_request_map() - no need for two osdmap-specific functions. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--drivers/block/rbd.c2
-rw-r--r--include/linux/ceph/mon_client.h1
-rw-r--r--include/linux/ceph/osd_client.h1
-rw-r--r--net/ceph/mon_client.c14
-rw-r--r--net/ceph/osd_client.c7
5 files changed, 9 insertions, 16 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 8eae6f56194d..81666a56415e 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -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);
diff --git a/include/linux/ceph/mon_client.h b/include/linux/ceph/mon_client.h
index 19800d9b45f3..1d730993c3f8 100644
--- a/include/linux/ceph/mon_client.h
+++ b/include/linux/ceph/mon_client.h
@@ -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);
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index 3e7bf72e4078..19b14862d3e0 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -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,
diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c
index 4e49b2296920..72a910bf7819 100644
--- a/net/ceph/mon_client.c
+++ b/net/ceph/mon_client.c
@@ -385,20 +385,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.
*
* @epoch: epoch to wait for
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index ece2d10a1208..55cafd3a2ff0 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -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