Skip to content

Commit

Permalink
libceph: kill ceph_osdc_wait_event()
Browse files Browse the repository at this point in the history
There are no actual users of ceph_osdc_wait_event().  This would
have been one-shot events, but we no longer support those so just
get rid of this function.

Since this leaves nothing else that waits for the completion of an
event, we can get rid of the completion in a struct ceph_osd_event.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
  • Loading branch information
Alex Elder committed Feb 18, 2013
1 parent 3c663bb commit 2d2f522
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
3 changes: 0 additions & 3 deletions include/linux/ceph/osd_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ struct ceph_osd_event {
struct rb_node node;
struct list_head osd_node;
struct kref kref;
struct completion completion;
};

struct ceph_osd_event_work {
Expand Down Expand Up @@ -275,8 +274,6 @@ extern int ceph_osdc_create_event(struct ceph_osd_client *osdc,
void (*event_cb)(u64, u64, u8, void *),
void *data, struct ceph_osd_event **pevent);
extern void ceph_osdc_cancel_event(struct ceph_osd_event *event);
extern int ceph_osdc_wait_event(struct ceph_osd_event *event,
unsigned long timeout);
extern void ceph_osdc_put_event(struct ceph_osd_event *event);
#endif

18 changes: 0 additions & 18 deletions net/ceph/osd_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1494,7 +1494,6 @@ int ceph_osdc_create_event(struct ceph_osd_client *osdc,
RB_CLEAR_NODE(&event->node);
kref_init(&event->kref); /* one ref for us */
kref_get(&event->kref); /* one ref for the caller */
init_completion(&event->completion);

spin_lock(&osdc->event_lock);
event->cookie = ++osdc->event_count;
Expand Down Expand Up @@ -1530,7 +1529,6 @@ static void do_event_work(struct work_struct *work)

dout("do_event_work completing %p\n", event);
event->cb(ver, notify_id, opcode, event->data);
complete(&event->completion);
dout("do_event_work completed %p\n", event);
ceph_osdc_put_event(event);
kfree(event_work);
Expand Down Expand Up @@ -1588,7 +1586,6 @@ static void handle_watch_notify(struct ceph_osd_client *osdc,
return;

done_err:
complete(&event->completion);
ceph_osdc_put_event(event);
return;

Expand All @@ -1597,21 +1594,6 @@ static void handle_watch_notify(struct ceph_osd_client *osdc,
return;
}

int ceph_osdc_wait_event(struct ceph_osd_event *event, unsigned long timeout)
{
int err;

dout("wait_event %p\n", event);
err = wait_for_completion_interruptible_timeout(&event->completion,
timeout * HZ);
ceph_osdc_put_event(event);
if (err > 0)
err = 0;
dout("wait_event %p returns %d\n", event, err);
return err;
}
EXPORT_SYMBOL(ceph_osdc_wait_event);

/*
* Register request, send initial attempt.
*/
Expand Down

0 comments on commit 2d2f522

Please sign in to comment.