patch-2.3.43 linux/fs/inode.c

Next file: linux/fs/ioctl.c
Previous file: linux/fs/hpfs/namei.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.42/linux/fs/inode.c linux/fs/inode.c
@@ -474,6 +474,8 @@
 	memset(&inode->i_dquot, 0, sizeof(inode->i_dquot));
 	inode->i_pipe = NULL;
 	inode->i_bdev = NULL;
+	inode->i_mapping = &inode->i_data;
+	inode->i_mapping->host = (void*)inode;
 }
 
 /*
@@ -719,15 +721,10 @@
 
 int bmap(struct inode * inode, int block)
 {
-	struct buffer_head tmp;
-
-	if (inode->i_op && inode->i_op->get_block) {
-		tmp.b_state = 0;
-		tmp.b_blocknr = 0;
-		inode->i_op->get_block(inode, block, &tmp, 0);
-		return tmp.b_blocknr;
-	}
-	return 0;
+	int res = 0;
+	if (inode->i_mapping->a_ops->bmap)
+		res = inode->i_mapping->a_ops->bmap(inode->i_mapping, block);
+	return res;
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)