Skip to content

Commit 7cca78c

Browse files
committed
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>
1 parent b4f3479 commit 7cca78c

5 files changed

Lines changed: 9 additions & 16 deletions

File tree

‎drivers/block/rbd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4902,7 +4902,7 @@ static int rbd_add_get_pool_id(struct rbd_client *rbdc, const char *pool_name)
49024902
return ret;
49034903

49044904
if (rbdc->client->osdc.osdmap->epoch < newest_epoch) {
4905-
ceph_monc_request_next_osdmap(&rbdc->client->monc);
4905+
ceph_osdc_maybe_request_map(&rbdc->client->osdc);
49064906
(void) ceph_monc_wait_osdmap(&rbdc->client->monc,
49074907
newest_epoch,
49084908
opts->mount_timeout);

‎include/linux/ceph/mon_client.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ bool ceph_monc_want_map(struct ceph_mon_client *monc, int sub, u32 epoch,
128128
void ceph_monc_got_map(struct ceph_mon_client *monc, int sub, u32 epoch);
129129
void ceph_monc_renew_subs(struct ceph_mon_client *monc);
130130

131-
extern void ceph_monc_request_next_osdmap(struct ceph_mon_client *monc);
132131
extern int ceph_monc_wait_osdmap(struct ceph_mon_client *monc, u32 epoch,
133132
unsigned long timeout);
134133

‎include/linux/ceph/osd_client.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ extern int ceph_osdc_wait_request(struct ceph_osd_client *osdc,
381381
extern void ceph_osdc_sync(struct ceph_osd_client *osdc);
382382

383383
extern void ceph_osdc_flush_notifies(struct ceph_osd_client *osdc);
384+
void ceph_osdc_maybe_request_map(struct ceph_osd_client *osdc);
384385

385386
extern int ceph_osdc_readpages(struct ceph_osd_client *osdc,
386387
struct ceph_vino vino,

‎net/ceph/mon_client.c‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -384,20 +384,6 @@ void ceph_monc_renew_subs(struct ceph_mon_client *monc)
384384
}
385385
EXPORT_SYMBOL(ceph_monc_renew_subs);
386386

387-
/*
388-
* Register interest in the next osdmap
389-
*/
390-
void ceph_monc_request_next_osdmap(struct ceph_mon_client *monc)
391-
{
392-
dout("%s have %u\n", __func__, monc->subs[CEPH_SUB_OSDMAP].have);
393-
mutex_lock(&monc->mutex);
394-
if (__ceph_monc_want_map(monc, CEPH_SUB_OSDMAP,
395-
monc->subs[CEPH_SUB_OSDMAP].have + 1, false))
396-
__send_subscribe(monc);
397-
mutex_unlock(&monc->mutex);
398-
}
399-
EXPORT_SYMBOL(ceph_monc_request_next_osdmap);
400-
401387
/*
402388
* Wait for an osdmap with a given epoch.
403389
*

‎net/ceph/osd_client.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3869,6 +3869,13 @@ void ceph_osdc_flush_notifies(struct ceph_osd_client *osdc)
38693869
}
38703870
EXPORT_SYMBOL(ceph_osdc_flush_notifies);
38713871

3872+
void ceph_osdc_maybe_request_map(struct ceph_osd_client *osdc)
3873+
{
3874+
down_read(&osdc->lock);
3875+
maybe_request_map(osdc);
3876+
up_read(&osdc->lock);
3877+
}
3878+
EXPORT_SYMBOL(ceph_osdc_maybe_request_map);
38723879

38733880
/*
38743881
* init, shutdown

0 commit comments

Comments
 (0)