diff -ur stock3/linux-2.4.4/fs/cramfs/Makefile linux-2.4.4-ciso/fs/cramfs/Makefile --- stock3/linux-2.4.4/fs/cramfs/Makefile Fri Dec 29 14:07:23 2000 +++ linux-2.4.4-ciso/fs/cramfs/Makefile Tue May 1 23:22:52 2001 @@ -11,4 +11,4 @@ include $(TOPDIR)/Rules.make inflate/zlib.o: - make -C inflate + $(MAKE) -C inflate diff -ur stock3/linux-2.4.4/include/linux/pagemap.h linux-2.4.4-ciso/include/linux/pagemap.h --- stock3/linux-2.4.4/include/linux/pagemap.h Fri Apr 27 15:48:38 2001 +++ linux-2.4.4-ciso/include/linux/pagemap.h Tue May 1 23:22:06 2001 @@ -98,6 +98,7 @@ } extern struct page * grab_cache_page (struct address_space *, unsigned long); +extern struct page * grab_cache_page_nowait (struct address_space *, unsigned long); typedef int filler_t(void *, struct page*); diff -ur stock3/linux-2.4.4/kernel/ksyms.c linux-2.4.4-ciso/kernel/ksyms.c --- stock3/linux-2.4.4/kernel/ksyms.c Fri Apr 27 14:23:25 2001 +++ linux-2.4.4-ciso/kernel/ksyms.c Mon Apr 30 19:17:30 2001 @@ -243,6 +243,7 @@ EXPORT_SYMBOL(ROOT_DEV); EXPORT_SYMBOL(__find_lock_page); EXPORT_SYMBOL(grab_cache_page); +EXPORT_SYMBOL(grab_cache_page_nowait); EXPORT_SYMBOL(read_cache_page); EXPORT_SYMBOL(vfs_readlink); EXPORT_SYMBOL(vfs_follow_link); diff -ur stock3/linux-2.4.4/mm/filemap.c linux-2.4.4-ciso/mm/filemap.c --- stock3/linux-2.4.4/mm/filemap.c Wed Apr 25 16:13:50 2001 +++ linux-2.4.4-ciso/mm/filemap.c Wed May 2 16:13:49 2001 @@ -2443,6 +2443,44 @@ return page; } +/* + * Same as grab_cache_page, but do not wait if the page is unavailable. + * This is intended for speculative data generators, where the data can + * be regenerated if the page couldn't be grabbed. This routine should + * be safe to call while holding the lock for another page. + */ +struct page *grab_cache_page_nowait(struct address_space *mapping, unsigned long index) +{ + struct page *cached_page = NULL; + struct page *page, **hash; + + hash = page_hash(mapping, index); + page = __find_get_page(mapping, index, hash); + + if ( page ) { + if ( !TryLockPage(page) ) { + /* Page found and locked */ + return page; + } else { + /* Page locked by someone else */ + page_cache_release(page); + return NULL; + } + } + + page = page_cache_alloc(mapping); + if ( !page ) + return NULL; /* Failed to allocate a page */ + + if (add_to_page_cache_unique(page, mapping, index, hash)) { + /* Someone else grabbed the page already. */ + page_cache_free(page); + return NULL; + } + + return page; +} + inline void remove_suid(struct inode *inode) { unsigned int mode;