Skip to contentSkip to conversation

ceph: remove ceph_get_direct_page_vector

PATCH Applied Christoph Hellwig 2 participants 2 messages May 1, 2019 – May 2, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ceph: remove ceph_get_direct_page_vector

This function is entirely unused.

---
 include/linux/ceph/libceph.h |  4 ----
 net/ceph/pagevec.c           | 33 ---------------------------------
 2 files changed, 37 deletions(-)
include/linux/ceph/libceph.h +0 -4
index 337d5049ff93..a3cddf5f0e60 100644
@@ -299,10 +299,6 @@ int ceph_wait_for_latest_osdmap(struct ceph_client *client,
 
 /* pagevec.c */
 extern void ceph_release_page_vector(struct page **pages, int num_pages);
-
-extern struct page **ceph_get_direct_page_vector(const void __user *data,
-						 int num_pages,
-						 bool write_page);
 extern void ceph_put_page_vector(struct page **pages, int num_pages,
 				 bool dirty);
 extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags);
net/ceph/pagevec.c +0 -33
index d3736f5bffec..64305e7056a1 100644
@@ -10,39 +10,6 @@
 
 #include <linux/ceph/libceph.h>
 
-/*
- * build a vector of user pages
- */
-struct page **ceph_get_direct_page_vector(const void __user *data,
-					  int num_pages, bool write_page)
-{
-	struct page **pages;
-	int got = 0;
-	int rc = 0;
-
-	pages = kmalloc_array(num_pages, sizeof(*pages), GFP_NOFS);
-	if (!pages)
-		return ERR_PTR(-ENOMEM);
-
-	while (got < num_pages) {
-		rc = get_user_pages_fast(
-		    (unsigned long)data + ((unsigned long)got * PAGE_SIZE),
-		    num_pages - got, write_page, pages + got);
-		if (rc < 0)
-			break;
-		BUG_ON(rc == 0);
-		got += rc;
-	}
-	if (rc < 0)
-		goto fail;
-	return pages;
-
-fail:
-	ceph_put_page_vector(pages, got, false);
-	return ERR_PTR(rc);
-}
-EXPORT_SYMBOL(ceph_get_direct_page_vector);
-
 void ceph_put_page_vector(struct page **pages, int num_pages, bool dirty)
 {
 	int i;
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 58 lines · Christoph Hellwig

This function is entirely unused.

---
 include/linux/ceph/libceph.h |  4 ----
 net/ceph/pagevec.c           | 33 ---------------------------------
 2 files changed, 37 deletions(-)
include/linux/ceph/libceph.h +0 -4
index 337d5049ff93..a3cddf5f0e60 100644
@@ -299,10 +299,6 @@ int ceph_wait_for_latest_osdmap(struct ceph_client *client,
 
 /* pagevec.c */
 extern void ceph_release_page_vector(struct page **pages, int num_pages);
-
-extern struct page **ceph_get_direct_page_vector(const void __user *data,
-                                                int num_pages,
-                                                bool write_page);
 extern void ceph_put_page_vector(struct page **pages, int num_pages,
                                 bool dirty);
 extern struct page **ceph_alloc_page_vector(int num_pages, gfp_t flags);
net/ceph/pagevec.c +0 -26
index d3736f5bffec..64305e7056a1 100644
@@ -10,39 +10,6 @@
 
 #include <linux/ceph/libceph.h>
 
-/*
- * build a vector of user pages
- */
-struct page **ceph_get_direct_page_vector(const void __user *data,
-                                         int num_pages, bool write_page)
-{
-       struct page **pages;
-       int got = 0;
-       int rc = 0;
-
-       pages = kmalloc_array(num_pages, sizeof(*pages), GFP_NOFS);
-       if (!pages)
-               return ERR_PTR(-ENOMEM);
-
-       while (got < num_pages) {
-               rc = get_user_pages_fast(
-                   (unsigned long)data + ((unsigned long)got * PAGE_SIZE),
-                   num_pages - got, write_page, pages + got);
-               if (rc < 0)
-                       break;
-               BUG_ON(rc == 0);
-               got += rc;
-       }
-       if (rc < 0)
-               goto fail;
-       return pages;

net/ceph/pagevec.c line 15

Quoted 10 lines
net/ceph/pagevec.c +0 -7
-
-fail:
-       ceph_put_page_vector(pages, got, false);
-       return ERR_PTR(rc);
-}
-EXPORT_SYMBOL(ceph_get_direct_page_vector);
-
 void ceph_put_page_vector(struct page **pages, int num_pages, bool dirty)
 {
        int i;

Applied.

Thanks,

Ilya