patch-2.4.18 linux/fs/ext3/inode.c

Next file: linux/fs/ext3/super.c
Previous file: linux/fs/ext3/ialloc.c
Back to the patch index
Back to the overall index

diff -Naur -X /home/marcelo/lib/dontdiff linux.orig/fs/ext3/inode.c linux/fs/ext3/inode.c
@@ -388,8 +388,7 @@
 static Indirect *ext3_get_branch(struct inode *inode, int depth, int *offsets,
 				 Indirect chain[4], int *err)
 {
-	kdev_t dev = inode->i_dev;
-	int blocksize = inode->i_sb->s_blocksize;
+	struct super_block *sb = inode->i_sb;
 	Indirect *p = chain;
 	struct buffer_head *bh;
 
@@ -399,7 +398,7 @@
 	if (!p->key)
 		goto no_block;
 	while (--depth) {
-		bh = bread(dev, le32_to_cpu(p->key), blocksize);
+		bh = sb_bread(sb, le32_to_cpu(p->key));
 		if (!bh)
 			goto failure;
 		/* Reader: pointers */
@@ -557,7 +556,7 @@
 			 * and set the pointer to new one, then send
 			 * parent to disk.  
 			 */
-			bh = getblk(inode->i_dev, parent, blocksize);
+			bh = sb_getblk(inode->i_sb, parent);
 			branch[n].bh = bh;
 			lock_buffer(bh);
 			BUFFER_TRACE(bh, "call get_create_access");
@@ -858,8 +857,7 @@
 	*errp = ext3_get_block_handle(handle, inode, block, &dummy, create);
 	if (!*errp && buffer_mapped(&dummy)) {
 		struct buffer_head *bh;
-		bh = getblk(dummy.b_dev, dummy.b_blocknr,
-					inode->i_sb->s_blocksize);
+		bh = sb_getblk(inode->i_sb, dummy.b_blocknr);
 		if (buffer_new(&dummy)) {
 			J_ASSERT(create != 0);
 			J_ASSERT(handle != 0);
@@ -1576,9 +1574,6 @@
 		u32 *first, u32 *last)
 {
 	u32 *p;
-	kdev_t dev = inode->i_sb->s_dev;
-	unsigned long blocksize = inode->i_sb->s_blocksize;
-
 	if (try_to_extend_transaction(handle, inode)) {
 		if (bh) {
 			BUFFER_TRACE(bh, "call ext3_journal_dirty_metadata");
@@ -1604,7 +1599,7 @@
 			struct buffer_head *bh;
 
 			*p = 0;
-			bh = get_hash_table(dev, nr, blocksize);
+			bh = sb_get_hash_table(inode->i_sb, nr);
 			ext3_forget(handle, 0, inode, bh, nr);
 		}
 	}
@@ -1717,7 +1712,7 @@
 				continue;		/* A hole */
 
 			/* Go read the buffer for the next level down */
-			bh = bread(inode->i_dev, nr, inode->i_sb->s_blocksize);
+			bh = sb_bread(inode->i_sb, nr);
 
 			/*
 			 * A read failure? Report error and clear slot
@@ -2030,7 +2025,7 @@
 		EXT3_INODE_SIZE(inode->i_sb);
 	block = le32_to_cpu(gdp[desc].bg_inode_table) +
 		(offset >> EXT3_BLOCK_SIZE_BITS(inode->i_sb));
-	if (!(bh = bread (inode->i_dev, block, inode->i_sb->s_blocksize))) {
+	if (!(bh = sb_bread(inode->i_sb, block))) {
 		ext3_error (inode->i_sb, "ext3_get_inode_loc",
 			    "unable to read inode block - "
 			    "inode=%lu, block=%lu", inode->i_ino, block);

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