Deleted Added
full compact
39c39
< * $Id: cd9660_vfsops.c,v 1.50 1999/01/30 12:26:22 phk Exp $
---
> * $Id: cd9660_vfsops.c,v 1.51 1999/01/31 11:54:29 bde Exp $
55a56
> #include <sys/syslog.h>
283a285
> struct buf *pribp = NULL, *supbp = NULL;
289a292
> int joliet_level;
291,292c294,296
< struct iso_primary_descriptor *pri;
< struct iso_sierra_primary_descriptor *pri_sierra;
---
> struct iso_primary_descriptor *pri = NULL;
> struct iso_sierra_primary_descriptor *pri_sierra = NULL;
> struct iso_supplementary_descriptor *sup = NULL;
321a326
> joliet_level = 0;
337a343,352
> switch (isonum_711 (high_sierra? vdp->type_sierra: vdp->type)){
> case ISO_VD_PRIMARY:
> if (pribp == NULL) {
> pribp = bp;
> bp = NULL;
> pri = (struct iso_primary_descriptor *)vdp;
> pri_sierra =
> (struct iso_sierra_primary_descriptor *)vdp;
> }
> break;
339,342c354,358
< if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_END) {
< error = EINVAL;
< goto out;
< }
---
> case ISO_VD_SUPPLEMENTARY:
> if (supbp == NULL) {
> supbp = bp;
> bp = NULL;
> sup = (struct iso_supplementary_descriptor *)vdp;
344c360,371
< if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) == ISO_VD_PRIMARY)
---
> if (!(argp->flags & ISOFSMNT_NOJOLIET)) {
> if (bcmp(sup->escape, "%/@", 3) == 0)
> joliet_level = 1;
> if (bcmp(sup->escape, "%/C", 3) == 0)
> joliet_level = 2;
> if (bcmp(sup->escape, "%/E", 3) == 0)
> joliet_level = 3;
>
> if (isonum_711 (sup->flags) & 1)
> joliet_level = 0;
> }
> }
345a373,386
>
> case ISO_VD_END:
> goto vd_end;
>
> default:
> break;
> }
> if (bp) {
> brelse(bp);
> bp = NULL;
> }
> }
> vd_end:
> if (bp) {
346a388
> bp = NULL;
349c391
< if (isonum_711 (high_sierra? vdp->type_sierra: vdp->type) != ISO_VD_PRIMARY) {
---
> if (pri == NULL) {
354,356d395
< pri = (struct iso_primary_descriptor *)vdp;
< pri_sierra = (struct iso_sierra_primary_descriptor *)vdp;
<
379a419
> isomp->joliet_level = 0;
394,396c434
< isomp->im_bshift = 0;
< while ((1 << isomp->im_bshift) < isomp->logical_block_size)
< isomp->im_bshift++;
---
> isomp->im_bshift = ffs(logical_block_size) - 1;
398,400c436,438
< bp->b_flags |= B_AGE;
< brelse(bp);
< bp = NULL;
---
> pribp->b_flags |= B_AGE;
> brelse(pribp);
> pribp = NULL;
437c475,476
< isomp->im_flags = argp->flags&(ISOFSMNT_NORRIP|ISOFSMNT_GENS|ISOFSMNT_EXTATT);
---
> isomp->im_flags = argp->flags & (ISOFSMNT_NORRIP | ISOFSMNT_GENS |
> ISOFSMNT_EXTATT | ISOFSMNT_NOJOLIET);
439c478
< if(high_sierra)
---
> if (high_sierra) {
440a480
> log(LOG_INFO, "cd9660: High Sierra Format\n");
442c482
< else
---
> } else
450a491
> log(LOG_INFO, "cd9660: RockRidge Extension\n");
454a496,513
> /* Decide whether to use the Joliet descriptor */
>
> if (isomp->iso_ftype != ISO_FTYPE_RRIP && joliet_level) {
> log(LOG_INFO, "cd9660: Joliet Extension\n");
> rootp = (struct iso_directory_record *)
> sup->root_directory_record;
> bcopy (rootp, isomp->root, sizeof isomp->root);
> isomp->root_extent = isonum_733 (rootp->extent);
> isomp->root_size = isonum_733 (rootp->size);
> isomp->joliet_level = joliet_level;
> supbp->b_flags |= B_AGE;
> }
>
> if (supbp) {
> brelse(supbp);
> supbp = NULL;
> }
>
459a519,522
> if (pribp)
> brelse(pribp);
> if (supbp)
> brelse(supbp);