summaryrefslogtreecommitdiffstats
path: root/fs/udf/lowlevel.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-01-29 01:41:54 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-01-29 01:41:54 +0000
commitf969d69ba9f952e5bdd38278e25e26a3e4a61a70 (patch)
treeb3530d803df59d726afaabebc6626987dee1ca05 /fs/udf/lowlevel.c
parenta10ce7ef2066b455d69187643ddf2073bfc4db24 (diff)
Merge with 2.3.27.
Diffstat (limited to 'fs/udf/lowlevel.c')
-rw-r--r--fs/udf/lowlevel.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/udf/lowlevel.c b/fs/udf/lowlevel.c
index 91ead3d39..635ab1b79 100644
--- a/fs/udf/lowlevel.c
+++ b/fs/udf/lowlevel.c
@@ -95,16 +95,17 @@ udf_get_last_block(kdev_t dev, int *flags)
int ret;
unsigned long lblock;
unsigned int hbsize = get_hardblocksize(dev);
+ unsigned int secsize = 512;
unsigned int mult = 0;
unsigned int div = 0;
if (!hbsize)
- hbsize = 512;
+ hbsize = blksize_size[MAJOR(dev)][MINOR(dev)];
- if (hbsize > blksize_size[MAJOR(dev)][MINOR(dev)])
- mult = hbsize / blksize_size[MAJOR(dev)][MINOR(dev)];
- else if (blksize_size[MAJOR(dev)][MINOR(dev)] > hbsize)
- div = blksize_size[MAJOR(dev)][MINOR(dev)] / hbsize;
+ if (secsize > hbsize)
+ mult = secsize / hbsize;
+ else if (hbsize > secsize)
+ div = hbsize / secsize;
if (get_blkfops(MAJOR(dev))->ioctl!=NULL)
{
@@ -138,7 +139,7 @@ udf_get_last_block(kdev_t dev, int *flags)
}
set_fs(old_fs);
- if (!ret)
+ if (!ret && lblock)
return lblock - 1;
}
else