Commit 19079203 authored by Ilya Dryomov's avatar Ilya Dryomov

libceph: support for sending notifies

Implement ceph_osdc_notify() for sending notifies.

Due to the fact that the current messenger can't do read-in into
pagelists (it can only do write-out from them), I had to go with a page
vector for a NOTIFY_COMPLETE payload, for now.
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 922dab61
......@@ -114,6 +114,11 @@ struct ceph_osd_req_op {
struct {
struct ceph_osd_data request_data;
} notify_ack;
struct {
u64 cookie;
struct ceph_osd_data request_data;
struct ceph_osd_data response_data;
} notify;
struct {
u64 expected_object_size;
u64 expected_write_size;
......@@ -202,6 +207,7 @@ struct ceph_osd_linger_request {
struct ceph_osd_client *osdc;
u64 linger_id;
bool committed;
bool is_watch; /* watch or notify */
struct ceph_osd *osd;
struct ceph_osd_request *reg_req;
......@@ -220,14 +226,20 @@ struct ceph_osd_linger_request {
struct list_head scan_item;
struct completion reg_commit_wait;
struct completion notify_finish_wait;
int reg_commit_error;
int notify_finish_error;
int last_error;
u32 register_gen;
u64 notify_id;
rados_watchcb2_t wcb;
rados_watcherrcb_t errcb;
void *data;
struct page ***preply_pages;
size_t *preply_len;
};
struct ceph_osd_client {
......@@ -397,5 +409,13 @@ int ceph_osdc_notify_ack(struct ceph_osd_client *osdc,
u64 cookie,
void *payload,
size_t payload_len);
int ceph_osdc_notify(struct ceph_osd_client *osdc,
struct ceph_object_id *oid,
struct ceph_object_locator *oloc,
void *payload,
size_t payload_len,
u32 timeout,
struct page ***preply_pages,
size_t *preply_len);
#endif
......@@ -476,6 +476,9 @@ struct ceph_osd_op {
__u8 op; /* CEPH_OSD_WATCH_OP_* */
__le32 gen; /* registration generation */
} __attribute__ ((packed)) watch;
struct {
__le64 cookie;
} __attribute__ ((packed)) notify;
struct {
__le64 offset, length;
__le64 src_offset;
......
......@@ -206,8 +206,9 @@ static void dump_linger_request(struct seq_file *s,
seq_printf(s, "%llu\t", lreq->linger_id);
dump_target(s, &lreq->t);
seq_printf(s, "\t%u\t%s/%d\n", lreq->register_gen,
lreq->committed ? "C" : "", lreq->last_error);
seq_printf(s, "\t%u\t%s%s/%d\n", lreq->register_gen,
lreq->is_watch ? "W" : "N", lreq->committed ? "C" : "",
lreq->last_error);
}
static void dump_linger_requests(struct seq_file *s, struct ceph_osd *osd)
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment