Commit 5404ac8e authored by Jan Kara's avatar Jan Kara Committed by Linus Torvalds

isofs: cleanup mount option processing

Remove unused variables from isofs_sb_info (used to be some mount
options), unify variables for option to use 0/1 (some options used
'y'/'n'), use bit fields for option flags in superblock.
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5c4a656b
...@@ -195,9 +195,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp, ...@@ -195,9 +195,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp,
* Do not report hidden files if so instructed, or associated * Do not report hidden files if so instructed, or associated
* files unless instructed to do so * files unless instructed to do so
*/ */
if ((sbi->s_hide == 'y' && if ((sbi->s_hide && (de->flags[-sbi->s_high_sierra] & 1)) ||
(de->flags[-sbi->s_high_sierra] & 1)) || (!sbi->s_showassoc &&
(sbi->s_showassoc =='n' &&
(de->flags[-sbi->s_high_sierra] & 4))) { (de->flags[-sbi->s_high_sierra] & 4))) {
filp->f_pos += de_len; filp->f_pos += de_len;
continue; continue;
......
...@@ -141,24 +141,24 @@ static const struct dentry_operations isofs_dentry_ops[] = { ...@@ -141,24 +141,24 @@ static const struct dentry_operations isofs_dentry_ops[] = {
}; };
struct iso9660_options{ struct iso9660_options{
char map; unsigned int rock:1;
char rock; unsigned int cruft:1;
unsigned int hide:1;
unsigned int showassoc:1;
unsigned int nocompress:1;
unsigned int overriderockperm:1;
unsigned int uid_set:1;
unsigned int gid_set:1;
unsigned int utf8:1;
unsigned char map;
char joliet; char joliet;
char cruft;
char hide;
char showassoc;
char nocompress;
char overriderockperm;
unsigned char check; unsigned char check;
unsigned int blocksize; unsigned int blocksize;
mode_t fmode; mode_t fmode;
mode_t dmode; mode_t dmode;
char uid_set;
char gid_set;
gid_t gid; gid_t gid;
uid_t uid; uid_t uid;
char *iocharset; char *iocharset;
unsigned char utf8;
/* LVE */ /* LVE */
s32 session; s32 session;
s32 sbsector; s32 sbsector;
...@@ -363,11 +363,11 @@ static int parse_options(char *options, struct iso9660_options *popt) ...@@ -363,11 +363,11 @@ static int parse_options(char *options, struct iso9660_options *popt)
int option; int option;
popt->map = 'n'; popt->map = 'n';
popt->rock = 'y'; popt->rock = 1;
popt->joliet = 'y'; popt->joliet = 1;
popt->cruft = 'n'; popt->cruft = 0;
popt->hide = 'n'; popt->hide = 0;
popt->showassoc = 'n'; popt->showassoc = 0;
popt->check = 'u'; /* unset */ popt->check = 'u'; /* unset */
popt->nocompress = 0; popt->nocompress = 0;
popt->blocksize = 1024; popt->blocksize = 1024;
...@@ -395,20 +395,20 @@ static int parse_options(char *options, struct iso9660_options *popt) ...@@ -395,20 +395,20 @@ static int parse_options(char *options, struct iso9660_options *popt)
token = match_token(p, tokens, args); token = match_token(p, tokens, args);
switch (token) { switch (token) {
case Opt_norock: case Opt_norock:
popt->rock = 'n'; popt->rock = 0;
break; break;
case Opt_nojoliet: case Opt_nojoliet:
popt->joliet = 'n'; popt->joliet = 0;
break; break;
case Opt_hide: case Opt_hide:
popt->hide = 'y'; popt->hide = 1;
break; break;
case Opt_unhide: case Opt_unhide:
case Opt_showassoc: case Opt_showassoc:
popt->showassoc = 'y'; popt->showassoc = 1;
break; break;
case Opt_cruft: case Opt_cruft:
popt->cruft = 'y'; popt->cruft = 1;
break; break;
case Opt_utf8: case Opt_utf8:
popt->utf8 = 1; popt->utf8 = 1;
...@@ -657,7 +657,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent) ...@@ -657,7 +657,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
goto out_freebh; goto out_freebh;
sbi->s_high_sierra = 1; sbi->s_high_sierra = 1;
opt.rock = 'n'; opt.rock = 0;
h_pri = (struct hs_primary_descriptor *)vdp; h_pri = (struct hs_primary_descriptor *)vdp;
goto root_found; goto root_found;
} }
...@@ -680,7 +680,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent) ...@@ -680,7 +680,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent)
root_found: root_found:
if (joliet_level && (pri == NULL || opt.rock == 'n')) { if (joliet_level && (pri == NULL || !opt.rock)) {
/* This is the case of Joliet with the norock mount flag. /* This is the case of Joliet with the norock mount flag.
* A disc with both Joliet and Rock Ridge is handled later * A disc with both Joliet and Rock Ridge is handled later
*/ */
...@@ -809,7 +809,7 @@ root_found: ...@@ -809,7 +809,7 @@ root_found:
s->s_op = &isofs_sops; s->s_op = &isofs_sops;
s->s_export_op = &isofs_export_ops; s->s_export_op = &isofs_export_ops;
sbi->s_mapping = opt.map; sbi->s_mapping = opt.map;
sbi->s_rock = (opt.rock == 'y' ? 2 : 0); sbi->s_rock = (opt.rock ? 2 : 0);
sbi->s_rock_offset = -1; /* initial offset, will guess until SP is found*/ sbi->s_rock_offset = -1; /* initial offset, will guess until SP is found*/
sbi->s_cruft = opt.cruft; sbi->s_cruft = opt.cruft;
sbi->s_hide = opt.hide; sbi->s_hide = opt.hide;
...@@ -1315,7 +1315,7 @@ static int isofs_read_inode(struct inode *inode) ...@@ -1315,7 +1315,7 @@ static int isofs_read_inode(struct inode *inode)
* this CDROM was mounted with the cruft option. * this CDROM was mounted with the cruft option.
*/ */
if (sbi->s_cruft == 'y') if (sbi->s_cruft)
inode->i_size &= 0x00ffffff; inode->i_size &= 0x00ffffff;
if (de->interleave[0]) { if (de->interleave[0]) {
......
...@@ -35,24 +35,20 @@ struct isofs_sb_info { ...@@ -35,24 +35,20 @@ struct isofs_sb_info {
unsigned long s_log_zone_size; unsigned long s_log_zone_size;
unsigned long s_max_size; unsigned long s_max_size;
unsigned char s_high_sierra; /* A simple flag */
unsigned char s_mapping;
int s_rock_offset; /* offset of SUSP fields within SU area */ int s_rock_offset; /* offset of SUSP fields within SU area */
unsigned char s_rock;
unsigned char s_joliet_level; unsigned char s_joliet_level;
unsigned char s_utf8; unsigned char s_mapping;
unsigned char s_cruft; /* Broken disks with high unsigned int s_high_sierra:1;
byte of length containing unsigned int s_rock:2;
junk */ unsigned int s_utf8:1;
unsigned char s_unhide; unsigned int s_cruft:1; /* Broken disks with high byte of length
unsigned char s_nosuid; * containing junk */
unsigned char s_nodev; unsigned int s_nocompress:1;
unsigned char s_nocompress; unsigned int s_hide:1;
unsigned char s_hide; unsigned int s_showassoc:1;
unsigned char s_showassoc; unsigned int s_overriderockperm:1;
unsigned char s_overriderockperm; unsigned int s_uid_set:1;
unsigned char s_uid_set; unsigned int s_gid_set:1;
unsigned char s_gid_set;
mode_t s_fmode; mode_t s_fmode;
mode_t s_dmode; mode_t s_dmode;
......
...@@ -142,9 +142,9 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry, ...@@ -142,9 +142,9 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry,
*/ */
match = 0; match = 0;
if (dlen > 0 && if (dlen > 0 &&
(sbi->s_hide =='n' || (!sbi->s_hide ||
(!(de->flags[-sbi->s_high_sierra] & 1))) && (!(de->flags[-sbi->s_high_sierra] & 1))) &&
(sbi->s_showassoc =='y' || (sbi->s_showassoc ||
(!(de->flags[-sbi->s_high_sierra] & 4)))) { (!(de->flags[-sbi->s_high_sierra] & 4)))) {
match = (isofs_cmp(dentry, dpnt, dlen) == 0); match = (isofs_cmp(dentry, dpnt, dlen) == 0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment