diff -u -3 -p -r1.1.1.4 init.c
--- linux-2.4.x-uc0/arch/m68knommu/mm/init.c	28 Jan 2003 18:00:54 -0000	1.1.1.4
+++ linux-2.4.x-uc0-noswap/arch/m68knommu/mm/init.c	26 May 2003 14:59:29 -0000
@@ -66,24 +66,19 @@ unsigned long empty_zero_page;
 
 extern unsigned long rom_length;
 
+#ifdef CONFIG_MAGIC_SYSRQ
 void show_mem(void)
 {
     unsigned long i;
     int free = 0, total = 0, reserved = 0, shared = 0;
-    int cached = 0;
 
     printk("\nMem-info:\n");
     show_free_areas();
-#if 0
-    printk("Free swap:       %6dkB\n",nr_swap_pages<<(PAGE_SHIFT-10));
-#endif
     i = max_mapnr;
     while (i-- > 0) {
 	total++;
 	if (PageReserved(mem_map+i))
 	    reserved++;
-	else if (PageSwapCache(mem_map+i))
-	    cached++;
 	else if (!page_count(mem_map+i))
 	    free++;
 	else
@@ -93,12 +88,9 @@ void show_mem(void)
     printk("%d free pages\n",free);
     printk("%d reserved pages\n",reserved);
     printk("%d pages shared\n",shared);
-    printk("%d pages swap cached\n",cached);
-#if 0
-    printk("%ld pages in page table cache\n",pgtable_cache_size);
-#endif
     show_buffers();
 }
+#endif /* CONFIG_MAGIC_SYSRQ */
 
 extern unsigned long memory_start;
 extern unsigned long memory_end;
diff -u -3 -p -r1.1.1.3 locks.c
--- linux-2.4.x-uc0/fs/locks.c	28 Feb 2003 22:44:49 -0000	1.1.1.3
+++ linux-2.4.x-uc0-noswap/fs/locks.c	26 May 2003 14:59:44 -0000
@@ -1668,6 +1668,7 @@ int fcntl_setlk64(unsigned int fd, unsig
 	error = -EINVAL;
 	inode = filp->f_dentry->d_inode;
 
+#ifndef NO_MM
 	/* Don't allow mandatory locks on files that may be memory mapped
 	 * and shared.
 	 */
@@ -1680,6 +1681,7 @@ int fcntl_setlk64(unsigned int fd, unsig
 			goto out_putf;
 		}
 	}
+#endif /* NO_MM */
 
 	error = flock64_to_posix_lock(filp, file_lock, &flock);
 	if (error)
diff -u -3 -p -r1.1.1.4 proc_misc.c
--- linux-2.4.x-uc0/fs/proc/proc_misc.c	28 Feb 2003 22:44:53 -0000	1.1.1.4
+++ linux-2.4.x-uc0-noswap/fs/proc/proc_misc.c	26 May 2003 14:59:45 -0000
@@ -182,8 +182,10 @@ static int meminfo_read_proc(char *page,
 		"MemFree:      %8lu kB\n"
 		"MemShared:    %8lu kB\n"
 		"Buffers:      %8lu kB\n"
+#ifndef NO_MM
 		"Cached:       %8lu kB\n"
 		"SwapCached:   %8lu kB\n"
+#endif /* NO_MM */
 		"Active:       %8u kB\n"
 		"Inactive:     %8u kB\n"
 		"HighTotal:    %8lu kB\n"
@@ -196,8 +198,10 @@ static int meminfo_read_proc(char *page,
 		K(i.freeram),
 		K(i.sharedram),
 		K(i.bufferram),
+#ifndef NO_MM
 		K(pg_size - swapper_space.nrpages),
 		K(swapper_space.nrpages),
+#endif /* NO_MM */
 		K(nr_active_pages),
 		K(nr_inactive_pages),
 		K(i.totalhigh),
diff -u -3 -p -r1.1.1.4 fs.h
--- linux-2.4.x-uc0/include/linux/fs.h	28 Feb 2003 22:45:12 -0000	1.1.1.4
+++ linux-2.4.x-uc0-noswap/include/linux/fs.h	26 May 2003 14:59:51 -0000
@@ -405,9 +405,11 @@ struct address_space {
 	unsigned long		nrpages;	/* number of total pages */
 	struct address_space_operations *a_ops;	/* methods */
 	struct inode		*host;		/* owner: inode, block_device */
+#ifndef NO_MM
 	struct vm_area_struct	*i_mmap;	/* list of private mappings */
 	struct vm_area_struct	*i_mmap_shared; /* list of shared mappings */
 	spinlock_t		i_shared_lock;  /* and spinlock protecting it */
+#endif /* NO_MM */
 	int			gfp_mask;	/* how to allocate the pages */
 };
 
diff -u -3 -p -r1.1.1.4 mm.h
--- linux-2.4.x-uc0/include/linux/mm.h	28 Jan 2003 18:01:42 -0000	1.1.1.4
+++ linux-2.4.x-uc0-noswap/include/linux/mm.h	26 May 2003 14:59:51 -0000
@@ -547,8 +547,10 @@ extern void swapin_readahead(swp_entry_t
 #define swap_count(page) 0
 #endif /* CONFIG_UCLINUX */
 
+#ifndef NO_MM
 extern struct address_space swapper_space;
 #define PageSwapCache(page) ((page)->mapping == &swapper_space)
+#endif /* NO_MM */
 
 static inline int is_page_cache_freeable(struct page * page)
 {
diff -u -3 -p -r1.1.1.3 Makefile
--- linux-2.4.x-uc0/mmnommu/Makefile	28 Jan 2003 18:01:45 -0000	1.1.1.3
+++ linux-2.4.x-uc0-noswap/mmnommu/Makefile	26 May 2003 14:59:53 -0000
@@ -11,7 +11,7 @@ O_TARGET := mmnommu.o
 obj-y	 := bootmem.o filemap.o mlock.o mmap.o \
 			mprotect.o mremap.o numa.o \
 			slab.o swapfile.o vmalloc.o vmscan.o memory.o \
-			swap.o swap_state.o oom_kill.o
+			swap.o oom_kill.o
 
 ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC
 obj-y    += page_alloc2.o
diff -u -3 -p -r1.1.1.4 filemap.c
--- linux-2.4.x-uc0/mmnommu/filemap.c	28 Feb 2003 22:45:17 -0000	1.1.1.4
+++ linux-2.4.x-uc0-noswap/mmnommu/filemap.c	26 May 2003 14:59:53 -0000
@@ -124,7 +124,7 @@ static inline void remove_page_from_hash
  */
 void __remove_inode_page(struct page *page)
 {
-	if (PageDirty(page) && !PageSwapCache(page))
+	if (PageDirty(page))
 		BUG();
 	remove_page_from_inode_queue(page);
 	remove_page_from_hash_queue(page);
@@ -1431,12 +1431,14 @@ found_page:
 			goto page_not_up_to_date;
 		generic_file_readahead(reada_ok, filp, inode, page);
 page_ok:
+#ifndef NO_MM
 		/* If users can be writing to this page using arbitrary
 		 * virtual addresses, take care about potential aliasing
 		 * before reading the page on the kernel side.
 		 */
 		if (mapping->i_mmap_shared != NULL)
 			flush_dcache_page(page);
+#endif /* NO_MM */
 
 		/*
 		 * Mark the page accessed if we read the
diff -u -3 -p -r1.2 page_alloc2.c
--- linux-2.4.x-uc0/mmnommu/page_alloc2.c	26 May 2003 08:10:35 -0000	1.2
+++ linux-2.4.x-uc0-noswap/mmnommu/page_alloc2.c	26 May 2003 14:59:53 -0000
@@ -868,8 +868,7 @@ mem_map_read_proc(char *page, char **sta
 # endif
 #endif
 					PRINTK("X");
-			} else if (PageSwapCache(p))
-				PRINTK("S");
+			}
 			else if (PageLocked(p))
 				PRINTK("L");
 			else if (PageActive(p))
diff -u -3 -p -r1.1.1.4 vmscan.c
--- linux-2.4.x-uc0/mmnommu/vmscan.c	28 Feb 2003 22:45:17 -0000	1.1.1.4
+++ linux-2.4.x-uc0-noswap/mmnommu/vmscan.c	26 May 2003 14:59:53 -0000
@@ -511,21 +511,22 @@ page_mapped:
 		}
 
 		/* point of no return */
+#ifdef NO_MM
+		__remove_inode_page(page);
+		spin_unlock(&pagecache_lock);
+#else /* !NO_MM */
 		if (likely(!PageSwapCache(page))) {
 			__remove_inode_page(page);
 			spin_unlock(&pagecache_lock);
 		} else {
 			swp_entry_t swap;
 			swap.val = page->index;
-#ifndef NO_MM
 			__delete_from_swap_cache(page);
 			/* must drop lru lock if getting swap_list lock */
-#endif
 			spin_unlock(&pagecache_lock);
-#ifndef NO_MM
 			swap_free(swap);
-#endif
 		}
+#endif /* !NO_MM */
 
 		__lru_cache_del(page);
 		UnlockPage(page);
