pagelist.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) pagelist.c (09cbfeaf1a5a67bfb3201e0c83c810cecb2efa5a)
1#include <linux/module.h>
2#include <linux/gfp.h>
3#include <linux/slab.h>
4#include <linux/pagemap.h>
5#include <linux/highmem.h>
6#include <linux/ceph/pagelist.h>
7
8static void ceph_pagelist_unmap_tail(struct ceph_pagelist *pl)

--- 42 unchanged lines hidden (view full) ---

51}
52
53int ceph_pagelist_append(struct ceph_pagelist *pl, const void *buf, size_t len)
54{
55 while (pl->room < len) {
56 size_t bit = pl->room;
57 int ret;
58
1#include <linux/module.h>
2#include <linux/gfp.h>
3#include <linux/slab.h>
4#include <linux/pagemap.h>
5#include <linux/highmem.h>
6#include <linux/ceph/pagelist.h>
7
8static void ceph_pagelist_unmap_tail(struct ceph_pagelist *pl)

--- 42 unchanged lines hidden (view full) ---

51}
52
53int ceph_pagelist_append(struct ceph_pagelist *pl, const void *buf, size_t len)
54{
55 while (pl->room < len) {
56 size_t bit = pl->room;
57 int ret;
58
59 memcpy(pl->mapped_tail + (pl->length & ~PAGE_CACHE_MASK),
59 memcpy(pl->mapped_tail + (pl->length & ~PAGE_MASK),
60 buf, bit);
61 pl->length += bit;
62 pl->room -= bit;
63 buf += bit;
64 len -= bit;
65 ret = ceph_pagelist_addpage(pl);
66 if (ret)
67 return ret;
68 }
69
60 buf, bit);
61 pl->length += bit;
62 pl->room -= bit;
63 buf += bit;
64 len -= bit;
65 ret = ceph_pagelist_addpage(pl);
66 if (ret)
67 return ret;
68 }
69
70 memcpy(pl->mapped_tail + (pl->length & ~PAGE_CACHE_MASK), buf, len);
70 memcpy(pl->mapped_tail + (pl->length & ~PAGE_MASK), buf, len);
71 pl->length += len;
72 pl->room -= len;
73 return 0;
74}
75EXPORT_SYMBOL(ceph_pagelist_append);
76
77/* Allocate enough pages for a pagelist to append the given amount
78 * of data without without allocating.

--- 72 unchanged lines hidden ---
71 pl->length += len;
72 pl->room -= len;
73 return 0;
74}
75EXPORT_SYMBOL(ceph_pagelist_append);
76
77/* Allocate enough pages for a pagelist to append the given amount
78 * of data without without allocating.

--- 72 unchanged lines hidden ---