diff options
| author | Andrew Morton <akpm@digeo.com> | 2002-10-07 20:38:55 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-10-07 20:38:55 -0700 |
| commit | 15e28e8d45273677a31fad76102acc3bc4cf88f6 (patch) | |
| tree | e73d70761b467d4e3e07398c4697623a11956fea | |
| parent | 76a0722ffe4c7b7832ec07f9e9de1c6e58c31d74 (diff) | |
[PATCH] remove get_free_page()
This used to be a macro wrapper around get_zeroed_page().
It was a dreadful choice of name, because it hid the fact that this
function memsets the page. Probably, lots of the callers didn't
actually want to do that but this patch does not make such
optimisations.
At least now, people may spot a `get_zeroed_page' in there and realise
that the page doesn't actually need to be initialised.
The patch also changes get_zeroed_page() to go BUG if called with
__GFP_HIGHMEM. It returns the address of the page's memory and hence
can only be used for direct-mapped pages (wli).
62 files changed, 108 insertions, 107 deletions
diff --git a/arch/arm/mach-footbridge/mm.c b/arch/arm/mach-footbridge/mm.c index d23333aee6e1..153ff06c9071 100644 --- a/arch/arm/mach-footbridge/mm.c +++ b/arch/arm/mach-footbridge/mm.c @@ -80,7 +80,7 @@ void __init footbridge_map_io(void) /* * These two functions convert virtual addresses to PCI addresses and PCI * addresses to virtual addresses. Note that it is only legal to use these - * on memory obtained via get_free_page or kmalloc. + * on memory obtained via get_zeroed_page or kmalloc. */ unsigned long __virt_to_bus(unsigned long res) { diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c index 9a4f576ba3f4..005d67b8a17e 100644 --- a/arch/ia64/hp/sim/simserial.c +++ b/arch/ia64/hp/sim/simserial.c @@ -773,7 +773,7 @@ startup(struct async_struct *info) struct serial_state *state= info->state; unsigned long page; - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return -ENOMEM; @@ -900,7 +900,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; if (!tmp_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) { /* MOD_DEC_USE_COUNT; "info->tty" will cause this? */ return -ENOMEM; diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index a4daee076ed4..f83be161e18e 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c @@ -4049,7 +4049,7 @@ nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32) memset(karg, 0, sizeof(*karg)); if(__get_user(karg->ca_version, &arg32->ca32_version)) return -EFAULT; - karg->ca_umap.ug_ident = (char *)get_free_page(GFP_USER); + karg->ca_umap.ug_ident = (char *)get_zeroed_page(GFP_USER); if(!karg->ca_umap.ug_ident) return -ENOMEM; err = __get_user(uaddr, &arg32->ca32_umap.ug32_ident); diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 560d65faf0be..2b36f6f43eda 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c @@ -560,7 +560,7 @@ cpu_init (void) if (cpu == 0) my_cpu_data = alloc_bootmem_pages(__per_cpu_end - __per_cpu_start); else - my_cpu_data = (void *) get_free_page(GFP_KERNEL); + my_cpu_data = (void *) get_zeroed_page(GFP_KERNEL); memcpy(my_cpu_data, __phys_per_cpu_start, __per_cpu_end - __per_cpu_start); __per_cpu_offset[cpu] = (char *) my_cpu_data - __per_cpu_start; my_cpu_info = my_cpu_data + ((char *) &__get_cpu_var(cpu_info) - __per_cpu_start); diff --git a/arch/m68k/mm/memory.c b/arch/m68k/mm/memory.c index ba610f9d9fa1..a7cbc1159574 100644 --- a/arch/m68k/mm/memory.c +++ b/arch/m68k/mm/memory.c @@ -80,7 +80,7 @@ pmd_t *get_pointer_table (void) void *page; ptable_desc *new; - if (!(page = (void *)get_free_page(GFP_KERNEL))) + if (!(page = (void *)get_zeroed_page(GFP_KERNEL))) return 0; flush_tlb_kernel_page(page); diff --git a/arch/mips/baget/vacserial.c b/arch/mips/baget/vacserial.c index f2fbcabcde0e..a7da0a1135d7 100644 --- a/arch/mips/baget/vacserial.c +++ b/arch/mips/baget/vacserial.c @@ -650,7 +650,7 @@ static int startup(struct async_struct * info) struct serial_state *state= info->state; unsigned long page; - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return -ENOMEM; @@ -2022,7 +2022,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; if (!tmp_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) { /* MOD_DEC_USE_COUNT; "info->tty" will cause this */ return -ENOMEM; diff --git a/arch/ppc64/kernel/ioctl32.c b/arch/ppc64/kernel/ioctl32.c index 41e0f9201f4d..28d090cd7d14 100644 --- a/arch/ppc64/kernel/ioctl32.c +++ b/arch/ppc64/kernel/ioctl32.c @@ -555,7 +555,7 @@ static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32))) return -EFAULT; - ifr.ifr_data = (__kernel_caddr_t)get_free_page(GFP_KERNEL); + ifr.ifr_data = (__kernel_caddr_t)get_zeroed_page(GFP_KERNEL); if (!ifr.ifr_data) return -EAGAIN; @@ -620,7 +620,7 @@ static int bond_ioctl(unsigned long fd, unsigned int cmd, unsigned long arg) if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32))) return -EFAULT; - ifr.ifr_data = (__kernel_caddr_t)get_free_page(GFP_KERNEL); + ifr.ifr_data = (__kernel_caddr_t)get_zeroed_page(GFP_KERNEL); if (!ifr.ifr_data) return -EAGAIN; diff --git a/arch/ppc64/kernel/rtas_flash.c b/arch/ppc64/kernel/rtas_flash.c index 0f29cb0b95c0..6062ddcedfea 100644 --- a/arch/ppc64/kernel/rtas_flash.c +++ b/arch/ppc64/kernel/rtas_flash.c @@ -43,7 +43,7 @@ static int rtas_flash_open(struct inode *inode, struct file *file) if ((file->f_mode & FMODE_WRITE) && flash_possible) { if (flist) return -EBUSY; - flist = (struct flash_block_list *)get_free_page(GFP_KERNEL); + flist = (struct flash_block_list *)get_zeroed_page(GFP_KERNEL); if (!flist) return -ENOMEM; } @@ -175,7 +175,7 @@ static ssize_t rtas_flash_write(struct file *file, const char *buffer, next_free = fl->num_blocks; if (next_free == FLASH_BLOCKS_PER_NODE) { /* Need to allocate another block_list */ - fl->next = (struct flash_block_list *)get_free_page(GFP_KERNEL); + fl->next = (struct flash_block_list *)get_zeroed_page(GFP_KERNEL); if (!fl->next) return -ENOMEM; fl = fl->next; @@ -184,7 +184,7 @@ static ssize_t rtas_flash_write(struct file *file, const char *buffer, if (len > PAGE_SIZE) len = PAGE_SIZE; - p = (char *)get_free_page(GFP_KERNEL); + p = (char *)get_zeroed_page(GFP_KERNEL); if (!p) return -ENOMEM; if(copy_from_user(p, buffer, len)) { diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c index f2ab8459f35d..2abb55adca76 100644 --- a/arch/ppc64/kernel/sys_ppc32.c +++ b/arch/ppc64/kernel/sys_ppc32.c @@ -1575,7 +1575,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32) memset(karg, 0, sizeof(*karg)); if(__get_user(karg->ca_version, &arg32->ca32_version)) return -EFAULT; - karg->ca_umap.ug_ident = (char *)get_free_page(GFP_USER); + karg->ca_umap.ug_ident = (char *)get_zeroed_page(GFP_USER); if(!karg->ca_umap.ug_ident) return -ENOMEM; err = __get_user(uaddr, &arg32->ca32_umap.ug32_ident); diff --git a/arch/s390x/kernel/ioctl32.c b/arch/s390x/kernel/ioctl32.c index 4e78b4db7021..1230140af5b4 100644 --- a/arch/s390x/kernel/ioctl32.c +++ b/arch/s390x/kernel/ioctl32.c @@ -214,7 +214,7 @@ static int bond_ioctl(unsigned long fd, unsigned int cmd, unsigned long arg) if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32))) return -EFAULT; - ifr.ifr_data = (__kernel_caddr_t)get_free_page(GFP_KERNEL); + ifr.ifr_data = (__kernel_caddr_t)get_zeroed_page(GFP_KERNEL); if (!ifr.ifr_data) return -EAGAIN; diff --git a/arch/s390x/kernel/linux32.c b/arch/s390x/kernel/linux32.c index 3eab1e7946aa..3ea9ee726ce5 100644 --- a/arch/s390x/kernel/linux32.c +++ b/arch/s390x/kernel/linux32.c @@ -3680,7 +3680,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32) memset(karg, 0, sizeof(*karg)); if(__get_user(karg->ca_version, &arg32->ca32_version)) return -EFAULT; - karg->ca_umap.ug_ident = (char *)get_free_page(GFP_USER); + karg->ca_umap.ug_ident = (char *)get_zeroed_page(GFP_USER); if(!karg->ca_umap.ug_ident) return -ENOMEM; err = __get_user(uaddr, &arg32->ca32_umap.ug32_ident); diff --git a/arch/sparc64/kernel/ioctl32.c b/arch/sparc64/kernel/ioctl32.c index 6940790ca34e..9b81ea63d536 100644 --- a/arch/sparc64/kernel/ioctl32.c +++ b/arch/sparc64/kernel/ioctl32.c @@ -561,7 +561,7 @@ static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32))) return -EFAULT; - ifr.ifr_data = (__kernel_caddr_t)get_free_page(GFP_KERNEL); + ifr.ifr_data = (__kernel_caddr_t)get_zeroed_page(GFP_KERNEL); if (!ifr.ifr_data) return -EAGAIN; @@ -626,7 +626,7 @@ static int bond_ioctl(unsigned long fd, unsigned int cmd, unsigned long arg) if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32))) return -EFAULT; - ifr.ifr_data = (__kernel_caddr_t)get_free_page(GFP_KERNEL); + ifr.ifr_data = (__kernel_caddr_t)get_zeroed_page(GFP_KERNEL); if (!ifr.ifr_data) return -EAGAIN; diff --git a/arch/sparc64/kernel/sys_sparc32.c b/arch/sparc64/kernel/sys_sparc32.c index 994900c80396..1a508917b756 100644 --- a/arch/sparc64/kernel/sys_sparc32.c +++ b/arch/sparc64/kernel/sys_sparc32.c @@ -3609,7 +3609,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32) memset(karg, 0, sizeof(*karg)); if(__get_user(karg->ca_version, &arg32->ca32_version)) return -EFAULT; - karg->ca_umap.ug_ident = (char *)get_free_page(GFP_USER); + karg->ca_umap.ug_ident = (char *)get_zeroed_page(GFP_USER); if(!karg->ca_umap.ug_ident) return -ENOMEM; err = __get_user(uaddr, &arg32->ca32_umap.ug32_ident); diff --git a/arch/x86_64/ia32/ia32_ioctl.c b/arch/x86_64/ia32/ia32_ioctl.c index 59f67cd24c80..28b31c54de1d 100644 --- a/arch/x86_64/ia32/ia32_ioctl.c +++ b/arch/x86_64/ia32/ia32_ioctl.c @@ -545,7 +545,7 @@ static int ethtool_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg) if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32))) return -EFAULT; - ifr.ifr_data = (__kernel_caddr_t)get_free_page(GFP_KERNEL); + ifr.ifr_data = (__kernel_caddr_t)get_zeroed_page(GFP_KERNEL); if (!ifr.ifr_data) return -EAGAIN; @@ -608,7 +608,7 @@ static int dev_ifsioc(unsigned int fd, unsigned int cmd, unsigned long arg) case SIOCGPPPVER: if (copy_from_user(&ifr, (struct ifreq32 *)arg, sizeof(struct ifreq32))) return -EFAULT; - ifr.ifr_data = (__kernel_caddr_t)get_free_page(GFP_KERNEL); + ifr.ifr_data = (__kernel_caddr_t)get_zeroed_page(GFP_KERNEL); if (!ifr.ifr_data) return -EAGAIN; break; diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c index ef36ba5973f0..ae60cb1b7c43 100644 --- a/arch/x86_64/ia32/sys_ia32.c +++ b/arch/x86_64/ia32/sys_ia32.c @@ -2467,7 +2467,7 @@ static int nfs_uud32_trans(struct nfsctl_arg *karg, struct nfsctl_arg32 *arg32) memset(karg, 0, sizeof(*karg)); if(get_user(karg->ca_version, &arg32->ca32_version)) return -EFAULT; - karg->ca_umap.ug_ident = (char *)get_free_page(GFP_USER); + karg->ca_umap.ug_ident = (char *)get_zeroed_page(GFP_USER); if(!karg->ca_umap.ug_ident) return -ENOMEM; err = get_user(uaddr, &arg32->ca32_umap.ug32_ident); diff --git a/arch/x86_64/mm/init.c b/arch/x86_64/mm/init.c index 356f7f243361..0c5b3b0e1e49 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86_64/mm/init.c @@ -80,7 +80,7 @@ static void *spp_getpage(void) { void *ptr; if (after_bootmem) - ptr = (void *) get_free_page(GFP_ATOMIC); + ptr = (void *) get_zeroed_page(GFP_ATOMIC); else ptr = alloc_bootmem_low(PAGE_SIZE); if (!ptr) diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index 9c11c0e0f63b..383c7f3c4ef3 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c @@ -906,7 +906,7 @@ static int start_rx(struct atm_dev *dev) struct eni_dev *eni_dev; eni_dev = ENI_DEV(dev); - eni_dev->rx_map = (struct atm_vcc **) get_free_page(GFP_KERNEL); + eni_dev->rx_map = (struct atm_vcc **) get_zeroed_page(GFP_KERNEL); if (!eni_dev->rx_map) { printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n", dev->number); diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index f2cb0dc17b76..fbd65583d089 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c @@ -1624,7 +1624,7 @@ static void vcc_rx_aal0(struct lanai_dev *lanai) /* -------------------- MANAGING HOST-BASED VCC TABLE: */ -/* Decide whether to use vmalloc or get_free_page for VCC table */ +/* Decide whether to use vmalloc or get_zeroed_page for VCC table */ #if (NUM_VCI * BITS_PER_LONG) <= PAGE_SIZE #define VCCTABLE_GETFREEPAGE #else @@ -1636,7 +1636,7 @@ static int __init vcc_table_allocate(struct lanai_dev *lanai) #ifdef VCCTABLE_GETFREEPAGE APRINTK((lanai->num_vci) * sizeof(struct lanai_vcc *) <= PAGE_SIZE, "vcc table > PAGE_SIZE!"); - lanai->vccs = (struct lanai_vcc **) get_free_page(GFP_KERNEL); + lanai->vccs = (struct lanai_vcc **) get_zeroed_page(GFP_KERNEL); return (lanai->vccs == NULL) ? -ENOMEM : 0; #else int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *); diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 97dbae904bcc..5a666f9a27b4 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c @@ -597,7 +597,7 @@ static int startup(struct async_struct * info) int retval=0; unsigned long page; - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return -ENOMEM; @@ -1926,7 +1926,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; if (!tmp_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) { return -ENOMEM; } diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 63cd1a149f2b..d58048290faf 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c @@ -2001,7 +2001,7 @@ startup(struct cyclades_port * info) card = info->card; channel = (info->line) - (cy_card[card].first_line); - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return -ENOMEM; @@ -2648,7 +2648,7 @@ cy_open(struct tty_struct *tty, struct file * filp) current->pid, info->count); #endif if (!tmp_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return -ENOMEM; if (tmp_buf) diff --git a/drivers/char/dz.c b/drivers/char/dz.c index 04d89cbdc704..89f6bad5838d 100644 --- a/drivers/char/dz.c +++ b/drivers/char/dz.c @@ -465,7 +465,7 @@ static int startup (struct dz_serial *info) } if (!info->xmit_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) { restore_flags (flags); return -ENOMEM; diff --git a/drivers/char/esp.c b/drivers/char/esp.c index 3e18e6648e22..726f659b96fb 100644 --- a/drivers/char/esp.c +++ b/drivers/char/esp.c @@ -894,7 +894,7 @@ static int startup(struct esp_struct * info) goto out; if (!info->xmit_buf) { - info->xmit_buf = (unsigned char *)get_free_page(GFP_KERNEL); + info->xmit_buf = (unsigned char *)get_zeroed_page(GFP_KERNEL); retval = -ENOMEM; if (!info->xmit_buf) goto out; @@ -2380,7 +2380,7 @@ static int esp_open(struct tty_struct *tty, struct file * filp) info->tty = tty; if (!tmp_buf) { - tmp_buf = (unsigned char *) get_free_page(GFP_KERNEL); + tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL); if (!tmp_buf) return -ENOMEM; } diff --git a/drivers/char/generic_serial.c b/drivers/char/generic_serial.c index 2ddc0073d921..8292ec37e316 100644 --- a/drivers/char/generic_serial.c +++ b/drivers/char/generic_serial.c @@ -952,7 +952,7 @@ int gs_init_port(struct gs_port *port) save_flags (flags); if (!tmp_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); cli (); /* Don't expect this to make a difference. */ if (tmp_buf) @@ -970,10 +970,10 @@ int gs_init_port(struct gs_port *port) return 0; if (!port->xmit_buf) { - /* We may sleep in get_free_page() */ + /* We may sleep in get_zeroed_page() */ unsigned long tmp; - tmp = get_free_page(GFP_KERNEL); + tmp = get_zeroed_page(GFP_KERNEL); /* Spinlock? */ cli (); diff --git a/drivers/char/isicom.c b/drivers/char/isicom.c index e7ad928bb680..713ed380c7b7 100644 --- a/drivers/char/isicom.c +++ b/drivers/char/isicom.c @@ -859,7 +859,7 @@ static int isicom_setup_port(struct isi_port * port) if (!port->xmit_buf) { unsigned long page; - if (!(page = get_free_page(GFP_KERNEL))) + if (!(page = get_zeroed_page(GFP_KERNEL))) return -ENOMEM; if (port->xmit_buf) { @@ -1854,7 +1854,7 @@ static int isicom_init(void) unsigned long page; if (!tmp_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) { #ifdef ISICOM_DEBUG printk(KERN_DEBUG "ISICOM: Couldn't allocate page for tmp_buf.\n"); diff --git a/drivers/char/moxa.c b/drivers/char/moxa.c index 145a324f46a5..1d286fa4e41c 100644 --- a/drivers/char/moxa.c +++ b/drivers/char/moxa.c @@ -565,7 +565,7 @@ static int moxa_open(struct tty_struct *tty, struct file *filp) } down(&moxaBuffSem); if (!moxaXmitBuff) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) { up(&moxaBuffSem); return (-ENOMEM); diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index 4679215e7639..3ec619ecc6b9 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -760,7 +760,7 @@ static int mxser_open(struct tty_struct *tty, struct file *filp) info->tty = tty; if (!mxvar_tmp_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return (-ENOMEM); if (mxvar_tmp_buf) @@ -1689,7 +1689,7 @@ static int mxser_startup(struct mxser_struct *info) unsigned long flags; unsigned long page; - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return (-ENOMEM); diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 449324f86afb..840b518c2569 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c @@ -1483,7 +1483,7 @@ static int startup(MGSLPC_INFO * info) if (!info->tx_buf) { /* allocate a page of memory for a transmit buffer */ - info->tx_buf = (unsigned char *)get_free_page(GFP_KERNEL); + info->tx_buf = (unsigned char *)get_zeroed_page(GFP_KERNEL); if (!info->tx_buf) { printk(KERN_ERR"%s(%d):%s can't allocate transmit buffer\n", __FILE__,__LINE__,info->device_name); diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c index 780e6bf85785..951419f85d18 100644 --- a/drivers/char/riscom8.c +++ b/drivers/char/riscom8.c @@ -873,10 +873,10 @@ static int rc_setup_port(struct riscom_board *bp, struct riscom_port *port) return 0; if (!port->xmit_buf) { - /* We may sleep in get_free_page() */ + /* We may sleep in get_zeroed_page() */ unsigned long tmp; - if (!(tmp = get_free_page(GFP_KERNEL))) + if (!(tmp = get_zeroed_page(GFP_KERNEL))) return -ENOMEM; if (port->xmit_buf) { @@ -1747,7 +1747,7 @@ static inline int rc_init_drivers(void) int i; - if (!(tmp_buf = (unsigned char *) get_free_page(GFP_KERNEL))) { + if (!(tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL))) { printk(KERN_ERR "rc: Couldn't get free page.\n"); return 1; } diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 03df9f8d5a8e..979457616c0b 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -826,7 +826,7 @@ static int rp_open(struct tty_struct *tty, struct file * filp) if ((line < 0) || (line >= MAX_RP_PORTS)) return -ENODEV; if (!tmp_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return -ENOMEM; if (tmp_buf) @@ -834,7 +834,7 @@ static int rp_open(struct tty_struct *tty, struct file * filp) else tmp_buf = (unsigned char *) page; } - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return -ENOMEM; diff --git a/drivers/char/serial167.c b/drivers/char/serial167.c index 59a7afacf41d..b1caa433da57 100644 --- a/drivers/char/serial167.c +++ b/drivers/char/serial167.c @@ -802,7 +802,7 @@ startup(struct cyclades_port * info) return 0; } if (!info->xmit_buf){ - info->xmit_buf = (unsigned char *) get_free_page (GFP_KERNEL); + info->xmit_buf = (unsigned char *) get_zeroed_page (GFP_KERNEL); if (!info->xmit_buf){ return -ENOMEM; } @@ -2158,7 +2158,7 @@ cy_open(struct tty_struct *tty, struct file * filp) info->tty = tty; if (!tmp_buf) { - tmp_buf = (unsigned char *) get_free_page(GFP_KERNEL); + tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL); if (!tmp_buf){ return -ENOMEM; } diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c index 376e8b151e0c..b4d46077daa8 100644 --- a/drivers/char/specialix.c +++ b/drivers/char/specialix.c @@ -1232,10 +1232,10 @@ static int sx_setup_port(struct specialix_board *bp, struct specialix_port *port return 0; if (!port->xmit_buf) { - /* We may sleep in get_free_page() */ + /* We may sleep in get_zeroed_page() */ unsigned long tmp; - if (!(tmp = get_free_page(GFP_KERNEL))) + if (!(tmp = get_zeroed_page(GFP_KERNEL))) return -ENOMEM; if (port->xmit_buf) { @@ -2226,7 +2226,7 @@ static int sx_init_drivers(void) int i; - if (!(tmp_buf = (unsigned char *) get_free_page(GFP_KERNEL))) { + if (!(tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL))) { printk(KERN_ERR "sx: Couldn't get free page.\n"); return 1; } diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index eba997674b5d..50cb47e1e991 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -1788,7 +1788,7 @@ static int startup(struct mgsl_struct * info) if (!info->xmit_buf) { /* allocate a page of memory for a transmit buffer */ - info->xmit_buf = (unsigned char *)get_free_page(GFP_KERNEL); + info->xmit_buf = (unsigned char *)get_zeroed_page(GFP_KERNEL); if (!info->xmit_buf) { printk(KERN_ERR"%s(%d):%s can't allocate transmit buffer\n", __FILE__,__LINE__,info->device_name); @@ -3633,7 +3633,7 @@ static int mgsl_open(struct tty_struct *tty, struct file * filp) } if (!tmp_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) { retval = -ENOMEM; goto cleanup; diff --git a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c index fb76ae9431ad..98f348aca8a0 100644 --- a/drivers/macintosh/macserial.c +++ b/drivers/macintosh/macserial.c @@ -755,7 +755,7 @@ static int startup(struct mac_serial * info) } if (!info->xmit_buf) { - info->xmit_buf = (unsigned char *) get_free_page(GFP_KERNEL); + info->xmit_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL); if (!info->xmit_buf) return -ENOMEM; } @@ -2276,7 +2276,7 @@ static int rs_open(struct tty_struct *tty, struct file * filp) info->tty = tty; if (!tmp_buf) { - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return -ENOMEM; if (tmp_buf) diff --git a/drivers/media/video/zr36067.c b/drivers/media/video/zr36067.c index 9db0d527f572..eb11c0433a1b 100644 --- a/drivers/media/video/zr36067.c +++ b/drivers/media/video/zr36067.c @@ -383,7 +383,7 @@ static void v4l_fbuffer_free(struct zoran *zr) * * If the requested buffer size is smaller than MAX_KMALLOC_MEM, * kmalloc is used to request a physically contiguous area, - * else we allocate the memory in framgents with get_free_page. + * else we allocate the memory in framgents with get_zeroed_page. * * If a Natoma chipset is present and this is a revision 1 zr36057, * each MJPEG buffer needs to be physically contiguous. @@ -396,7 +396,7 @@ static void v4l_fbuffer_free(struct zoran *zr) * Therefore there is no need to allocate them with vmalloc in order * to get a contiguous virtual memory space. * I don't understand why many other drivers first allocate them with - * vmalloc (which uses internally also get_free_page, but delivers you + * vmalloc (which uses internally also get_zeroed_page, but delivers you * virtual addresses) and then again have to make a lot of efforts * to get the physical address. * @@ -420,10 +420,10 @@ static int jpg_fbuffer_alloc(struct zoran *zr) /* Allocate fragment table for this buffer */ - mem = get_free_page(GFP_KERNEL); + mem = get_zeroed_page(GFP_KERNEL); if (mem == 0) { printk(KERN_ERR - "%s: jpg_fbuffer_alloc: get_free_page (frag_tab) failed for buffer %d\n", + "%s: jpg_fbuffer_alloc: get_zeroed_page (frag_tab) failed for buffer %d\n", zr->name, i); jpg_fbuffer_free(zr); return -ENOBUFS; @@ -450,10 +450,10 @@ static int jpg_fbuffer_alloc(struct zoran *zr) /* jpg_bufsize is allreay page aligned */ for (j = 0; j < zr->jpg_bufsize / PAGE_SIZE; j++) { - mem = get_free_page(GFP_KERNEL); + mem = get_zeroed_page(GFP_KERNEL); if (mem == 0) { printk(KERN_ERR - "%s: jpg_fbuffer_alloc: get_free_page failed for buffer %d\n", + "%s: jpg_fbuffer_alloc: get_zeroed_page failed for buffer %d\n", zr->name, i); jpg_fbuffer_free(zr); return -ENOBUFS; diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c index b70ff8ecdfff..7587ce3f2ecb 100644 --- a/drivers/net/ioc3-eth.c +++ b/drivers/net/ioc3-eth.c @@ -1276,10 +1276,10 @@ ioc3_alloc_rings(struct net_device *dev, struct ioc3_private *ip, if (ip->rxr == NULL) { /* Allocate and initialize rx ring. 4kb = 512 entries */ - ip->rxr = (unsigned long *) get_free_page(GFP_ATOMIC); + ip->rxr = (unsigned long *) get_zeroed_page(GFP_ATOMIC); rxr = (unsigned long *) ip->rxr; if (!rxr) - printk("ioc3_alloc_rings(): get_free_page() failed!\n"); + printk("ioc3_alloc_rings(): get_zeroed_page() failed!\n"); /* Now the rx buffers. The RX ring may be larger but we only allocate 16 buffers for now. Need to tune @@ -1311,7 +1311,7 @@ ioc3_alloc_rings(struct net_device *dev, struct ioc3_private *ip, /* Allocate and initialize tx rings. 16kb = 128 bufs. */ ip->txr = (struct ioc3_etxd *)__get_free_pages(GFP_KERNEL, 2); if (!ip->txr) - printk("ioc3_alloc_rings(): get_free_page() failed!\n"); + printk("ioc3_alloc_rings(): __get_free_pages() failed!\n"); ip->tx_pi = 0; ip->tx_ci = 0; } diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c index b545ff316b24..03c2501e6c75 100644 --- a/drivers/net/sgiseeq.c +++ b/drivers/net/sgiseeq.c @@ -615,7 +615,7 @@ int sgiseeq_init(struct net_device *dev, struct sgiseeq_regs *sregs, int i; struct sgiseeq_private *sp; - dev->priv = (struct sgiseeq_private *) get_free_page(GFP_KERNEL); + dev->priv = (struct sgiseeq_private *) get_zeroed_page(GFP_KERNEL); if (dev->priv == NULL) return -ENOMEM; diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c index 964fe65f670f..51df39b44161 100644 --- a/drivers/net/tc35815.c +++ b/drivers/net/tc35815.c @@ -640,7 +640,7 @@ tc35815_init_queues(struct net_device *dev) if ((lp->fd_buf = (void *)__get_free_pages(GFP_KERNEL, FD_PAGE_ORDER)) == 0) return -ENOMEM; for (i = 0; i < RX_BUF_PAGES; i++) { - if ((lp->data_buf[i] = (void *)get_free_page(GFP_KERNEL)) == 0) { + if ((lp->data_buf[i] = (void *)get_zeroed_page(GFP_KERNEL)) == 0) { while (--i >= 0) { free_page((unsigned long)lp->data_buf[i]); lp->data_buf[i] = 0; diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index 243999874fae..79235cbce134 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c @@ -889,12 +889,12 @@ int z8530_sync_dma_open(struct net_device *dev, struct z8530_channel *c) if(c->mtu > PAGE_SIZE/2) return -EMSGSIZE; - c->rx_buf[0]=(void *)get_free_page(GFP_KERNEL|GFP_DMA); + c->rx_buf[0]=(void *)get_zeroed_page(GFP_KERNEL|GFP_DMA); if(c->rx_buf[0]==NULL) return -ENOBUFS; c->rx_buf[1]=c->rx_buf[0]+PAGE_SIZE/2; - c->tx_dma_buf[0]=(void *)get_free_page(GFP_KERNEL|GFP_DMA); + c->tx_dma_buf[0]=(void *)get_zeroed_page(GFP_KERNEL|GFP_DMA); if(c->tx_dma_buf[0]==NULL) { free_page((unsigned long)c->rx_buf[0]); @@ -1079,7 +1079,7 @@ int z8530_sync_txdma_open(struct net_device *dev, struct z8530_channel *c) if(c->mtu > PAGE_SIZE/2) return -EMSGSIZE; - c->tx_dma_buf[0]=(void *)get_free_page(GFP_KERNEL|GFP_DMA); + c->tx_dma_buf[0]=(void *)get_zeroed_page(GFP_KERNEL|GFP_DMA); if(c->tx_dma_buf[0]==NULL) return -ENOBUFS; diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index b68c9a4fea1b..83a32fd92ce4 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -228,7 +228,7 @@ dasd_alloc_device(dasd_devmap_t *devmap) return ERR_PTR(-ENOMEM); } /* Get one page for error recovery. */ - device->erp_mem = (void *) get_free_page(GFP_ATOMIC | GFP_DMA); + device->erp_mem = (void *) get_zeroed_page(GFP_ATOMIC | GFP_DMA); if (device->erp_mem == NULL) { free_pages((unsigned long) device->ccw_mem, 1); kfree(device); diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c index cebb7b321679..e2e9779a8698 100644 --- a/drivers/s390/block/dasd_diag.c +++ b/drivers/s390/block/dasd_diag.c @@ -274,7 +274,7 @@ dasd_diag_check_device(dasd_device_t *device) mdsk_term_io(device); /* figure out blocksize of device */ - label = (long *) get_free_page(GFP_KERNEL); + label = (long *) get_zeroed_page(GFP_KERNEL); if (label == NULL) { MESSAGE(KERN_WARNING, "%s", "No memory to allocate initialization request"); @@ -437,7 +437,7 @@ dasd_diag_dump_sense(dasd_device_t *device, dasd_ccw_req_t * req) { char *page; - page = (char *) get_free_page(GFP_KERNEL); + page = (char *) get_zeroed_page(GFP_KERNEL); if (page == NULL) { MESSAGE(KERN_ERR, "%s", "No memory to dump sense data"); return; diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 36de4e2434ab..a37bf0cb0dc8 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c @@ -1344,7 +1344,7 @@ dasd_eckd_dump_sense(struct dasd_device_t *device, dasd_ccw_req_t * req) ccw1_t *act; int len, sl, sct; - page = (char *) get_free_page(GFP_ATOMIC); + page = (char *) get_zeroed_page(GFP_ATOMIC); if (page == NULL) { MESSAGE(KERN_ERR, "%s", "No memory to dump sense data"); return; diff --git a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c index da091ce0b6c9..68c21776104e 100644 --- a/drivers/s390/block/dasd_fba.c +++ b/drivers/s390/block/dasd_fba.c @@ -363,7 +363,7 @@ dasd_fba_dump_sense(struct dasd_device_t *device, dasd_ccw_req_t * req) { char *page; - page = (char *) get_free_page(GFP_KERNEL); + page = (char *) get_zeroed_page(GFP_KERNEL); if (page == NULL) { MESSAGE(KERN_ERR, "%s", "No memory to dump sense data"); return; diff --git a/drivers/s390/sysinfo.c b/drivers/s390/sysinfo.c index 3870accce4a7..87c2db1bd4f5 100644 --- a/drivers/s390/sysinfo.c +++ b/drivers/s390/sysinfo.c @@ -228,7 +228,7 @@ static int proc_read_sysinfo(char *page, char **start, off_t off, int count, int *eof, void *data) { - unsigned long info_page = get_free_page (GFP_KERNEL); + unsigned long info_page = get_zeroed_page (GFP_KERNEL); union s390_sysinfo *info = (union s390_sysinfo *) info_page; int len = 0; int level; diff --git a/drivers/sbus/char/aurora.c b/drivers/sbus/char/aurora.c index cc89c4c54c38..25761b36798e 100644 --- a/drivers/sbus/char/aurora.c +++ b/drivers/sbus/char/aurora.c @@ -1194,10 +1194,10 @@ static int aurora_setup_port(struct Aurora_board *bp, struct Aurora_port *port) return 0; if (!port->xmit_buf) { - /* We may sleep in get_free_page() */ + /* We may sleep in get_zeroed_page() */ unsigned long tmp; - if (!(tmp = get_free_page(GFP_KERNEL))) + if (!(tmp = get_zeroed_page(GFP_KERNEL))) return -ENOMEM; if (port->xmit_buf) { @@ -2303,7 +2303,7 @@ static int aurora_init_drivers(void) #ifdef AURORA_DEBUG printk("aurora_init_drivers: start\n"); #endif - tmp_buf = (unsigned char *) get_free_page(GFP_KERNEL); + tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL); if (tmp_buf == NULL) { printk(KERN_ERR "aurora: Couldn't get free page.\n"); return 1; diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c index 53b1bb96734d..c15651ae21ac 100644 --- a/drivers/scsi/53c7xx.c +++ b/drivers/scsi/53c7xx.c @@ -3034,7 +3034,7 @@ NCR53c7x0_soft_reset (struct Scsi_Host *host) { * * Side effects : If we haven't yet scheduled allocation of NCR53c7x0_cmd * structures for this device, do so. Attempt to complete all scheduled - * allocations using get_free_page(), putting NCR53c7x0_cmd structures on + * allocations using get_zeroed_page(), putting NCR53c7x0_cmd structures on * the free list. Teach programmers not to drink and hack. * * Inputs : cmd - SCSI command @@ -3101,7 +3101,7 @@ allocate_cmd (Scsi_Cmnd *cmd) { printk (KERN_ERR "53c7xx: allocate_cmd size > 4K\n"); return NULL; } - real = get_free_page(GFP_ATOMIC); + real = get_zeroed_page(GFP_ATOMIC); if (real == 0) return NULL; memset((void *)real, 0, 4096); diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 5fbb6c69a01f..9567b7eedd71 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c @@ -671,7 +671,7 @@ qla1280_proc_info(char *buffer, char **start, off_t offset, int length, free_page((unsigned long)qla1280_buffer); qla1280_buffer_size = 0; } - qla1280_buffer = (char *)get_free_page(GFP_KERNEL); + qla1280_buffer = (char *)get_zeroed_page(GFP_KERNEL); } if (qla1280_buffer == NULL) { size = sprintf(buffer, "qla1280 - kmalloc error at line %d\n", diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c index e1f4739d40b2..28e609099d9b 100644 --- a/drivers/scsi/sgiwd93.c +++ b/drivers/scsi/sgiwd93.c @@ -287,7 +287,7 @@ int __init sgiwd93_detect(Scsi_Host_Template *SGIblows) sgiwd93_host->base = (unsigned long) hregs; sgiwd93_host->irq = SGI_WD93_0_IRQ; - buf = (uchar *) get_free_page(GFP_KERNEL); + buf = (uchar *) get_zeroed_page(GFP_KERNEL); if (!buf) { printk(KERN_WARNING "sgiwd93: Could not allocate memory for host0 buffer.\n"); scsi_unregister(sgiwd93_host); @@ -321,7 +321,7 @@ int __init sgiwd93_detect(Scsi_Host_Template *SGIblows) sgiwd93_host1->base = (unsigned long) hregs1; sgiwd93_host1->irq = SGI_WD93_1_IRQ; - buf = (uchar *) get_free_page(GFP_KERNEL); + buf = (uchar *) get_zeroed_page(GFP_KERNEL); if (!buf) { printk(KERN_WARNING "sgiwd93: Could not allocate memory for host1 buffer.\n"); scsi_unregister(sgiwd93_host1); diff --git a/drivers/sgi/char/sgiserial.c b/drivers/sgi/char/sgiserial.c index 9b092ecb51ca..dc479e861f8a 100644 --- a/drivers/sgi/char/sgiserial.c +++ b/drivers/sgi/char/sgiserial.c @@ -673,7 +673,7 @@ static int startup(struct sgi_serial * info) return 0; if (!info->xmit_buf) { - info->xmit_buf = (unsigned char *) get_free_page(GFP_KERNEL); + info->xmit_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL); if (!info->xmit_buf) return -ENOMEM; } diff --git a/drivers/tc/zs.c b/drivers/tc/zs.c index b54b10365519..c02a0b5f365d 100644 --- a/drivers/tc/zs.c +++ b/drivers/tc/zs.c @@ -705,7 +705,7 @@ int zs_startup(struct dec_serial * info) return 0; if (!info->xmit_buf) { - info->xmit_buf = (unsigned char *) get_free_page(GFP_KERNEL); + info->xmit_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL); if (!info->xmit_buf) return -ENOMEM; } diff --git a/drivers/usb/class/audio.c b/drivers/usb/class/audio.c index 036259bcd6d7..cf12fc5b1020 100644 --- a/drivers/usb/class/audio.c +++ b/drivers/usb/class/audio.c @@ -487,7 +487,7 @@ static int dmabuf_init(struct dmabuf *db) db->dmasize = db->numfrag << db->fragshift; for(nr = 0; nr < NRSGBUF; nr++) { if (!db->sgbuf[nr]) { - p = (void *)get_free_page(GFP_KERNEL); + p = (void *)get_zeroed_page(GFP_KERNEL); if (!p) return -ENOMEM; db->sgbuf[nr] = p; diff --git a/fs/bfs/inode.c b/fs/bfs/inode.c index 6b4e8b063edc..efb9560a3354 100644 --- a/fs/bfs/inode.c +++ b/fs/bfs/inode.c @@ -267,7 +267,7 @@ void dump_imap(const char *prefix, struct super_block * s) { #if 0 int i; - char *tmpbuf = (char *)get_free_page(GFP_KERNEL); + char *tmpbuf = (char *)get_zeroed_page(GFP_KERNEL); if (!tmpbuf) return; diff --git a/fs/umsdos/namei.c b/fs/umsdos/namei.c index 9dbcc659408a..ae36dbf349a6 100644 --- a/fs/umsdos/namei.c +++ b/fs/umsdos/namei.c @@ -552,7 +552,7 @@ olddentry->d_parent->d_name.name, olddentry->d_name.name); goto out; ret = -ENOMEM; - buffer = get_free_page(GFP_KERNEL); + buffer = get_zeroed_page(GFP_KERNEL); if (!buffer) goto out; diff --git a/include/asm-m68k/sun3_pgalloc.h b/include/asm-m68k/sun3_pgalloc.h index 5229c070c7ff..c30e1b6a50cb 100644 --- a/include/asm-m68k/sun3_pgalloc.h +++ b/include/asm-m68k/sun3_pgalloc.h @@ -87,7 +87,7 @@ static inline pgd_t * pgd_alloc(struct mm_struct *mm) { pgd_t *new_pgd; - new_pgd = (pgd_t *)get_free_page(GFP_KERNEL); + new_pgd = (pgd_t *)get_zeroed_page(GFP_KERNEL); memcpy(new_pgd, swapper_pg_dir, PAGE_SIZE); memset(new_pgd, 0, (PAGE_OFFSET >> PGDIR_SHIFT)); return new_pgd; diff --git a/include/asm-s390/debug.h b/include/asm-s390/debug.h index 56a4043a1155..0279123ca320 100644 --- a/include/asm-s390/debug.h +++ b/include/asm-s390/debug.h @@ -261,7 +261,7 @@ int debug_unregister_view(debug_info_t* id, struct debug_view* view); void *b; #define kmalloc(x...) (PRINT_INFO(" kmalloc %p\n",b=kmalloc(x)),b) #define kfree(x) PRINT_INFO(" kfree %p\n",x);kfree(x) -#define get_free_page(x...) (PRINT_INFO(" gfp %p\n",b=get_free_page(x)),b) +#define get_zeroed_page(x...) (PRINT_INFO(" gfp %p\n",b=get_zeroed_page(x)),b) #define __get_free_pages(x...) (PRINT_INFO(" gfps %p\n",b=__get_free_pages(x)),b) #endif /* DEBUG_MALLOC */ diff --git a/include/asm-s390x/debug.h b/include/asm-s390x/debug.h index 56a4043a1155..0279123ca320 100644 --- a/include/asm-s390x/debug.h +++ b/include/asm-s390x/debug.h @@ -261,7 +261,7 @@ int debug_unregister_view(debug_info_t* id, struct debug_view* view); void *b; #define kmalloc(x...) (PRINT_INFO(" kmalloc %p\n",b=kmalloc(x)),b) #define kfree(x) PRINT_INFO(" kfree %p\n",x);kfree(x) -#define get_free_page(x...) (PRINT_INFO(" gfp %p\n",b=get_free_page(x)),b) +#define get_zeroed_page(x...) (PRINT_INFO(" gfp %p\n",b=get_zeroed_page(x)),b) #define __get_free_pages(x...) (PRINT_INFO(" gfps %p\n",b=__get_free_pages(x)),b) #endif /* DEBUG_MALLOC */ diff --git a/include/linux/gfp.h b/include/linux/gfp.h index b186f69b7217..966344dff4b4 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -71,11 +71,6 @@ extern unsigned long FASTCALL(get_zeroed_page(unsigned int gfp_mask)); __get_free_pages((gfp_mask) | GFP_DMA,(order)) /* - * The old interface name will be removed in 2.5: - */ -#define get_free_page get_zeroed_page - -/* * There is only one 'core' page-freeing function. */ extern void FASTCALL(__free_pages(struct page *page, unsigned int order)); diff --git a/kernel/suspend.c b/kernel/suspend.c index 6eec7ed03b07..2aa820a6092b 100644 --- a/kernel/suspend.c +++ b/kernel/suspend.c @@ -393,7 +393,7 @@ static int write_suspend_image(void) int i; swp_entry_t entry, prev = { 0 }; int nr_pgdir_pages = SUSPEND_PD_PAGES(nr_copy_pages); - union diskpage *cur, *buffer = (union diskpage *)get_free_page(GFP_ATOMIC); + union diskpage *cur, *buffer = (union diskpage *)get_zeroed_page(GFP_ATOMIC); unsigned long address; struct page *page; @@ -554,7 +554,7 @@ static suspend_pagedir_t *create_suspend_pagedir(int nr_copy_pages) SetPageNosave(page++); while(nr_copy_pages--) { - p->address = get_free_page(GFP_ATOMIC); + p->address = get_zeroed_page(GFP_ATOMIC); if(!p->address) { free_suspend_pagedir((unsigned long) pagedir); return NULL; @@ -923,7 +923,7 @@ static int check_pagedir(void) unsigned long addr; do { - addr = get_free_page(GFP_ATOMIC); + addr = get_zeroed_page(GFP_ATOMIC); if(!addr) return -ENOMEM; } while (does_collide(addr)); @@ -1139,7 +1139,7 @@ static int read_suspend_image(const char * specialfile, int noresume) int error; resume_device = name_to_kdev_t(specialfile); - scratch_page = get_free_page(GFP_ATOMIC); + scratch_page = get_zeroed_page(GFP_ATOMIC); cur = (void *) scratch_page; if (cur) { struct block_device *bdev; diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 4f892bb13250..44cf80b60caf 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -440,6 +440,12 @@ unsigned long get_zeroed_page(unsigned int gfp_mask) { struct page * page; + /* + * get_zeroed_page() returns a 32-bit address, which cannot represent + * a highmem page + */ + BUG_ON(gfp_mask & __GFP_HIGHMEM); + page = alloc_pages(gfp_mask, 0); if (page) { void *address = page_address(page); diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c index cd46ce110084..5483b125ba13 100644 --- a/net/atm/mpoa_proc.c +++ b/net/atm/mpoa_proc.c @@ -111,7 +111,7 @@ static ssize_t proc_mpc_read(struct file *file, char *buff, unsigned char ip_string[16]; if(count == 0) return 0; - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if(!page) return -ENOMEM; atm_mpoa_disp_qos((char *)page, &length); diff --git a/net/atm/proc.c b/net/atm/proc.c index 5839ebdf7aba..e0c1bbf57148 100644 --- a/net/atm/proc.c +++ b/net/atm/proc.c @@ -496,7 +496,7 @@ static ssize_t proc_dev_atm_read(struct file *file,char *buf,size_t count, int length; if (count == 0) return 0; - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return -ENOMEM; dev = PDE(file->f_dentry->d_inode)->data; if (!dev->ops->proc_read) @@ -523,7 +523,7 @@ static ssize_t proc_spec_atm_read(struct file *file,char *buf,size_t count, info = PDE(file->f_dentry->d_inode)->data; if (count == 0) return 0; - page = get_free_page(GFP_KERNEL); + page = get_zeroed_page(GFP_KERNEL); if (!page) return -ENOMEM; length = (*info)(*pos,(char *) page); if (length > count) length = -EINVAL; diff --git a/sound/oss/cs46xx.c b/sound/oss/cs46xx.c index aaa4e041cd64..c49ae0afa4e9 100644 --- a/sound/oss/cs46xx.c +++ b/sound/oss/cs46xx.c @@ -3239,7 +3239,7 @@ static int cs_open(struct inode *inode, struct file *file) memset(state, 0, sizeof(struct cs_state)); init_MUTEX(&state->sem); dmabuf = &state->dmabuf; - dmabuf->pbuf = (void *)get_free_page(GFP_KERNEL | GFP_DMA); + dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); if(dmabuf->pbuf==NULL) { kfree(state); @@ -3310,7 +3310,7 @@ static int cs_open(struct inode *inode, struct file *file) memset(state, 0, sizeof(struct cs_state)); init_MUTEX(&state->sem); dmabuf = &state->dmabuf; - dmabuf->pbuf = (void *)get_free_page(GFP_KERNEL | GFP_DMA); + dmabuf->pbuf = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); if(dmabuf->pbuf==NULL) { kfree(state); diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c index 60cd1e90354c..c35193eacecb 100644 --- a/sound/oss/vidc.c +++ b/sound/oss/vidc.c @@ -451,7 +451,7 @@ static void __init attach_vidc(struct address_info *hw_config) goto mixer_failed; for (i = 0; i < 2; i++) { - dma_buf[i] = get_free_page(GFP_KERNEL); + dma_buf[i] = get_zeroed_page(GFP_KERNEL); if (!dma_buf[i]) { printk(KERN_ERR "%s: can't allocate required buffers\n", name); |
