.. | .. |
---|
6 | 6 | #include <linux/highmem.h> |
---|
7 | 7 | #include <linux/ceph/pagelist.h> |
---|
8 | 8 | |
---|
| 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 | + |
---|
9 | 29 | static void ceph_pagelist_unmap_tail(struct ceph_pagelist *pl) |
---|
10 | 30 | { |
---|
11 | 31 | if (pl->mapped_tail) { |
---|