diff mbox series

[1/2] libceph: specify the sparse read extent count

Message ID 20231107025423.302404-2-xiubli@redhat.com (mailing list archive)
State New, archived
Headers show
Series ceph: allocate a smaller extent map if possible | expand

Commit Message

Xiubo Li Nov. 7, 2023, 2:54 a.m. UTC
From: Xiubo Li <xiubli@redhat.com>

Try to use the specified extent count to allocate the extent array
memory.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 include/linux/ceph/osd_client.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h
index f703fb8030de..493de3496cd3 100644
--- a/include/linux/ceph/osd_client.h
+++ b/include/linux/ceph/osd_client.h
@@ -573,9 +573,11 @@  int __ceph_alloc_sparse_ext_map(struct ceph_osd_req_op *op, int cnt);
  */
 #define CEPH_SPARSE_EXT_ARRAY_INITIAL  16
 
-static inline int ceph_alloc_sparse_ext_map(struct ceph_osd_req_op *op)
+static inline int ceph_alloc_sparse_ext_map(struct ceph_osd_req_op *op, int cnt)
 {
-	return __ceph_alloc_sparse_ext_map(op, CEPH_SPARSE_EXT_ARRAY_INITIAL);
+	int _cnt = cnt ? cnt : CEPH_SPARSE_EXT_ARRAY_INITIAL;
+
+	return __ceph_alloc_sparse_ext_map(op, _cnt);
 }
 
 extern void ceph_osdc_get_request(struct ceph_osd_request *req);