diff options
Diffstat (limited to 'fs/isofs')
-rw-r--r-- | fs/isofs/inode.c | 55 | ||||
-rw-r--r-- | fs/isofs/symlink.c | 1 |
2 files changed, 44 insertions, 12 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 049a0cc15..1d88aaea8 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c @@ -126,6 +126,9 @@ struct iso9660_options{ uid_t uid; char *iocharset; unsigned char utf8; + /* LVE */ + s32 session; + s32 sbsector; }; /* @@ -294,6 +297,8 @@ static int parse_options(char *options, struct iso9660_options * popt) popt->uid = 0; popt->iocharset = NULL; popt->utf8 = 0; + popt->session=-1; + popt->sbsector=-1; if (!options) return 1; for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) { if (strncmp(this_char,"norock",6) == 0) { @@ -337,6 +342,18 @@ static int parse_options(char *options, struct iso9660_options * popt) else if (!strcmp(value,"acorn")) popt->map = 'a'; else return 0; } + if (!strcmp(this_char,"session") && value) { + char * vpnt = value; + unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0); + if(ivalue < 0 || ivalue >99) return 0; + popt->session=ivalue+1; + } + if (!strcmp(this_char,"sbsector") && value) { + char * vpnt = value; + unsigned int ivalue = simple_strtoul(vpnt, &vpnt, 0); + if(ivalue < 0 || ivalue >660*512) return 0; + popt->sbsector=ivalue; + } else if (!strcmp(this_char,"check") && value) { if (value[0] && !value[1] && strchr("rs",*value)) popt->check = *value; @@ -404,7 +421,7 @@ static int parse_options(char *options, struct iso9660_options * popt) */ #define WE_OBEY_THE_WRITTEN_STANDARDS 1 -static unsigned int isofs_get_last_session(kdev_t dev) +static unsigned int isofs_get_last_session(kdev_t dev,s32 session ) { struct cdrom_multisession ms_info; unsigned int vol_desc_start; @@ -423,13 +440,29 @@ static unsigned int isofs_get_last_session(kdev_t dev) */ mm_segment_t old_fs=get_fs(); inode_fake.i_rdev=dev; + init_waitqueue_head(&inode_fake.i_wait); ms_info.addr_format=CDROM_LBA; set_fs(KERNEL_DS); + if(session >= 0 && session <= 99) { + struct cdrom_tocentry Te; + Te.cdte_track=session; + Te.cdte_format=CDROM_LBA; + i=get_blkfops(MAJOR(dev))->ioctl(&inode_fake, + NULL, + CDROMREADTOCENTRY, + (unsigned long) &Te); + set_fs(old_fs); + if(!i) printk(KERN_ERR"Session %d start %d type %d\n",session,Te.cdte_addr.lba,Te.cdte_ctrl&CDROM_DATA_TRACK); + if(i || (Te.cdte_ctrl&CDROM_DATA_TRACK) != 4) + printk(KERN_ERR"Invalid session number or type of track\n"); + else return Te.cdte_addr.lba; + } i=get_blkfops(MAJOR(dev))->ioctl(&inode_fake, NULL, CDROMMULTISESSION, (unsigned long) &ms_info); set_fs(old_fs); + if(session > 0) printk(KERN_ERR"Invalid session number\n"); #if 0 printk("isofs.inode: CDROMMULTISESSION: rc=%d\n",i); if (i==0) @@ -523,7 +556,8 @@ struct super_block *isofs_read_super(struct super_block *s, void *data, s->u.isofs_sb.s_high_sierra = high_sierra = 0; /* default is iso9660 */ - vol_desc_start = isofs_get_last_session(dev); + vol_desc_start = (opt.sbsector != -1) ? + opt.sbsector : isofs_get_last_session(dev,opt.session); for (iso_blknum = vol_desc_start+16; iso_blknum < vol_desc_start+100; iso_blknum++) @@ -801,7 +835,7 @@ root_found: if (!inode->i_op) goto out_bad_root; /* get the root dentry */ - s->s_root = d_alloc_root(inode, NULL); + s->s_root = d_alloc_root(inode); if (!(s->s_root)) goto out_no_root; @@ -1116,7 +1150,7 @@ void isofs_read_inode(struct inode * inode) .. but a DVD may be up to 1Gig (Ulrich Habel) */ if((inode->i_size < 0 || inode->i_size > 1073741824) && inode->i_sb->u.isofs_sb.s_cruft == 'n') { - printk("Warning: defective cdrom. Enabling \"cruft\" mount option.\n"); + printk(KERN_WARNING "Warning: defective CD-ROM. Enabling \"cruft\" mount option.\n"); inode->i_sb->u.isofs_sb.s_cruft = 'y'; } @@ -1191,7 +1225,7 @@ void isofs_read_inode(struct inode * inode) */ if (inode->i_sb->u.isofs_sb.s_cruft == 'n' && (volume_seq_no != 0) && (volume_seq_no != 1)) { - printk("Warning: defective cdrom (volume sequence number). Enabling \"cruft\" mount option.\n"); + printk(KERN_WARNING "Warning: defective CD-ROM (volume sequence number). Enabling \"cruft\" mount option.\n"); inode->i_sb->u.isofs_sb.s_cruft = 'y'; } @@ -1200,7 +1234,7 @@ void isofs_read_inode(struct inode * inode) #ifndef IGNORE_WRONG_MULTI_VOLUME_SPECS if (inode->i_sb->u.isofs_sb.s_cruft != 'y' && (volume_seq_no != 0) && (volume_seq_no != 1)) { - printk("Multi volume CD somehow got mounted.\n"); + printk(KERN_WARNING "Multi-volume CD somehow got mounted.\n"); } else #endif IGNORE_WRONG_MULTI_VOLUME_SPECS { @@ -1210,12 +1244,9 @@ void isofs_read_inode(struct inode * inode) inode->i_op = &isofs_dir_inode_operations; else if (S_ISLNK(inode->i_mode)) inode->i_op = &isofs_symlink_inode_operations; - else if (S_ISCHR(inode->i_mode)) - inode->i_op = &chrdev_inode_operations; - else if (S_ISBLK(inode->i_mode)) - inode->i_op = &blkdev_inode_operations; - else if (S_ISFIFO(inode->i_mode)) - init_fifo(inode); + else + /* XXX - parse_rock_ridge_inode() had already set i_rdev. */ + init_special_inode(inode, inode->i_mode, kdev_t_to_nr(inode->i_rdev)); } return; diff --git a/fs/isofs/symlink.c b/fs/isofs/symlink.c index 0f909c428..5de4a8748 100644 --- a/fs/isofs/symlink.c +++ b/fs/isofs/symlink.c @@ -9,6 +9,7 @@ * extensions to iso9660 */ +#include <linux/string.h> #include <linux/errno.h> #include <linux/sched.h> #include <linux/fs.h> |