JFS: remove aops from directory inodes

Linux Kernel Mailing List <[email protected]> Thu, 24 Mar 2005 20:06:27 +0000
Newsgroups gmane.linux.kernel.commits.2-4
Message-ID <[email protected]>
ChangeSet 1.1448.128.1, 2005/03/24 14:06:27-06:00, [email protected]

	JFS: remove aops from directory inodes
	
	jfs no longer uses a directory inode's address space.  Clean up the
	code by removing aops for directories altogether
	
	Signed-off-by: Dave Kleikamp <[email protected]>



 inode.c |   23 ++++++-----------------
 namei.c |    2 --
 2 files changed, 6 insertions(+), 19 deletions(-)


diff -Nru a/fs/jfs/inode.c b/fs/jfs/inode.c
--- a/fs/jfs/inode.c	2005-03-25 17:04:04 -08:00
+++ b/fs/jfs/inode.c	2005-03-25 17:04:04 -08:00
@@ -90,8 +90,6 @@
 	} else if (S_ISDIR(inode->i_mode)) {
 		inode->i_op = &jfs_dir_inode_operations;
 		inode->i_fop = &jfs_dir_operations;
-		inode->i_mapping->a_ops = &jfs_aops;
-		inode->i_mapping->gfp_mask = GFP_NOFS;
 	} else if (S_ISLNK(inode->i_mode)) {
 		if (inode->i_size >= IDATASIZE) {
 			inode->i_op = &page_symlink_inode_operations;
@@ -215,7 +213,6 @@
 			 struct buffer_head *bh_result, int create)
 {
 	s64 lblock64 = lblock;
-	int no_size_check = 0;
 	int rc = 0;
 	int take_locks;
 	xad_t xad;
@@ -224,11 +221,11 @@
 	s32 xlen;
 
 	/*
-	 * If this is a special inode (imap, dmap) or directory,
+	 * If this is a special inode (imap, dmap)
 	 * the lock should already be taken
 	 */
-	take_locks = ((JFS_IP(ip)->fileset != AGGREGATE_I) &&
-		      !S_ISDIR(ip->i_mode));
+	take_locks = (JFS_IP(ip)->fileset != AGGREGATE_I);
+
 	/*
 	 * Take appropriate lock on inode
 	 */
@@ -239,17 +236,9 @@
 			IREAD_LOCK(ip);
 	}
 
-	/*
-	 * A directory's "data" is the inode index table, but i_size is the
-	 * size of the d-tree, so don't check the offset against i_size
-	 */
-	if (S_ISDIR(ip->i_mode))
-		no_size_check = 1;
-
-	if ((no_size_check ||
-	     ((lblock64 << ip->i_sb->s_blocksize_bits) < ip->i_size)) &&
-	    (xtLookup(ip, lblock64, 1, &xflag, &xaddr, &xlen, no_size_check)
-	     == 0) && xlen) {
+	if (((lblock64 << ip->i_sb->s_blocksize_bits) < ip->i_size) &&
+	    (xtLookup(ip, lblock64, 1, &xflag, &xaddr, &xlen, 0) == 0) &&
+	    xlen) {
 		if (xflag & XAD_NOTRECORDED) {
 			if (!create)
 				/*
diff -Nru a/fs/jfs/namei.c b/fs/jfs/namei.c
--- a/fs/jfs/namei.c	2005-03-25 17:04:04 -08:00
+++ b/fs/jfs/namei.c	2005-03-25 17:04:04 -08:00
@@ -249,8 +249,6 @@
 	ip->i_nlink = 2;	/* for '.' */
 	ip->i_op = &jfs_dir_inode_operations;
 	ip->i_fop = &jfs_dir_operations;
-	ip->i_mapping->a_ops = &jfs_aops;
-	ip->i_mapping->gfp_mask = GFP_NOFS;
 
 	insert_inode_hash(ip);
 	mark_inode_dirty(ip);