diff options
author | Li Wang <liwang@ubuntukylin.com> | 2013-08-14 23:51:44 -0400 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-08-15 14:12:17 -0400 |
commit | ad7a60de882aca31afb58721db166f7e77afcd92 (patch) | |
tree | 61a21b2249d77d575982786a04fbaca923361fc8 /net/ceph | |
parent | 3871cbb9a41b1371dc13fc619e3ab4e0a1e29b4a (diff) |
ceph: punch hole support
This patch implements fallocate and punch hole support for Ceph kernel client.
Signed-off-by: Li Wang <liwang@ubuntukylin.com>
Signed-off-by: Yunchuan Wen <yunchuanwen@ubuntukylin.com>
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/osd_client.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c index dbc0a7392d67..8ec65bc11c71 100644 --- a/net/ceph/osd_client.c +++ b/net/ceph/osd_client.c | |||
@@ -503,7 +503,9 @@ void osd_req_op_extent_init(struct ceph_osd_request *osd_req, | |||
503 | struct ceph_osd_req_op *op = _osd_req_op_init(osd_req, which, opcode); | 503 | struct ceph_osd_req_op *op = _osd_req_op_init(osd_req, which, opcode); |
504 | size_t payload_len = 0; | 504 | size_t payload_len = 0; |
505 | 505 | ||
506 | BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE); | 506 | BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE && |
507 | opcode != CEPH_OSD_OP_DELETE && opcode != CEPH_OSD_OP_ZERO && | ||
508 | opcode != CEPH_OSD_OP_TRUNCATE); | ||
507 | 509 | ||
508 | op->extent.offset = offset; | 510 | op->extent.offset = offset; |
509 | op->extent.length = length; | 511 | op->extent.length = length; |
@@ -631,6 +633,9 @@ static u64 osd_req_encode_op(struct ceph_osd_request *req, | |||
631 | break; | 633 | break; |
632 | case CEPH_OSD_OP_READ: | 634 | case CEPH_OSD_OP_READ: |
633 | case CEPH_OSD_OP_WRITE: | 635 | case CEPH_OSD_OP_WRITE: |
636 | case CEPH_OSD_OP_ZERO: | ||
637 | case CEPH_OSD_OP_DELETE: | ||
638 | case CEPH_OSD_OP_TRUNCATE: | ||
634 | if (src->op == CEPH_OSD_OP_WRITE) | 639 | if (src->op == CEPH_OSD_OP_WRITE) |
635 | request_data_len = src->extent.length; | 640 | request_data_len = src->extent.length; |
636 | dst->extent.offset = cpu_to_le64(src->extent.offset); | 641 | dst->extent.offset = cpu_to_le64(src->extent.offset); |
@@ -715,7 +720,9 @@ struct ceph_osd_request *ceph_osdc_new_request(struct ceph_osd_client *osdc, | |||
715 | u64 object_base; | 720 | u64 object_base; |
716 | int r; | 721 | int r; |
717 | 722 | ||
718 | BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE); | 723 | BUG_ON(opcode != CEPH_OSD_OP_READ && opcode != CEPH_OSD_OP_WRITE && |
724 | opcode != CEPH_OSD_OP_DELETE && opcode != CEPH_OSD_OP_ZERO && | ||
725 | opcode != CEPH_OSD_OP_TRUNCATE); | ||
719 | 726 | ||
720 | req = ceph_osdc_alloc_request(osdc, snapc, num_ops, use_mempool, | 727 | req = ceph_osdc_alloc_request(osdc, snapc, num_ops, use_mempool, |
721 | GFP_NOFS); | 728 | GFP_NOFS); |