Commit fd6dee02 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] remove mem_map_t

Random cleanup: remove the mem_map_t typedef.  Just use 'struct page'
everywhere.
parent bb772c58
...@@ -76,7 +76,7 @@ extern plat_pg_data_t *plat_node_data[]; ...@@ -76,7 +76,7 @@ extern plat_pg_data_t *plat_node_data[];
#define MIPS64_NR(kaddr) (((unsigned long)(kaddr) > (unsigned long)high_memory)\ #define MIPS64_NR(kaddr) (((unsigned long)(kaddr) > (unsigned long)high_memory)\
? (max_mapnr + 1) : (LOCAL_MAP_NR((kaddr)) + \ ? (max_mapnr + 1) : (LOCAL_MAP_NR((kaddr)) + \
(((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \ (((unsigned long)ADDR_TO_MAPBASE((kaddr)) - PAGE_OFFSET) / \
sizeof(mem_map_t)))) sizeof(struct page))))
#define kern_addr_valid(addr) ((KVADDR_TO_NID((unsigned long)addr) > \ #define kern_addr_valid(addr) ((KVADDR_TO_NID((unsigned long)addr) > \
-1) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \ -1) ? 0 : (test_bit(LOCAL_MAP_NR((addr)), \
......
...@@ -145,7 +145,7 @@ struct vm_operations_struct { ...@@ -145,7 +145,7 @@ struct vm_operations_struct {
* *
* TODO: make this structure smaller, it could be as small as 32 bytes. * TODO: make this structure smaller, it could be as small as 32 bytes.
*/ */
typedef struct page { struct page {
struct list_head list; /* ->mapping has some page lists. */ struct list_head list; /* ->mapping has some page lists. */
struct address_space *mapping; /* The inode (or ...) we belong to. */ struct address_space *mapping; /* The inode (or ...) we belong to. */
unsigned long index; /* Our offset within mapping. */ unsigned long index; /* Our offset within mapping. */
...@@ -170,7 +170,7 @@ typedef struct page { ...@@ -170,7 +170,7 @@ typedef struct page {
void *virtual; /* Kernel virtual address (NULL if void *virtual; /* Kernel virtual address (NULL if
not kmapped, ie. highmem) */ not kmapped, ie. highmem) */
#endif /* CONFIG_HIGMEM || WANT_PAGE_VIRTUAL */ #endif /* CONFIG_HIGMEM || WANT_PAGE_VIRTUAL */
} mem_map_t; };
/* /*
* Methods to modify the page usage count. * Methods to modify the page usage count.
...@@ -306,7 +306,7 @@ static inline void set_page_zone(struct page *page, unsigned long zone_num) ...@@ -306,7 +306,7 @@ static inline void set_page_zone(struct page *page, unsigned long zone_num)
#define NOPAGE_OOM ((struct page *) (-1)) #define NOPAGE_OOM ((struct page *) (-1))
/* The array of struct pages */ /* The array of struct pages */
extern mem_map_t * mem_map; extern struct page *mem_map;
extern void show_free_areas(void); extern void show_free_areas(void);
extern void show_free_areas_node(pg_data_t *pgdat); extern void show_free_areas_node(pg_data_t *pgdat);
......
...@@ -172,8 +172,8 @@ extern pg_data_t contig_page_data; ...@@ -172,8 +172,8 @@ extern pg_data_t contig_page_data;
#endif /* !CONFIG_DISCONTIGMEM */ #endif /* !CONFIG_DISCONTIGMEM */
#define MAP_ALIGN(x) ((((x) % sizeof(mem_map_t)) == 0) ? (x) : ((x) + \ #define MAP_ALIGN(x) ((((x) % sizeof(struct page)) == 0) ? (x) : ((x) + \
sizeof(mem_map_t) - ((x) % sizeof(mem_map_t)))) sizeof(struct page) - ((x) % sizeof(struct page))))
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -69,7 +69,7 @@ static inline void copy_cow_page(struct page * from, struct page * to, unsigned ...@@ -69,7 +69,7 @@ static inline void copy_cow_page(struct page * from, struct page * to, unsigned
copy_user_highpage(to, from, address); copy_user_highpage(to, from, address);
} }
mem_map_t * mem_map; struct page *mem_map;
/* /*
* Note: this doesn't free the actual pages themselves. That * Note: this doesn't free the actual pages themselves. That
......
...@@ -65,8 +65,8 @@ void __init free_area_init_node(int nid, pg_data_t *pgdat, struct page *pmap, ...@@ -65,8 +65,8 @@ void __init free_area_init_node(int nid, pg_data_t *pgdat, struct page *pmap,
int i, size = 0; int i, size = 0;
struct page *discard; struct page *discard;
if (mem_map == (mem_map_t *)NULL) if (mem_map == NULL)
mem_map = (mem_map_t *)PAGE_OFFSET; mem_map = (struct page *)PAGE_OFFSET;
free_area_init_core(nid, pgdat, &discard, zones_size, zone_start_paddr, free_area_init_core(nid, pgdat, &discard, zones_size, zone_start_paddr,
zholes_size, pmap); zholes_size, pmap);
......
...@@ -272,8 +272,8 @@ void *snd_malloc_pages(unsigned long size, unsigned int dma_flags) ...@@ -272,8 +272,8 @@ void *snd_malloc_pages(unsigned long size, unsigned int dma_flags)
snd_assert(dma_flags != 0, return NULL); snd_assert(dma_flags != 0, return NULL);
for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++); for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++);
if ((res = (void *) __get_free_pages(dma_flags, pg)) != NULL) { if ((res = (void *) __get_free_pages(dma_flags, pg)) != NULL) {
mem_map_t *page = virt_to_page(res); struct page *page = virt_to_page(res);
mem_map_t *last_page = page + (1 << pg); struct page *last_page = page + (1 << pg);
while (page < last_page) while (page < last_page)
SetPageReserved(page++); SetPageReserved(page++);
#ifdef CONFIG_SND_DEBUG_MEMORY #ifdef CONFIG_SND_DEBUG_MEMORY
...@@ -302,7 +302,7 @@ void *snd_malloc_pages_fallback(unsigned long size, unsigned int dma_flags, unsi ...@@ -302,7 +302,7 @@ void *snd_malloc_pages_fallback(unsigned long size, unsigned int dma_flags, unsi
void snd_free_pages(void *ptr, unsigned long size) void snd_free_pages(void *ptr, unsigned long size)
{ {
int pg; int pg;
mem_map_t *page, *last_page; struct page *page, *last_page;
if (ptr == NULL) if (ptr == NULL)
return; return;
...@@ -338,8 +338,8 @@ void *snd_malloc_isa_pages(unsigned long size, dma_addr_t *dma_addr) ...@@ -338,8 +338,8 @@ void *snd_malloc_isa_pages(unsigned long size, dma_addr_t *dma_addr)
for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++); for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++);
dma_area = pci_alloc_consistent(NULL, size, dma_addr); dma_area = pci_alloc_consistent(NULL, size, dma_addr);
if (dma_area != NULL) { if (dma_area != NULL) {
mem_map_t *page = virt_to_page(dma_area); struct page *page = virt_to_page(dma_area);
mem_map_t *last_page = page + (1 << pg); struct page *last_page = page + (1 << pg);
while (page < last_page) while (page < last_page)
SetPageReserved(page++); SetPageReserved(page++);
#ifdef CONFIG_SND_DEBUG_MEMORY #ifdef CONFIG_SND_DEBUG_MEMORY
...@@ -391,8 +391,8 @@ void *snd_malloc_pci_pages(struct pci_dev *pci, ...@@ -391,8 +391,8 @@ void *snd_malloc_pci_pages(struct pci_dev *pci,
for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++); for (pg = 0; PAGE_SIZE * (1 << pg) < size; pg++);
res = pci_alloc_consistent(pci, PAGE_SIZE * (1 << pg), dma_addr); res = pci_alloc_consistent(pci, PAGE_SIZE * (1 << pg), dma_addr);
if (res != NULL) { if (res != NULL) {
mem_map_t *page = virt_to_page(res); struct page *page = virt_to_page(res);
mem_map_t *last_page = page + (1 << pg); struct page *last_page = page + (1 << pg);
while (page < last_page) while (page < last_page)
SetPageReserved(page++); SetPageReserved(page++);
#ifdef CONFIG_SND_DEBUG_MEMORY #ifdef CONFIG_SND_DEBUG_MEMORY
...@@ -426,7 +426,7 @@ void snd_free_pci_pages(struct pci_dev *pci, ...@@ -426,7 +426,7 @@ void snd_free_pci_pages(struct pci_dev *pci,
dma_addr_t dma_addr) dma_addr_t dma_addr)
{ {
int pg; int pg;
mem_map_t *page, *last_page; struct page *page, *last_page;
if (ptr == NULL) if (ptr == NULL)
return; return;
......
...@@ -111,8 +111,8 @@ static void *rme9652_malloc_pages(struct pci_dev *pci, ...@@ -111,8 +111,8 @@ static void *rme9652_malloc_pages(struct pci_dev *pci,
*dmaaddr = virt_to_bus(res); *dmaaddr = virt_to_bus(res);
#endif #endif
if (res != NULL) { if (res != NULL) {
mem_map_t *page = virt_to_page(res); struct page *page = virt_to_page(res);
mem_map_t *last_page = page + (size + PAGE_SIZE - 1) / PAGE_SIZE; struct page *last_page = page + (size + PAGE_SIZE - 1) / PAGE_SIZE;
while (page < last_page) while (page < last_page)
set_bit(PG_reserved, &(page++)->flags); set_bit(PG_reserved, &(page++)->flags);
} }
...@@ -122,7 +122,7 @@ static void *rme9652_malloc_pages(struct pci_dev *pci, ...@@ -122,7 +122,7 @@ static void *rme9652_malloc_pages(struct pci_dev *pci,
static void rme9652_free_pages(struct pci_dev *pci, unsigned long size, static void rme9652_free_pages(struct pci_dev *pci, unsigned long size,
void *ptr, dma_addr_t dmaaddr) void *ptr, dma_addr_t dmaaddr)
{ {
mem_map_t *page, *last_page; struct page *page, *last_page;
if (ptr == NULL) if (ptr == NULL)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment