Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146655466
D41255.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D41255.id.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/asm/set_memory.h b/sys/compat/linuxkpi/common/include/asm/set_memory.h
--- a/sys/compat/linuxkpi/common/include/asm/set_memory.h
+++ b/sys/compat/linuxkpi/common/include/asm/set_memory.h
@@ -54,7 +54,7 @@
}
static inline int
-set_pages_uc(vm_page_t page, int numpages)
+set_pages_uc(struct page *page, int numpages)
{
KASSERT(numpages == 1, ("%s: numpages %d", __func__, numpages));
@@ -63,7 +63,7 @@
}
static inline int
-set_pages_wc(vm_page_t page, int numpages)
+set_pages_wc(struct page *page, int numpages)
{
KASSERT(numpages == 1, ("%s: numpages %d", __func__, numpages));
@@ -76,7 +76,7 @@
}
static inline int
-set_pages_wb(vm_page_t page, int numpages)
+set_pages_wb(struct page *page, int numpages)
{
KASSERT(numpages == 1, ("%s: numpages %d", __func__, numpages));
@@ -85,7 +85,7 @@
}
static inline int
-set_pages_array_wb(vm_page_t *pages, int addrinarray)
+set_pages_array_wb(struct page **pages, int addrinarray)
{
int i;
@@ -95,7 +95,7 @@
}
static inline int
-set_pages_array_wc(vm_page_t *pages, int addrinarray)
+set_pages_array_wc(struct page **pages, int addrinarray)
{
int i;
@@ -105,7 +105,7 @@
}
static inline int
-set_pages_array_uc(vm_page_t *pages, int addrinarray)
+set_pages_array_uc(struct page **pages, int addrinarray)
{
int i;
diff --git a/sys/compat/linuxkpi/common/include/linux/gfp.h b/sys/compat/linuxkpi/common/include/linux/gfp.h
--- a/sys/compat/linuxkpi/common/include/linux/gfp.h
+++ b/sys/compat/linuxkpi/common/include/linux/gfp.h
@@ -99,8 +99,8 @@
/*
* Page management for unmapped pages:
*/
-extern vm_page_t linux_alloc_pages(gfp_t flags, unsigned int order);
-extern void linux_free_pages(vm_page_t page, unsigned int order);
+extern struct page *linux_alloc_pages(gfp_t flags, unsigned int order);
+extern void linux_free_pages(struct page *page, unsigned int order);
void *linuxkpi_page_frag_alloc(struct page_frag_cache *, size_t, gfp_t);
void linuxkpi_page_frag_free(void *);
void linuxkpi__page_frag_cache_drain(struct page *, size_t);
diff --git a/sys/compat/linuxkpi/common/include/linux/highmem.h b/sys/compat/linuxkpi/common/include/linux/highmem.h
--- a/sys/compat/linuxkpi/common/include/linux/highmem.h
+++ b/sys/compat/linuxkpi/common/include/linux/highmem.h
@@ -47,7 +47,7 @@
#define PageHighMem(p) (0)
-static inline vm_page_t
+static inline struct page *
kmap_to_page(void *addr)
{
@@ -55,7 +55,7 @@
}
static inline void *
-kmap(vm_page_t page)
+kmap(struct page *page)
{
struct sf_buf *sf;
@@ -73,7 +73,7 @@
}
static inline void *
-kmap_atomic_prot(vm_page_t page, pgprot_t prot)
+kmap_atomic_prot(struct page *page, pgprot_t prot)
{
vm_memattr_t attr = pgprot2cachemode(prot);
@@ -87,21 +87,21 @@
}
static inline void *
-kmap_atomic(vm_page_t page)
+kmap_atomic(struct page *page)
{
return (kmap_atomic_prot(page, VM_PROT_ALL));
}
static inline void *
-kmap_local_page_prot(vm_page_t page, pgprot_t prot)
+kmap_local_page_prot(struct page *page, pgprot_t prot)
{
return (kmap_atomic_prot(page, prot));
}
static inline void
-kunmap(vm_page_t page)
+kunmap(struct page *page)
{
struct sf_buf *sf;
diff --git a/sys/compat/linuxkpi/common/include/linux/mm.h b/sys/compat/linuxkpi/common/include/linux/mm.h
--- a/sys/compat/linuxkpi/common/include/linux/mm.h
+++ b/sys/compat/linuxkpi/common/include/linux/mm.h
@@ -248,19 +248,19 @@
#define offset_in_page(off) ((unsigned long)(off) & (PAGE_SIZE - 1))
static inline void
-set_page_dirty(struct vm_page *page)
+set_page_dirty(struct page *page)
{
vm_page_dirty(page);
}
static inline void
-mark_page_accessed(struct vm_page *page)
+mark_page_accessed(struct page *page)
{
vm_page_reference(page);
}
static inline void
-get_page(struct vm_page *page)
+get_page(struct page *page)
{
vm_page_wire(page);
}
@@ -307,7 +307,7 @@
}
static inline void
-put_page(struct vm_page *page)
+put_page(struct page *page)
{
vm_page_unwire(page, PQ_ACTIVE);
}
@@ -323,7 +323,7 @@
return (vm_flags & VM_PROT_ALL);
}
-static inline vm_page_t
+static inline struct page *
vmalloc_to_page(const void *addr)
{
vm_paddr_t paddr;
diff --git a/sys/compat/linuxkpi/common/include/linux/pagevec.h b/sys/compat/linuxkpi/common/include/linux/pagevec.h
--- a/sys/compat/linuxkpi/common/include/linux/pagevec.h
+++ b/sys/compat/linuxkpi/common/include/linux/pagevec.h
@@ -13,7 +13,7 @@
struct pagevec {
uint8_t nr;
- struct vm_page *pages[PAGEVEC_SIZE];
+ struct page *pages[PAGEVEC_SIZE];
};
static inline unsigned int
@@ -41,7 +41,7 @@
}
static inline unsigned int
-pagevec_add(struct pagevec *pvec, struct vm_page *page)
+pagevec_add(struct pagevec *pvec, struct page *page)
{
pvec->pages[pvec->nr++] = page;
return PAGEVEC_SIZE - pvec->nr;
diff --git a/sys/compat/linuxkpi/common/src/linux_page.c b/sys/compat/linuxkpi/common/src/linux_page.c
--- a/sys/compat/linuxkpi/common/src/linux_page.c
+++ b/sys/compat/linuxkpi/common/src/linux_page.c
@@ -98,10 +98,10 @@
IDX_TO_OFF(page->pindex)));
}
-vm_page_t
+struct page *
linux_alloc_pages(gfp_t flags, unsigned int order)
{
- vm_page_t page;
+ struct page *page;
if (PMAP_HAS_DMAP) {
unsigned long npages = 1UL << order;
@@ -148,7 +148,7 @@
}
void
-linux_free_pages(vm_page_t page, unsigned int order)
+linux_free_pages(struct page *page, unsigned int order)
{
if (PMAP_HAS_DMAP) {
unsigned long npages = 1UL << order;
diff --git a/sys/compat/linuxkpi/common/src/linux_shmemfs.c b/sys/compat/linuxkpi/common/src/linux_shmemfs.c
--- a/sys/compat/linuxkpi/common/src/linux_shmemfs.c
+++ b/sys/compat/linuxkpi/common/src/linux_shmemfs.c
@@ -47,7 +47,7 @@
struct page *
linux_shmem_read_mapping_page_gfp(vm_object_t obj, int pindex, gfp_t gfp)
{
- vm_page_t page;
+ struct page *page;
int rv;
if ((gfp & GFP_NOWAIT) != 0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 5, 11:21 AM (11 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29283078
Default Alt Text
D41255.id.diff (5 KB)
Attached To
Mode
D41255: LinuxKPI: reduce usage of struct vm_page and vm_page_t
Attached
Detach File
Event Timeline
Log In to Comment