hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/net/ceph/pagelist.c
....@@ -6,6 +6,26 @@
66 #include <linux/highmem.h>
77 #include <linux/ceph/pagelist.h>
88
9
+struct ceph_pagelist *ceph_pagelist_alloc(gfp_t gfp_flags)
10
+{
11
+ struct ceph_pagelist *pl;
12
+
13
+ pl = kmalloc(sizeof(*pl), gfp_flags);
14
+ if (!pl)
15
+ return NULL;
16
+
17
+ INIT_LIST_HEAD(&pl->head);
18
+ pl->mapped_tail = NULL;
19
+ pl->length = 0;
20
+ pl->room = 0;
21
+ INIT_LIST_HEAD(&pl->free_list);
22
+ pl->num_pages_free = 0;
23
+ refcount_set(&pl->refcnt, 1);
24
+
25
+ return pl;
26
+}
27
+EXPORT_SYMBOL(ceph_pagelist_alloc);
28
+
929 static void ceph_pagelist_unmap_tail(struct ceph_pagelist *pl)
1030 {
1131 if (pl->mapped_tail) {