00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <linux/config.h>
00015 #include <linux/slab.h>
00016 #include <linux/smp_lock.h>
00017 #include <linux/kernel_stat.h>
00018 #include <linux/swap.h>
00019 #include <linux/swapctl.h>
00020 #include <linux/blkdev.h>
00021 #include <linux/vmalloc.h>
00022 #include <linux/pagemap.h>
00023 #include <linux/shm.h>
00024 #include <linux/compiler.h>
00025
00026 #include <asm/pgtable.h>
00027
00028 #include <dyndef.h>
00029 #include <pfldef.h>
00030 #include <system_data_cells.h>
00031
00032 spinlock_t swaplock = SPIN_LOCK_UNLOCKED;
00033
00034 int total_swap_pages;
00035 static int swap_overflow;
00036
00037 static const char Bad_file[] = "Bad swap file entry ";
00038 static const char Unused_file[] = "Unused swap file entry ";
00039 static const char Bad_offset[] = "Bad swap offset entry ";
00040 static const char Unused_offset[] = "Unused swap offset entry ";
00041
00042 struct swap_list_t swap_list = {-1, -1};
00043
00044 struct _pfl swap_info_pfl[MAX_SWAPFILES];
00045
00046 #define SWAPFILE_CLUSTER 256
00047 #undef SWAPFILE_CLUSTER
00048 #define SWAPFILE_CLUSTER 1
00049
00050
00051
00052
00053
00054 static int exclusive_swap_page(struct page *page)
00055 {
00056 return 0;
00057 #if 0
00058 int retval = 0;
00059 struct _pfl * p;
00060 swp_entry_t entry;
00061
00062 entry.val = page->index;
00063 p = swap_info_get(entry);
00064 if (p) {
00065
00066 if (p->pfl_l_bitmap[SWP_OFFSET(entry)] == 1) {
00067
00068 if (page_count(page) - !!page->buffers == 2)
00069 retval = 1;
00070 }
00071 swap_info_put(p);
00072 }
00073 return retval;
00074 #endif
00075 }
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085 int can_share_swap_page(struct page *page)
00086 {
00087 int retval = 0;
00088
00089 #if 0
00090 if (!PageLocked(page))
00091 BUG();
00092 #endif
00093 switch (page_count(page)) {
00094 case 3:
00095 #if 0
00096 if (!page->buffers)
00097 break;
00098 #endif
00099
00100 case 2:
00101 #if 0
00102 if (!PageSwapCache(page))
00103 break;
00104 #endif
00105 retval = exclusive_swap_page(page);
00106 break;
00107 case 1:
00108 if (PageReserved(page))
00109 break;
00110 retval = 1;
00111 }
00112 return retval;
00113 }
00114
00115 asmlinkage long sys_swapoff(const char * specialfile)
00116 {
00117 }
00118
00119 int get_swaparea_info(char *buf)
00120 {
00121 }
00122
00123
00124
00125
00126
00127
00128 asmlinkage long sys_swapon(const char * specialfile, int swap_flags)
00129 {
00130
00131
00132 }
00133
00134 void si_swapinfo(struct sysinfo *val)
00135 {
00136 }
00137
00138 struct address_space swapper_space;
00139
00140 void swap_setup(void){
00141 printk("swap setup does nothing\n");
00142 }
00143
00144 int page_cluster;
00145
00146 pager_daemon_t pager_daemon;
00147
00148