diff options
-rw-r--r-- | fs/ceph/mds_client.c | 2 | ||||
-rw-r--r-- | include/linux/ceph/messenger.h | 5 | ||||
-rw-r--r-- | net/ceph/messenger.c | 28 | ||||
-rw-r--r-- | net/ceph/osd_client.c | 6 |
4 files changed, 37 insertions, 4 deletions
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 03eb943ebce5..3b2aa8702ae0 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
@@ -2603,7 +2603,7 @@ static void send_mds_reconnect(struct ceph_mds_client *mdsc, | |||
2603 | goto fail; | 2603 | goto fail; |
2604 | } | 2604 | } |
2605 | 2605 | ||
2606 | reply->pagelist = pagelist; | 2606 | ceph_msg_data_set_pagelist(reply, pagelist); |
2607 | if (recon_state.flock) | 2607 | if (recon_state.flock) |
2608 | reply->hdr.version = cpu_to_le16(2); | 2608 | reply->hdr.version = cpu_to_le16(2); |
2609 | reply->hdr.data_len = cpu_to_le32(pagelist->length); | 2609 | reply->hdr.data_len = cpu_to_le32(pagelist->length); |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index e6d20e892a88..9d9be4682ac3 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -221,6 +221,11 @@ extern void ceph_con_keepalive(struct ceph_connection *con); | |||
221 | 221 | ||
222 | extern void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages, | 222 | extern void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages, |
223 | size_t length, size_t alignment); | 223 | size_t length, size_t alignment); |
224 | extern void ceph_msg_data_set_pagelist(struct ceph_msg *msg, | ||
225 | struct ceph_pagelist *pagelist); | ||
226 | extern void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio); | ||
227 | extern void ceph_msg_data_set_trail(struct ceph_msg *msg, | ||
228 | struct ceph_pagelist *trail); | ||
224 | 229 | ||
225 | extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags, | 230 | extern struct ceph_msg *ceph_msg_new(int type, int front_len, gfp_t flags, |
226 | bool can_fail); | 231 | bool can_fail); |
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index fc59fcc9be77..d1183536d5a8 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -2701,6 +2701,34 @@ void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages, | |||
2701 | } | 2701 | } |
2702 | EXPORT_SYMBOL(ceph_msg_data_set_pages); | 2702 | EXPORT_SYMBOL(ceph_msg_data_set_pages); |
2703 | 2703 | ||
2704 | void ceph_msg_data_set_pagelist(struct ceph_msg *msg, | ||
2705 | struct ceph_pagelist *pagelist) | ||
2706 | { | ||
2707 | /* BUG_ON(!pagelist); */ | ||
2708 | /* BUG_ON(msg->pagelist); */ | ||
2709 | |||
2710 | msg->pagelist = pagelist; | ||
2711 | } | ||
2712 | EXPORT_SYMBOL(ceph_msg_data_set_pagelist); | ||
2713 | |||
2714 | void ceph_msg_data_set_bio(struct ceph_msg *msg, struct bio *bio) | ||
2715 | { | ||
2716 | /* BUG_ON(!bio); */ | ||
2717 | /* BUG_ON(msg->bio); */ | ||
2718 | |||
2719 | msg->bio = bio; | ||
2720 | } | ||
2721 | EXPORT_SYMBOL(ceph_msg_data_set_bio); | ||
2722 | |||
2723 | void ceph_msg_data_set_trail(struct ceph_msg *msg, struct ceph_pagelist *trail) | ||
2724 | { | ||
2725 | /* BUG_ON(!trail); */ | ||
2726 | /* BUG_ON(msg->trail); */ | ||
2727 | |||
2728 | msg->trail = trail; | ||
2729 | } | ||
2730 | EXPORT_SYMBOL(ceph_msg_data_set_trail); | ||
2731 | |||
2704 | /* | 2732 | /* |
2705 | * construct a new message with given type, size | 2733 | * construct a new message with given type, size |
2706 | * the new msg has a ref count of 1. | 2734 | * the new msg has a ref count of 1. |
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index f29bedac7310..387e3123d1ed 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -1763,12 +1763,12 @@ int ceph_osdc_start_request(struct ceph_osd_client *osdc, | |||
1763 | osd_data->length, osd_data->alignment); | 1763 | osd_data->length, osd_data->alignment); |
1764 | #ifdef CONFIG_BLOCK | 1764 | #ifdef CONFIG_BLOCK |
1765 | } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) { | 1765 | } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) { |
1766 | req->r_request->bio = osd_data->bio; | 1766 | ceph_msg_data_set_bio(req->r_request, osd_data->bio); |
1767 | #endif | 1767 | #endif |
1768 | } else { | 1768 | } else { |
1769 | BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE); | 1769 | BUG_ON(osd_data->type != CEPH_OSD_DATA_TYPE_NONE); |
1770 | } | 1770 | } |
1771 | req->r_request->trail = &req->r_trail; | 1771 | ceph_msg_data_set_trail(req->r_request, &req->r_trail); |
1772 | 1772 | ||
1773 | register_request(osdc, req); | 1773 | register_request(osdc, req); |
1774 | 1774 | ||
@@ -2132,7 +2132,7 @@ static struct ceph_msg *get_reply(struct ceph_connection *con, | |||
2132 | osd_data->length, osd_data->alignment); | 2132 | osd_data->length, osd_data->alignment); |
2133 | #ifdef CONFIG_BLOCK | 2133 | #ifdef CONFIG_BLOCK |
2134 | } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) { | 2134 | } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) { |
2135 | m->bio = osd_data->bio; | 2135 | ceph_msg_data_set_bio(m, osd_data->bio); |
2136 | #endif | 2136 | #endif |
2137 | } | 2137 | } |
2138 | } | 2138 | } |