Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/reiser4/as_ops.c |   32 ++++++--------------------------
 1 files changed, 6 insertions(+), 26 deletions(-)

diff -puN fs/reiser4/as_ops.c~reiser4-add-missing-context fs/reiser4/as_ops.c
--- 25/fs/reiser4/as_ops.c~reiser4-add-missing-context	2004-12-27 00:46:04.970032816 -0800
+++ 25-akpm/fs/reiser4/as_ops.c	2004-12-27 00:46:04.974032208 -0800
@@ -232,11 +232,15 @@ static int
 reiser4_readpages(struct file *file, struct address_space *mapping,
 		  struct list_head *pages, unsigned nr_pages)
 {
+        reiser4_context ctx;
 	reiser4_file_fsdata *fsdata;
 
+        init_context(&ctx, mapping->host->i_sb);
 	fsdata = reiser4_get_file_fsdata(file);
-	if (IS_ERR(fsdata))
+	if (IS_ERR(fsdata)) {
+		reiser4_exit_context(&ctx);
 		return PTR_ERR(fsdata);
+	}
 
 	if (fsdata->ra2.readpages)
 		fsdata->ra2.readpages(mapping, pages, fsdata->ra2.data);
@@ -244,33 +248,9 @@ reiser4_readpages(struct file *file, str
 		assert("vs-1738", lock_stack_isclean(get_current_lock_stack()));
 		read_cache_pages(mapping, pages, filler, file);
 	}
+	reiser4_exit_context(&ctx);
 	return 0;
 }
-#if 0
-	file_plugin *fplug;
-
-	if (is_in_reiser4_context()) {
-		/* we are called from reiser4 context, typically from method
-		   which implements read into page cache. From read_extent,
-		   for example */
-		fplug = inode_file_plugin(mapping->host);
-		if (fplug->readpages)
-			fplug->readpages(file, mapping, pages);
-	} else {
-		/* we are called from page fault. Currently, we do not
-		 * readahead in this case. */;
-	}
-
-	/* __do_page_cache_readahead expects filesystem's readpages method to
-	 * process every page on this list */
-	while (!list_empty(pages)) {
-		struct page *page = list_entry(pages->prev, struct page, lru);
-		list_del(&page->lru);
-		page_cache_release(page);
-	}
-	return 0;
-}
-#endif
 
 /* prepares @page to be written. This means, that if we want to modify only some
    part of page, page should be read first and than modified. Actually this function
_