3 #include <linux/pagemap.h>
4 #include <linux/highmem.h>
8 static void ceph_pagelist_unmap_tail(struct ceph_pagelist
*pl
)
10 struct page
*page
= list_entry(pl
->head
.prev
, struct page
,
15 int ceph_pagelist_release(struct ceph_pagelist
*pl
)
18 ceph_pagelist_unmap_tail(pl
);
20 while (!list_empty(&pl
->head
)) {
21 struct page
*page
= list_first_entry(&pl
->head
, struct page
,
29 static int ceph_pagelist_addpage(struct ceph_pagelist
*pl
)
31 struct page
*page
= __page_cache_alloc(GFP_NOFS
);
34 pl
->room
+= PAGE_SIZE
;
35 list_add_tail(&page
->lru
, &pl
->head
);
37 ceph_pagelist_unmap_tail(pl
);
38 pl
->mapped_tail
= kmap(page
);
42 int ceph_pagelist_append(struct ceph_pagelist
*pl
, const void *buf
, size_t len
)
44 while (pl
->room
< len
) {
45 size_t bit
= pl
->room
;
48 memcpy(pl
->mapped_tail
+ (pl
->length
& ~PAGE_CACHE_MASK
),
54 ret
= ceph_pagelist_addpage(pl
);
59 memcpy(pl
->mapped_tail
+ (pl
->length
& ~PAGE_CACHE_MASK
), buf
, len
);
This page took 0.030501 seconds and 5 git commands to generate.