Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2002-03-06 00:46:23 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-03-06 00:46:23 -0800
commit6aa0c79e5d777f467c567d17a4aaa67fb7262076 (patch)
treef87e5164e856174226fba5fc2f5df8595e15228b
parent00cbd440ab6b7e9652ed99e925d044a8882593e8 (diff)
parent8877f6e2b4b6b7d617dfd073303ee995b436d725 (diff)
Merge bk://linuxvm.bkbits.net/linux-2.5-vmtidbits
into penguin.transmeta.com:/home/penguin/torvalds/repositories/kernel/linux
-rw-r--r--drivers/char/agp/agpgart_be.c40
-rw-r--r--drivers/char/drm/i810_dma.c9
-rw-r--r--include/linux/mm.h5
-rw-r--r--mm/page_alloc.c2
4 files changed, 22 insertions, 34 deletions
diff --git a/drivers/char/agp/agpgart_be.c b/drivers/char/agp/agpgart_be.c
index 3335b538deaf..fdd404f50e0f 100644
--- a/drivers/char/agp/agpgart_be.c
+++ b/drivers/char/agp/agpgart_be.c
@@ -622,7 +622,7 @@ static int agp_generic_create_gatt_table(void)
table_end = table + ((PAGE_SIZE * (1 << page_order)) - 1);
for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
- set_bit(PG_reserved, &page->flags);
+ SetPageReserved(page);
agp_bridge.gatt_table_real = (unsigned long *) table;
CACHE_FLUSH();
@@ -632,7 +632,7 @@ static int agp_generic_create_gatt_table(void)
if (agp_bridge.gatt_table == NULL) {
for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
- clear_bit(PG_reserved, &page->flags);
+ ClearPageReserved(page);
free_pages((unsigned long) table, page_order);
@@ -699,7 +699,7 @@ static int agp_generic_free_gatt_table(void)
table_end = table + ((PAGE_SIZE * (1 << page_order)) - 1);
for (page = virt_to_page(table); page <= virt_to_page(table_end); page++)
- clear_bit(PG_reserved, &page->flags);
+ ClearPageReserved(page);
free_pages((unsigned long) agp_bridge.gatt_table_real, page_order);
return 0;
@@ -812,8 +812,8 @@ static unsigned long agp_generic_alloc_page(void)
if (page == NULL) {
return 0;
}
- atomic_inc(&page->count);
- set_bit(PG_locked, &page->flags);
+ get_page(page);
+ LockPage(page);
atomic_inc(&agp_bridge.current_memory_agp);
return (unsigned long)page_address(page);
}
@@ -828,9 +828,8 @@ static void agp_generic_destroy_page(unsigned long addr)
}
page = virt_to_page(pt);
- atomic_dec(&page->count);
- clear_bit(PG_locked, &page->flags);
- wake_up_page(page);
+ put_page(page);
+ UnlockPage(page);
free_page((unsigned long) pt);
atomic_dec(&agp_bridge.current_memory_agp);
}
@@ -2278,13 +2277,12 @@ static int amd_create_page_map(amd_page_map *page_map)
if (page_map->real == NULL) {
return -ENOMEM;
}
- set_bit(PG_reserved, &virt_to_page(page_map->real)->flags);
+ SetPageReserved(virt_to_page(page_map->real));
CACHE_FLUSH();
page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
PAGE_SIZE);
if (page_map->remapped == NULL) {
- clear_bit(PG_reserved,
- &virt_to_page(page_map->real)->flags);
+ ClearPageReserved(virt_to_page(page_map->real));
free_page((unsigned long) page_map->real);
page_map->real = NULL;
return -ENOMEM;
@@ -2301,8 +2299,7 @@ static int amd_create_page_map(amd_page_map *page_map)
static void amd_free_page_map(amd_page_map *page_map)
{
iounmap(page_map->remapped);
- clear_bit(PG_reserved,
- &virt_to_page(page_map->real)->flags);
+ ClearPageReserved(virt_to_page(page_map->real));
free_page((unsigned long) page_map->real);
}
@@ -2790,8 +2787,8 @@ static unsigned long ali_alloc_page(void)
if (page == NULL)
return 0;
- atomic_inc(&page->count);
- set_bit(PG_locked, &page->flags);
+ get_page(page);
+ LockPage(page);
atomic_inc(&agp_bridge.current_memory_agp);
global_cache_flush();
@@ -2826,9 +2823,8 @@ static void ali_destroy_page(unsigned long addr)
}
page = virt_to_page(pt);
- atomic_dec(&page->count);
- clear_bit(PG_locked, &page->flags);
- wake_up_page(page);
+ put_page(page);
+ UnlockPage(page);
free_page((unsigned long) pt);
atomic_dec(&agp_bridge.current_memory_agp);
}
@@ -2910,13 +2906,12 @@ static int serverworks_create_page_map(serverworks_page_map *page_map)
if (page_map->real == NULL) {
return -ENOMEM;
}
- set_bit(PG_reserved, &virt_to_page(page_map->real)->flags);
+ SetPageReserved(virt_to_page(page_map->real));
CACHE_FLUSH();
page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
PAGE_SIZE);
if (page_map->remapped == NULL) {
- clear_bit(PG_reserved,
- &virt_to_page(page_map->real)->flags);
+ ClearPageReserved(virt_to_page(page_map->real));
free_page((unsigned long) page_map->real);
page_map->real = NULL;
return -ENOMEM;
@@ -2933,8 +2928,7 @@ static int serverworks_create_page_map(serverworks_page_map *page_map)
static void serverworks_free_page_map(serverworks_page_map *page_map)
{
iounmap(page_map->remapped);
- clear_bit(PG_reserved,
- &virt_to_page(page_map->real)->flags);
+ ClearPageReserved(virt_to_page(page_map->real));
free_page((unsigned long) page_map->real);
}
diff --git a/drivers/char/drm/i810_dma.c b/drivers/char/drm/i810_dma.c
index 2f40db80106e..8629e0e5fa09 100644
--- a/drivers/char/drm/i810_dma.c
+++ b/drivers/char/drm/i810_dma.c
@@ -286,8 +286,8 @@ static unsigned long i810_alloc_page(drm_device_t *dev)
if(address == 0UL)
return 0;
- atomic_inc(&virt_to_page(address)->count);
- set_bit(PG_locked, &virt_to_page(address)->flags);
+ get_page(virt_to_page(address));
+ LockPage(virt_to_page(address));
return address;
}
@@ -296,9 +296,8 @@ static void i810_free_page(drm_device_t *dev, unsigned long page)
{
if (page) {
struct page *p = virt_to_page(page);
- atomic_dec(p);
- clear_bit(PG_locked, &p->flags);
- wake_up_page(p);
+ put_page(p);
+ UnlockPage(p);
free_page(page);
}
}
diff --git a/include/linux/mm.h b/include/linux/mm.h
index d823fe4a9e56..543c93e1eb7a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -193,11 +193,6 @@ typedef struct page {
#define page_count(p) atomic_read(&(p)->count)
#define set_page_count(p,v) atomic_set(&(p)->count, v)
-static inline void init_page_count(struct page *page)
-{
- page->count.counter = 0;
-}
-
/*
* Various page->flags bits:
*
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d3e3650d4e8c..7c56fe573d91 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -811,7 +811,7 @@ void __init free_area_init_core(int nid, pg_data_t *pgdat, struct page **gmap,
for (i = 0; i < size; i++) {
struct page *page = mem_map + offset + i;
set_page_zone(page, nid * MAX_NR_ZONES + j);
- init_page_count(page);
+ set_page_count(page, 0);
__SetPageReserved(page);
memlist_init(&page->list);
if (j != ZONE_HIGHMEM)