hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/ceph/pagevec.c
....@@ -10,39 +10,6 @@
1010
1111 #include <linux/ceph/libceph.h>
1212
13
-/*
14
- * build a vector of user pages
15
- */
16
-struct page **ceph_get_direct_page_vector(const void __user *data,
17
- int num_pages, bool write_page)
18
-{
19
- struct page **pages;
20
- int got = 0;
21
- int rc = 0;
22
-
23
- pages = kmalloc_array(num_pages, sizeof(*pages), GFP_NOFS);
24
- if (!pages)
25
- return ERR_PTR(-ENOMEM);
26
-
27
- while (got < num_pages) {
28
- rc = get_user_pages_fast(
29
- (unsigned long)data + ((unsigned long)got * PAGE_SIZE),
30
- num_pages - got, write_page, pages + got);
31
- if (rc < 0)
32
- break;
33
- BUG_ON(rc == 0);
34
- got += rc;
35
- }
36
- if (rc < 0)
37
- goto fail;
38
- return pages;
39
-
40
-fail:
41
- ceph_put_page_vector(pages, got, false);
42
- return ERR_PTR(rc);
43
-}
44
-EXPORT_SYMBOL(ceph_get_direct_page_vector);
45
-
4613 void ceph_put_page_vector(struct page **pages, int num_pages, bool dirty)
4714 {
4815 int i;