patch-2.3.99-pre3 linux/fs/udf/lowlevel.c

Next file: linux/fs/udf/misc.c
Previous file: linux/fs/udf/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre2/linux/fs/udf/lowlevel.c linux/fs/udf/lowlevel.c
@@ -70,8 +70,6 @@
 unsigned int
 udf_get_last_block(struct super_block *sb)
 {
-	extern int *blksize_size[];
-	kdev_t dev = sb->s_dev;
 	struct block_device *bdev = sb->s_bdev;
 	int ret;
 	unsigned long lblock = 0;
@@ -80,28 +78,10 @@
 
 	if (ret) /* Hard Disk */
 	{
-		unsigned int hbsize = get_hardblocksize(dev);
-		unsigned int blocksize = sb->s_blocksize;
-		unsigned int mult = 0;
-		unsigned int div = 0;
-
-		if (!hbsize)
-			hbsize = blksize_size[MAJOR(dev)][MINOR(dev)];
-
-		if (hbsize > blocksize)
-			mult = hbsize / blocksize;
-		else if (blocksize > hbsize)
-			div = blocksize / hbsize;
-
 		ret = ioctl_by_bdev(bdev, BLKGETSIZE, (unsigned long) &lblock);
 
 		if (!ret && lblock != 0x7FFFFFFF)
-		{
-			if (mult)
-				lblock *= mult;
-			else if (div)
-				lblock /= div;
-		}
+			lblock = ((512 * lblock) / sb->s_blocksize);
 	}
 
 	if (!ret && lblock)

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