Skip to content

Commit

Permalink
libceph: remove ceph_get_direct_page_vector()
Browse files Browse the repository at this point in the history
This function is entirely unused.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
  • Loading branch information
Christoph Hellwig authored and Ilya Dryomov committed Jul 8, 2019
1 parent 0ecfebd commit 97a385e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
4 changes: 0 additions & 4 deletions include/linux/ceph/libceph.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
33 changes: 0 additions & 33 deletions net/ceph/pagevec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? FOLL_WRITE : 0, 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;
Expand Down

0 comments on commit 97a385e

Please sign in to comment.