libceph: have osd requests support pagelist data
authorAlex Elder <elder@inktank.com>
Fri, 8 Mar 2013 19:35:36 +0000 (13:35 -0600)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:17:03 +0000 (21:17 -0700)
Add support for recording a ceph pagelist as data associated with an
osd request.

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
include/linux/ceph/osd_client.h
net/ceph/osd_client.c

index bcf3f72ec3f828aea8f04b35ae7dc2e0569dfa0b..cf0ba93426da8d85565118a40184ba824ffc8c90 100644 (file)
@@ -53,6 +53,7 @@ struct ceph_osd {
 enum ceph_osd_data_type {
        CEPH_OSD_DATA_TYPE_NONE,
        CEPH_OSD_DATA_TYPE_PAGES,
+       CEPH_OSD_DATA_TYPE_PAGELIST,
 #ifdef CONFIG_BLOCK
        CEPH_OSD_DATA_TYPE_BIO,
 #endif /* CONFIG_BLOCK */
@@ -68,8 +69,9 @@ struct ceph_osd_data {
                        bool            pages_from_pool;
                        bool            own_pages;
                };
+               struct ceph_pagelist    *pagelist;
 #ifdef CONFIG_BLOCK
-               struct bio       *bio;
+               struct bio              *bio;
 #endif /* CONFIG_BLOCK */
        };
 };
index ce34faaa453f14faa03b49cbcab5bbd7c8cba80d..4159df2d67af07842ebb486f27076d241c581445 100644 (file)
@@ -1757,6 +1757,9 @@ static void ceph_osdc_msg_data_set(struct ceph_msg *msg,
                if (osd_data->length)
                        ceph_msg_data_set_pages(msg, osd_data->pages,
                                osd_data->length, osd_data->alignment);
+       } else if (osd_data->type == CEPH_OSD_DATA_TYPE_PAGELIST) {
+               BUG_ON(!osd_data->pagelist->length);
+               ceph_msg_data_set_pagelist(msg, osd_data->pagelist);
 #ifdef CONFIG_BLOCK
        } else if (osd_data->type == CEPH_OSD_DATA_TYPE_BIO) {
                ceph_msg_data_set_bio(msg, osd_data->bio);