summaryrefslogtreecommitdiffstats
path: root/fs/isofs/inode.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-12-04 03:58:56 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-12-04 03:58:56 +0000
commit1d67e90f19a7acfd9a05dc59678e7d0c5090bd0d (patch)
tree357efc7b93f8f5102110d20d293f41360ec212fc /fs/isofs/inode.c
parentaea27b2e18d69af87e673972246e66657b4fa274 (diff)
Merge with Linux 2.3.21.
Diffstat (limited to 'fs/isofs/inode.c')
-rw-r--r--fs/isofs/inode.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index f055c52e0..8001c5186 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -446,6 +446,14 @@ static unsigned int isofs_get_last_session(kdev_t dev,s32 session )
inode_fake.i_rdev=dev;
init_waitqueue_head(&inode_fake.i_wait);
ms_info.addr_format=CDROM_LBA;
+ /* If a minor device was explicitly opened, set session to the
+ * minor number. For instance, if /dev/hdc1 is mounted, session
+ * 1 on the CD-ROM is selected. CD_PART_MAX gives access to
+ * a max of 64 sessions on IDE. SCSI drives must still use
+ * the session option to mount.
+ */
+ if ((MINOR(dev) % CD_PART_MAX) && (MAJOR(dev) != SCSI_CDROM_MAJOR))
+ session = MINOR(dev) % CD_PART_MAX;
set_fs(KERNEL_DS);
if(session >= 0 && session <= 99) {
struct cdrom_tocentry Te;
@@ -1042,6 +1050,7 @@ static int isofs_read_level3_size(struct inode * inode)
struct buffer_head * bh = NULL;
int block = 0;
int i = 0;
+ int more_entries = 0;
void *cpnt;
struct iso_directory_record * raw_inode;
@@ -1062,7 +1071,6 @@ static int isofs_read_level3_size(struct inode * inode)
goto out_noread;
}
pnt = ((unsigned char *) bh->b_data + offset);
- raw_inode = ((struct iso_directory_record *) pnt);
/*
* Note: this is invariant even if the record
* spans buffers and must be copied ...
@@ -1074,6 +1082,7 @@ static int isofs_read_level3_size(struct inode * inode)
ino = (ino & ~(ISOFS_BLOCK_SIZE - 1)) + ISOFS_BLOCK_SIZE;
continue;
}
+ raw_inode = ((struct iso_directory_record *) pnt);
/* Check whether the raw inode spans the buffer ... */
if (offset + reclen > bufsize){
@@ -1095,13 +1104,15 @@ static int isofs_read_level3_size(struct inode * inode)
inode->i_size += isonum_733 (raw_inode->size);
if(i == 1) inode->u.isofs_i.i_next_section_ino = ino;
+ more_entries = raw_inode->flags[-high_sierra] & 0x80;
+
ino += reclen;
if (cpnt)
kfree (cpnt);
i++;
if(i > 100)
goto out_toomany;
- } while(raw_inode->flags[-high_sierra] & 0x80);
+ } while(more_entries);
out:
brelse(bh);
return 0;