Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

small_page.c File Reference

#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/ptrace.h>
#include <linux/mman.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/smp.h>

Include dependency graph for small_page.c:

Go to the source code of this file.

Defines

#define SMALL_ALLOC_SIZE   (1 << SMALL_ALLOC_SHIFT)
#define NR_BLOCKS   (PAGE_SIZE / SMALL_ALLOC_SIZE)
#define BLOCK_MASK   ((1 << NR_BLOCKS) - 1)
#define USED(pg)   ((atomic_read(&(pg)->count) >> 8) & BLOCK_MASK)
#define SET_USED(pg, off)   (atomic_read(&(pg)->count) |= 256 << off)
#define CLEAR_USED(pg, off)   (atomic_read(&(pg)->count) &= ~(256 << off))
#define ALL_USED   BLOCK_MASK
#define IS_FREE(pg, off)   (!(atomic_read(&(pg)->count) & (256 << off)))
#define SM_PAGE_PTR(page, block)

Functions

static void clear_page_links (unsigned long page)
static void set_page_links_prev (unsigned long page, unsigned long prev)
static void set_page_links_next (unsigned long page, unsigned long next)

Variables

static unsigned long small_page_ptr
static unsigned char offsets [1<< NR_BLOCKS]
unsigned long NAME( get_page )(int priority)
void NAME( free_page )(unsigned long spage)


Define Documentation

#define ALL_USED   BLOCK_MASK
 

Definition at line 41 of file small_page.c.

#define BLOCK_MASK   ((1 << NR_BLOCKS) - 1)
 

Definition at line 36 of file small_page.c.

#define CLEAR_USED pg,
off   )     (atomic_read(&(pg)->count) &= ~(256 << off))
 

Definition at line 40 of file small_page.c.

#define IS_FREE pg,
off   )     (!(atomic_read(&(pg)->count) & (256 << off)))
 

Definition at line 42 of file small_page.c.

Referenced by fat_add_entries(), fat_dir_empty(), fat_fill_inode(), fat_readdirx(), fat_search_long(), vfat_create_shortname(), and vfat_valid_longname().

#define NR_BLOCKS   (PAGE_SIZE / SMALL_ALLOC_SIZE)
 

Definition at line 35 of file small_page.c.

Referenced by clear_page_links(), set_page_links_next(), and set_page_links_prev().

#define SET_USED pg,
off   )     (atomic_read(&(pg)->count) |= 256 << off)
 

Definition at line 39 of file small_page.c.

#define SM_PAGE_PTR page,
block   ) 
 

Value:

((struct free_small_page *)((page) + \
                                        ((block) << SMALL_ALLOC_SHIFT)))

Definition at line 43 of file small_page.c.

Referenced by clear_page_links(), set_page_links_next(), and set_page_links_prev().

#define SMALL_ALLOC_SIZE   (1 << SMALL_ALLOC_SHIFT)
 

Definition at line 34 of file small_page.c.

#define USED pg   )     ((atomic_read(&(pg)->count) >> 8) & BLOCK_MASK)
 

Definition at line 38 of file small_page.c.

Referenced by eata_abort(), eata_pio_abort(), eata_pio_queue(), eata_queue(), set_page_links_next(), and set_page_links_prev().


Function Documentation

static void clear_page_links unsigned long  page  )  [inline, static]
 

Definition at line 84 of file small_page.c.

References i, free_small_page::next, NR_BLOCKS, free_small_page::prev, and SM_PAGE_PTR.

static void set_page_links_next unsigned long  page,
unsigned long  next
[inline, static]
 

Definition at line 113 of file small_page.c.

References i, MAP_NR, mask, mem_map, free_small_page::next, NR_BLOCKS, SM_PAGE_PTR, and USED.

static void set_page_links_prev unsigned long  page,
unsigned long  prev
[inline, static]
 

Definition at line 95 of file small_page.c.

References i, MAP_NR, mask, mem_map, NR_BLOCKS, free_small_page::prev, SM_PAGE_PTR, and USED.


Variable Documentation

void NAME( free_page)(unsigned long spage)
 

Definition at line 174 of file small_page.c.

Referenced by __check_consistency(), __idetape_kfree_stage(), __idetape_kmalloc_stage(), __initfunc(), acornfb_init(), affs_put_inode(), agp_generic_destroy_page(), alloc_ext_cache(), alloc_uhci(), alloc_wait(), apmmu_putpage(), array_read(), attach_vidc(), aurora_init_drivers(), aurora_release_drivers(), aurora_setup_port(), aurora_shutdown_port(), clean_up_memory(), cleanup_module(), cleanup_skel(), comx_debug(), comx_write_proc(), comxhw_write_proc(), comxlapb_write_proc(), copy_mount_options(), copy_mount_stuff_to_kernel(), cs_release(), cy_open(), dasd_cleanup_emergency_req(), dasd_int_handler(), dev_ifsioc(), dmabuf_release(), do_execve(), do_execve32(), do_pipe(), do_proc_readlink(), do_swap_page(), do_wp_page(), esp_open(), exit_ringbuf(), fat_readdirx(), fat_search_long(), fifo_open(), fr_write_proc(), free_area(), free_area_pte(), free_fd_array(), free_fdset(), free_initmem(), free_mount_page(), free_pgd_slow(), free_pmd_slow(), free_pointer_table(), free_pte(), free_pte_slow(), free_sb(), free_unused_pages(), free_wait(), get_pmd_slow(), get_pte_kernel_slow(), get_pte_slow(), get_swaparea_info(), gmac_probe(), grow_buffers(), gs_init_port(), gs_shutdown_port(), hpfs_readdir(), i810_free_page(), ide_release_dma(), init_dev(), ioctl_rio(), isicom_init(), isicom_setup_port(), isicom_shutdown_port(), isofs_lookup(), isofs_readdir(), jpg_fbuffer_free(), killseg(), locomx_write_proc(), mace68k_probe(), mem_init(), mga_free_page(), mgsl_open(), mixcom_write_proc(), moxa_open(), mxser_open(), mxser_shutdown(), mxser_startup(), my_free_page(), n_tty_close(), NCR5380_print_status(), pipe_release(), proc_bulk(), proc_control(), proc_file_read(), proc_follow_link(), proc_readlink(), proc_readnet(), proc_readscsi(), proc_writescsi(), prom_free_prom_memory(), put_dirty_page(), putpage(), rc_init_drivers(), rc_release_drivers(), rc_setup_port(), rc_shutdown_port(), release_mem(), release_uhci(), release_write_hwcb(), romfs_readpage(), rp_close(), rp_open(), rs_open(), sab82532_open(), sgiwd93_release(), shm_nopage(), shm_swap(), shrink_buffers(), shutdown(), slm_read(), smb_readpage(), smb_writepage(), sndstat_file_read(), startup(), su_open(), sun4c_free_pgd_slow(), sun4c_free_pte_slow(), sun4c_pte_alloc(), sx_init_drivers(), sx_release_drivers(), sx_setup_port(), sx_shutdown_port(), sys32_mount(), sys_getcwd(), sys_swapon(), timod_getmsg(), UMSDOS_link(), unload_vidc(), usb_driver_read(), vfat_fill_long_slots(), and xpram_size().

unsigned long NAME( get_page)(int priority)
 

Definition at line 131 of file small_page.c.

Referenced by do_ptrace(), get_int(), get_long(), put_int(), and put_long().

unsigned char offsets[1<< NR_BLOCKS] [static]
 

Initial value:

 {
        0,      
        1,      
        0,      
        2,      














}

Definition at line 63 of file small_page.c.

Referenced by ext2_bmap(), ext2_getblk(), and sysv_read_super().

unsigned long small_page_ptr [static]
 

Definition at line 61 of file small_page.c.