[PATCH 17/17] vxfs: convert vxfs_get_page to read_kmap_page

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>, Alexander Viro <viro@...>, Christoph Hellwig <hch@...>, Roman Zippel <zippel@...>, Mikulas Patocka <mikulas@...>, David Woodhouse <dwmw2@...>, Dave Kleikamp <shaggy@...>, Anton Altaparmakov <aia21@...>, Evgeniy Dushistov <dushistov@...>
Cc: <linux-kernel@...>, <linux-fsdevel@...>, <reiserfs-dev@...>
Date: Wednesday, April 11, 2007 - 10:49 pm

Replace vxfs_get_page() with the new read_kmap_page().

Signed-off-by: Nate Diller <nate.diller@gmail.com>

---

diff -urpN -X dontdiff linux-2.6.21-rc5-mm4/fs/freevxfs/vxfs_extern.h linux-2.6.21-rc5-mm4-test/fs/freevxfs/vxfs_extern.h
--- linux-2.6.21-rc5-mm4/fs/freevxfs/vxfs_extern.h	2007-04-05 17:13:29.000000000 -0700
+++ linux-2.6.21-rc5-mm4-test/fs/freevxfs/vxfs_extern.h	2007-04-06 01:59:19.000000000 -0700
@@ -69,7 +69,6 @@ extern const struct file_operations	vxfs
 extern int			vxfs_read_olt(struct super_block *, u_long);
 
 /* vxfs_subr.c */
-extern struct page *		vxfs_get_page(struct address_space *, u_long);
 extern void			vxfs_put_page(struct page *);
 extern struct buffer_head *	vxfs_bread(struct inode *, int);
 
diff -urpN -X dontdiff linux-2.6.21-rc5-mm4/fs/freevxfs/vxfs_inode.c linux-2.6.21-rc5-mm4-test/fs/freevxfs/vxfs_inode.c
--- linux-2.6.21-rc5-mm4/fs/freevxfs/vxfs_inode.c	2007-04-05 17:14:25.000000000 -0700
+++ linux-2.6.21-rc5-mm4-test/fs/freevxfs/vxfs_inode.c	2007-04-06 01:59:19.000000000 -0700
@@ -138,7 +138,7 @@ __vxfs_iget(ino_t ino, struct inode *ili
 	u_long				offset;
 
 	offset = (ino % (PAGE_SIZE / VXFS_ISIZE)) * VXFS_ISIZE;
-	pp = vxfs_get_page(ilistp->i_mapping, ino * VXFS_ISIZE / PAGE_SIZE);
+	pp = read_kmap_page(ilistp->i_mapping, ino * VXFS_ISIZE / PAGE_SIZE);
 
 	if (!IS_ERR(pp)) {
 		struct vxfs_inode_info	*vip;
diff -urpN -X dontdiff linux-2.6.21-rc5-mm4/fs/freevxfs/vxfs_lookup.c linux-2.6.21-rc5-mm4-test/fs/freevxfs/vxfs_lookup.c
--- linux-2.6.21-rc5-mm4/fs/freevxfs/vxfs_lookup.c	2007-04-05 17:13:29.000000000 -0700
+++ linux-2.6.21-rc5-mm4-test/fs/freevxfs/vxfs_lookup.c	2007-04-06 01:59:19.000000000 -0700
@@ -125,7 +125,7 @@ vxfs_find_entry(struct inode *ip, struct
 		caddr_t			kaddr;
 		struct page		*pp;
 
-		pp = vxfs_get_page(ip->i_mapping, page);
+		pp = read_kmap_page(ip->i_mapping, page);
 		if (IS_ERR(pp))
 			continue;
 		kaddr = (caddr_t)page_address(pp);
@@ -280,7 +280,7 @@ vxfs_readdir(struct file *fp, void *retp
 		caddr_t			kaddr;
 		struct page		*pp;
 
-		pp = vxfs_get_page(ip->i_mapping, page);
+		pp = read_kmap_page(ip->i_mapping, page);
 		if (IS_ERR(pp))
 			continue;
 		kaddr = (caddr_t)page_address(pp);
diff -urpN -X dontdiff linux-2.6.21-rc5-mm4/fs/freevxfs/vxfs_subr.c linux-2.6.21-rc5-mm4-test/fs/freevxfs/vxfs_subr.c
--- linux-2.6.21-rc5-mm4/fs/freevxfs/vxfs_subr.c	2007-04-05 17:14:25.000000000 -0700
+++ linux-2.6.21-rc5-mm4-test/fs/freevxfs/vxfs_subr.c	2007-04-06 01:59:19.000000000 -0700
@@ -56,39 +56,6 @@ vxfs_put_page(struct page *pp)
 }
 
 /**
- * vxfs_get_page - read a page into memory.
- * @ip:		inode to read from
- * @n:		page number
- *
- * Description:
- *   vxfs_get_page reads the @n th page of @ip into the pagecache.
- *
- * Returns:
- *   The wanted page on success, else a NULL pointer.
- */
-struct page *
-vxfs_get_page(struct address_space *mapping, u_long n)
-{
-	struct page *			pp;
-
-	pp = read_mapping_page(mapping, n, NULL);
-
-	if (!IS_ERR(pp)) {
-		kmap(pp);
-		/** if (!PageChecked(pp)) **/
-			/** vxfs_check_page(pp); **/
-		if (PageError(pp))
-			goto fail;
-	}
-	
-	return (pp);
-		 
-fail:
-	vxfs_put_page(pp);
-	return ERR_PTR(-EIO);
-}
-
-/**
  * vxfs_bread - read buffer for a give inode,block tuple
  * @ip:		inode
  * @block:	logical block
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 17/17] vxfs: convert vxfs_get_page to read_kmap_page, Nate Diller, (Wed Apr 11, 10:49 pm)
[PATCH 10/17] mtd: convert page_read to read_kmap_page, Nate Diller, (Wed Apr 11, 10:49 pm)
[PATCH 8/17] jfs: use locking read_mapping_page, Nate Diller, (Wed Apr 11, 10:49 pm)
[PATCH 1/17] cramfs: use read_mapping_page, Nate Diller, (Wed Apr 11, 10:49 pm)
Re: [PATCH 1/17] cramfs: use read_mapping_page, Christoph Hellwig, (Thu Apr 12, 5:54 am)
Re: [PATCH 1/17] cramfs: use read_mapping_page, Roman Zippel, (Thu Apr 12, 7:26 am)
Re: [PATCH 1/17] cramfs: use read_mapping_page, Nate Diller, (Thu Apr 12, 2:36 pm)