diff options
author | Jan Kara <jack@suse.cz> | 2009-06-17 19:26:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-18 16:03:45 -0400 |
commit | 5404ac8e4418ab3d254950ee4f9bcafc1da20b4a (patch) | |
tree | 00ce9ff14b27eb4e8cc1a51970b7da244b102ab7 /fs | |
parent | 5c4a656b7e51503c2b5e7e7310ec326ee38a8389 (diff) |
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: Jan Kara <jack@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/isofs/dir.c | 5 | ||||
-rw-r--r-- | fs/isofs/inode.c | 48 | ||||
-rw-r--r-- | fs/isofs/isofs.h | 28 | ||||
-rw-r--r-- | fs/isofs/namei.c | 4 |
4 files changed, 40 insertions, 45 deletions
diff --git a/fs/isofs/dir.c b/fs/isofs/dir.c index 2f0dc5a14633..8ba5441063be 100644 --- a/fs/isofs/dir.c +++ b/fs/isofs/dir.c | |||
@@ -195,9 +195,8 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp, | |||
195 | * Do not report hidden files if so instructed, or associated | 195 | * Do not report hidden files if so instructed, or associated |
196 | * files unless instructed to do so | 196 | * files unless instructed to do so |
197 | */ | 197 | */ |
198 | if ((sbi->s_hide == 'y' && | 198 | if ((sbi->s_hide && (de->flags[-sbi->s_high_sierra] & 1)) || |
199 | (de->flags[-sbi->s_high_sierra] & 1)) || | 199 | (!sbi->s_showassoc && |
200 | (sbi->s_showassoc =='n' && | ||
201 | (de->flags[-sbi->s_high_sierra] & 4))) { | 200 | (de->flags[-sbi->s_high_sierra] & 4))) { |
202 | filp->f_pos += de_len; | 201 | filp->f_pos += de_len; |
203 | continue; | 202 | continue; |
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index 0f4f9ca77f8e..58a7963e168a 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c | |||
@@ -141,24 +141,24 @@ static const struct dentry_operations isofs_dentry_ops[] = { | |||
141 | }; | 141 | }; |
142 | 142 | ||
143 | struct iso9660_options{ | 143 | struct iso9660_options{ |
144 | char map; | 144 | unsigned int rock:1; |
145 | char rock; | 145 | unsigned int cruft:1; |
146 | unsigned int hide:1; | ||
147 | unsigned int showassoc:1; | ||
148 | unsigned int nocompress:1; | ||
149 | unsigned int overriderockperm:1; | ||
150 | unsigned int uid_set:1; | ||
151 | unsigned int gid_set:1; | ||
152 | unsigned int utf8:1; | ||
153 | unsigned char map; | ||
146 | char joliet; | 154 | char joliet; |
147 | char cruft; | ||
148 | char hide; | ||
149 | char showassoc; | ||
150 | char nocompress; | ||
151 | char overriderockperm; | ||
152 | unsigned char check; | 155 | unsigned char check; |
153 | unsigned int blocksize; | 156 | unsigned int blocksize; |
154 | mode_t fmode; | 157 | mode_t fmode; |
155 | mode_t dmode; | 158 | mode_t dmode; |
156 | char uid_set; | ||
157 | char gid_set; | ||
158 | gid_t gid; | 159 | gid_t gid; |
159 | uid_t uid; | 160 | uid_t uid; |
160 | char *iocharset; | 161 | char *iocharset; |
161 | unsigned char utf8; | ||
162 | /* LVE */ | 162 | /* LVE */ |
163 | s32 session; | 163 | s32 session; |
164 | s32 sbsector; | 164 | s32 sbsector; |
@@ -363,11 +363,11 @@ static int parse_options(char *options, struct iso9660_options *popt) | |||
363 | int option; | 363 | int option; |
364 | 364 | ||
365 | popt->map = 'n'; | 365 | popt->map = 'n'; |
366 | popt->rock = 'y'; | 366 | popt->rock = 1; |
367 | popt->joliet = 'y'; | 367 | popt->joliet = 1; |
368 | popt->cruft = 'n'; | 368 | popt->cruft = 0; |
369 | popt->hide = 'n'; | 369 | popt->hide = 0; |
370 | popt->showassoc = 'n'; | 370 | popt->showassoc = 0; |
371 | popt->check = 'u'; /* unset */ | 371 | popt->check = 'u'; /* unset */ |
372 | popt->nocompress = 0; | 372 | popt->nocompress = 0; |
373 | popt->blocksize = 1024; | 373 | popt->blocksize = 1024; |
@@ -395,20 +395,20 @@ static int parse_options(char *options, struct iso9660_options *popt) | |||
395 | token = match_token(p, tokens, args); | 395 | token = match_token(p, tokens, args); |
396 | switch (token) { | 396 | switch (token) { |
397 | case Opt_norock: | 397 | case Opt_norock: |
398 | popt->rock = 'n'; | 398 | popt->rock = 0; |
399 | break; | 399 | break; |
400 | case Opt_nojoliet: | 400 | case Opt_nojoliet: |
401 | popt->joliet = 'n'; | 401 | popt->joliet = 0; |
402 | break; | 402 | break; |
403 | case Opt_hide: | 403 | case Opt_hide: |
404 | popt->hide = 'y'; | 404 | popt->hide = 1; |
405 | break; | 405 | break; |
406 | case Opt_unhide: | 406 | case Opt_unhide: |
407 | case Opt_showassoc: | 407 | case Opt_showassoc: |
408 | popt->showassoc = 'y'; | 408 | popt->showassoc = 1; |
409 | break; | 409 | break; |
410 | case Opt_cruft: | 410 | case Opt_cruft: |
411 | popt->cruft = 'y'; | 411 | popt->cruft = 1; |
412 | break; | 412 | break; |
413 | case Opt_utf8: | 413 | case Opt_utf8: |
414 | popt->utf8 = 1; | 414 | popt->utf8 = 1; |
@@ -657,7 +657,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent) | |||
657 | goto out_freebh; | 657 | goto out_freebh; |
658 | 658 | ||
659 | sbi->s_high_sierra = 1; | 659 | sbi->s_high_sierra = 1; |
660 | opt.rock = 'n'; | 660 | opt.rock = 0; |
661 | h_pri = (struct hs_primary_descriptor *)vdp; | 661 | h_pri = (struct hs_primary_descriptor *)vdp; |
662 | goto root_found; | 662 | goto root_found; |
663 | } | 663 | } |
@@ -680,7 +680,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent) | |||
680 | 680 | ||
681 | root_found: | 681 | root_found: |
682 | 682 | ||
683 | if (joliet_level && (pri == NULL || opt.rock == 'n')) { | 683 | if (joliet_level && (pri == NULL || !opt.rock)) { |
684 | /* This is the case of Joliet with the norock mount flag. | 684 | /* This is the case of Joliet with the norock mount flag. |
685 | * A disc with both Joliet and Rock Ridge is handled later | 685 | * A disc with both Joliet and Rock Ridge is handled later |
686 | */ | 686 | */ |
@@ -809,7 +809,7 @@ root_found: | |||
809 | s->s_op = &isofs_sops; | 809 | s->s_op = &isofs_sops; |
810 | s->s_export_op = &isofs_export_ops; | 810 | s->s_export_op = &isofs_export_ops; |
811 | sbi->s_mapping = opt.map; | 811 | sbi->s_mapping = opt.map; |
812 | sbi->s_rock = (opt.rock == 'y' ? 2 : 0); | 812 | sbi->s_rock = (opt.rock ? 2 : 0); |
813 | sbi->s_rock_offset = -1; /* initial offset, will guess until SP is found*/ | 813 | sbi->s_rock_offset = -1; /* initial offset, will guess until SP is found*/ |
814 | sbi->s_cruft = opt.cruft; | 814 | sbi->s_cruft = opt.cruft; |
815 | sbi->s_hide = opt.hide; | 815 | sbi->s_hide = opt.hide; |
@@ -1315,7 +1315,7 @@ static int isofs_read_inode(struct inode *inode) | |||
1315 | * this CDROM was mounted with the cruft option. | 1315 | * this CDROM was mounted with the cruft option. |
1316 | */ | 1316 | */ |
1317 | 1317 | ||
1318 | if (sbi->s_cruft == 'y') | 1318 | if (sbi->s_cruft) |
1319 | inode->i_size &= 0x00ffffff; | 1319 | inode->i_size &= 0x00ffffff; |
1320 | 1320 | ||
1321 | if (de->interleave[0]) { | 1321 | if (de->interleave[0]) { |
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h index e2fc9704f14f..7d33de84f52a 100644 --- a/fs/isofs/isofs.h +++ b/fs/isofs/isofs.h | |||
@@ -35,24 +35,20 @@ struct isofs_sb_info { | |||
35 | unsigned long s_log_zone_size; | 35 | unsigned long s_log_zone_size; |
36 | unsigned long s_max_size; | 36 | unsigned long s_max_size; |
37 | 37 | ||
38 | unsigned char s_high_sierra; /* A simple flag */ | ||
39 | unsigned char s_mapping; | ||
40 | int s_rock_offset; /* offset of SUSP fields within SU area */ | 38 | int s_rock_offset; /* offset of SUSP fields within SU area */ |
41 | unsigned char s_rock; | ||
42 | unsigned char s_joliet_level; | 39 | unsigned char s_joliet_level; |
43 | unsigned char s_utf8; | 40 | unsigned char s_mapping; |
44 | unsigned char s_cruft; /* Broken disks with high | 41 | unsigned int s_high_sierra:1; |
45 | byte of length containing | 42 | unsigned int s_rock:2; |
46 | junk */ | 43 | unsigned int s_utf8:1; |
47 | unsigned char s_unhide; | 44 | unsigned int s_cruft:1; /* Broken disks with high byte of length |
48 | unsigned char s_nosuid; | 45 | * containing junk */ |
49 | unsigned char s_nodev; | 46 | unsigned int s_nocompress:1; |
50 | unsigned char s_nocompress; | 47 | unsigned int s_hide:1; |
51 | unsigned char s_hide; | 48 | unsigned int s_showassoc:1; |
52 | unsigned char s_showassoc; | 49 | unsigned int s_overriderockperm:1; |
53 | unsigned char s_overriderockperm; | 50 | unsigned int s_uid_set:1; |
54 | unsigned char s_uid_set; | 51 | unsigned int s_gid_set:1; |
55 | unsigned char s_gid_set; | ||
56 | 52 | ||
57 | mode_t s_fmode; | 53 | mode_t s_fmode; |
58 | mode_t s_dmode; | 54 | mode_t s_dmode; |
diff --git a/fs/isofs/namei.c b/fs/isofs/namei.c index 8299889a835e..eaa831311c9c 100644 --- a/fs/isofs/namei.c +++ b/fs/isofs/namei.c | |||
@@ -142,9 +142,9 @@ isofs_find_entry(struct inode *dir, struct dentry *dentry, | |||
142 | */ | 142 | */ |
143 | match = 0; | 143 | match = 0; |
144 | if (dlen > 0 && | 144 | if (dlen > 0 && |
145 | (sbi->s_hide =='n' || | 145 | (!sbi->s_hide || |
146 | (!(de->flags[-sbi->s_high_sierra] & 1))) && | 146 | (!(de->flags[-sbi->s_high_sierra] & 1))) && |
147 | (sbi->s_showassoc =='y' || | 147 | (sbi->s_showassoc || |
148 | (!(de->flags[-sbi->s_high_sierra] & 4)))) { | 148 | (!(de->flags[-sbi->s_high_sierra] & 4)))) { |
149 | match = (isofs_cmp(dentry, dpnt, dlen) == 0); | 149 | match = (isofs_cmp(dentry, dpnt, dlen) == 0); |
150 | } | 150 | } |