diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext2/super.c | 161 | ||||
-rw-r--r-- | fs/isofs/isofs.h | 22 | ||||
-rw-r--r-- | fs/isofs/rock.h | 64 | ||||
-rw-r--r-- | fs/isofs/util.c | 2 | ||||
-rw-r--r-- | fs/notify/fanotify/fanotify.c | 8 | ||||
-rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 16 | ||||
-rw-r--r-- | fs/notify/fdinfo.c | 3 | ||||
-rw-r--r-- | fs/quota/dquot.c | 13 | ||||
-rw-r--r-- | fs/udf/balloc.c | 29 | ||||
-rw-r--r-- | fs/udf/dir.c | 2 | ||||
-rw-r--r-- | fs/udf/directory.c | 9 | ||||
-rw-r--r-- | fs/udf/ialloc.c | 2 | ||||
-rw-r--r-- | fs/udf/inode.c | 50 | ||||
-rw-r--r-- | fs/udf/misc.c | 8 | ||||
-rw-r--r-- | fs/udf/namei.c | 13 | ||||
-rw-r--r-- | fs/udf/partition.c | 6 | ||||
-rw-r--r-- | fs/udf/super.c | 56 | ||||
-rw-r--r-- | fs/udf/truncate.c | 2 | ||||
-rw-r--r-- | fs/udf/udfdecl.h | 21 | ||||
-rw-r--r-- | fs/udf/unicode.c | 2 |
20 files changed, 262 insertions, 227 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 1458706bd2ec..e2b6be03e69b 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -479,10 +479,10 @@ static const match_table_t tokens = { | |||
479 | {Opt_err, NULL} | 479 | {Opt_err, NULL} |
480 | }; | 480 | }; |
481 | 481 | ||
482 | static int parse_options(char *options, struct super_block *sb) | 482 | static int parse_options(char *options, struct super_block *sb, |
483 | struct ext2_mount_options *opts) | ||
483 | { | 484 | { |
484 | char *p; | 485 | char *p; |
485 | struct ext2_sb_info *sbi = EXT2_SB(sb); | ||
486 | substring_t args[MAX_OPT_ARGS]; | 486 | substring_t args[MAX_OPT_ARGS]; |
487 | int option; | 487 | int option; |
488 | kuid_t uid; | 488 | kuid_t uid; |
@@ -499,16 +499,16 @@ static int parse_options(char *options, struct super_block *sb) | |||
499 | token = match_token(p, tokens, args); | 499 | token = match_token(p, tokens, args); |
500 | switch (token) { | 500 | switch (token) { |
501 | case Opt_bsd_df: | 501 | case Opt_bsd_df: |
502 | clear_opt (sbi->s_mount_opt, MINIX_DF); | 502 | clear_opt (opts->s_mount_opt, MINIX_DF); |
503 | break; | 503 | break; |
504 | case Opt_minix_df: | 504 | case Opt_minix_df: |
505 | set_opt (sbi->s_mount_opt, MINIX_DF); | 505 | set_opt (opts->s_mount_opt, MINIX_DF); |
506 | break; | 506 | break; |
507 | case Opt_grpid: | 507 | case Opt_grpid: |
508 | set_opt (sbi->s_mount_opt, GRPID); | 508 | set_opt (opts->s_mount_opt, GRPID); |
509 | break; | 509 | break; |
510 | case Opt_nogrpid: | 510 | case Opt_nogrpid: |
511 | clear_opt (sbi->s_mount_opt, GRPID); | 511 | clear_opt (opts->s_mount_opt, GRPID); |
512 | break; | 512 | break; |
513 | case Opt_resuid: | 513 | case Opt_resuid: |
514 | if (match_int(&args[0], &option)) | 514 | if (match_int(&args[0], &option)) |
@@ -519,7 +519,7 @@ static int parse_options(char *options, struct super_block *sb) | |||
519 | return 0; | 519 | return 0; |
520 | 520 | ||
521 | } | 521 | } |
522 | sbi->s_resuid = uid; | 522 | opts->s_resuid = uid; |
523 | break; | 523 | break; |
524 | case Opt_resgid: | 524 | case Opt_resgid: |
525 | if (match_int(&args[0], &option)) | 525 | if (match_int(&args[0], &option)) |
@@ -529,51 +529,51 @@ static int parse_options(char *options, struct super_block *sb) | |||
529 | ext2_msg(sb, KERN_ERR, "Invalid gid value %d", option); | 529 | ext2_msg(sb, KERN_ERR, "Invalid gid value %d", option); |
530 | return 0; | 530 | return 0; |
531 | } | 531 | } |
532 | sbi->s_resgid = gid; | 532 | opts->s_resgid = gid; |
533 | break; | 533 | break; |
534 | case Opt_sb: | 534 | case Opt_sb: |
535 | /* handled by get_sb_block() instead of here */ | 535 | /* handled by get_sb_block() instead of here */ |
536 | /* *sb_block = match_int(&args[0]); */ | 536 | /* *sb_block = match_int(&args[0]); */ |
537 | break; | 537 | break; |
538 | case Opt_err_panic: | 538 | case Opt_err_panic: |
539 | clear_opt (sbi->s_mount_opt, ERRORS_CONT); | 539 | clear_opt (opts->s_mount_opt, ERRORS_CONT); |
540 | clear_opt (sbi->s_mount_opt, ERRORS_RO); | 540 | clear_opt (opts->s_mount_opt, ERRORS_RO); |
541 | set_opt (sbi->s_mount_opt, ERRORS_PANIC); | 541 | set_opt (opts->s_mount_opt, ERRORS_PANIC); |
542 | break; | 542 | break; |
543 | case Opt_err_ro: | 543 | case Opt_err_ro: |
544 | clear_opt (sbi->s_mount_opt, ERRORS_CONT); | 544 | clear_opt (opts->s_mount_opt, ERRORS_CONT); |
545 | clear_opt (sbi->s_mount_opt, ERRORS_PANIC); | 545 | clear_opt (opts->s_mount_opt, ERRORS_PANIC); |
546 | set_opt (sbi->s_mount_opt, ERRORS_RO); | 546 | set_opt (opts->s_mount_opt, ERRORS_RO); |
547 | break; | 547 | break; |
548 | case Opt_err_cont: | 548 | case Opt_err_cont: |
549 | clear_opt (sbi->s_mount_opt, ERRORS_RO); | 549 | clear_opt (opts->s_mount_opt, ERRORS_RO); |
550 | clear_opt (sbi->s_mount_opt, ERRORS_PANIC); | 550 | clear_opt (opts->s_mount_opt, ERRORS_PANIC); |
551 | set_opt (sbi->s_mount_opt, ERRORS_CONT); | 551 | set_opt (opts->s_mount_opt, ERRORS_CONT); |
552 | break; | 552 | break; |
553 | case Opt_nouid32: | 553 | case Opt_nouid32: |
554 | set_opt (sbi->s_mount_opt, NO_UID32); | 554 | set_opt (opts->s_mount_opt, NO_UID32); |
555 | break; | 555 | break; |
556 | case Opt_nocheck: | 556 | case Opt_nocheck: |
557 | clear_opt (sbi->s_mount_opt, CHECK); | 557 | clear_opt (opts->s_mount_opt, CHECK); |
558 | break; | 558 | break; |
559 | case Opt_debug: | 559 | case Opt_debug: |
560 | set_opt (sbi->s_mount_opt, DEBUG); | 560 | set_opt (opts->s_mount_opt, DEBUG); |
561 | break; | 561 | break; |
562 | case Opt_oldalloc: | 562 | case Opt_oldalloc: |
563 | set_opt (sbi->s_mount_opt, OLDALLOC); | 563 | set_opt (opts->s_mount_opt, OLDALLOC); |
564 | break; | 564 | break; |
565 | case Opt_orlov: | 565 | case Opt_orlov: |
566 | clear_opt (sbi->s_mount_opt, OLDALLOC); | 566 | clear_opt (opts->s_mount_opt, OLDALLOC); |
567 | break; | 567 | break; |
568 | case Opt_nobh: | 568 | case Opt_nobh: |
569 | set_opt (sbi->s_mount_opt, NOBH); | 569 | set_opt (opts->s_mount_opt, NOBH); |
570 | break; | 570 | break; |
571 | #ifdef CONFIG_EXT2_FS_XATTR | 571 | #ifdef CONFIG_EXT2_FS_XATTR |
572 | case Opt_user_xattr: | 572 | case Opt_user_xattr: |
573 | set_opt (sbi->s_mount_opt, XATTR_USER); | 573 | set_opt (opts->s_mount_opt, XATTR_USER); |
574 | break; | 574 | break; |
575 | case Opt_nouser_xattr: | 575 | case Opt_nouser_xattr: |
576 | clear_opt (sbi->s_mount_opt, XATTR_USER); | 576 | clear_opt (opts->s_mount_opt, XATTR_USER); |
577 | break; | 577 | break; |
578 | #else | 578 | #else |
579 | case Opt_user_xattr: | 579 | case Opt_user_xattr: |
@@ -584,10 +584,10 @@ static int parse_options(char *options, struct super_block *sb) | |||
584 | #endif | 584 | #endif |
585 | #ifdef CONFIG_EXT2_FS_POSIX_ACL | 585 | #ifdef CONFIG_EXT2_FS_POSIX_ACL |
586 | case Opt_acl: | 586 | case Opt_acl: |
587 | set_opt(sbi->s_mount_opt, POSIX_ACL); | 587 | set_opt(opts->s_mount_opt, POSIX_ACL); |
588 | break; | 588 | break; |
589 | case Opt_noacl: | 589 | case Opt_noacl: |
590 | clear_opt(sbi->s_mount_opt, POSIX_ACL); | 590 | clear_opt(opts->s_mount_opt, POSIX_ACL); |
591 | break; | 591 | break; |
592 | #else | 592 | #else |
593 | case Opt_acl: | 593 | case Opt_acl: |
@@ -598,13 +598,13 @@ static int parse_options(char *options, struct super_block *sb) | |||
598 | #endif | 598 | #endif |
599 | case Opt_xip: | 599 | case Opt_xip: |
600 | ext2_msg(sb, KERN_INFO, "use dax instead of xip"); | 600 | ext2_msg(sb, KERN_INFO, "use dax instead of xip"); |
601 | set_opt(sbi->s_mount_opt, XIP); | 601 | set_opt(opts->s_mount_opt, XIP); |
602 | /* Fall through */ | 602 | /* Fall through */ |
603 | case Opt_dax: | 603 | case Opt_dax: |
604 | #ifdef CONFIG_FS_DAX | 604 | #ifdef CONFIG_FS_DAX |
605 | ext2_msg(sb, KERN_WARNING, | 605 | ext2_msg(sb, KERN_WARNING, |
606 | "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); | 606 | "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); |
607 | set_opt(sbi->s_mount_opt, DAX); | 607 | set_opt(opts->s_mount_opt, DAX); |
608 | #else | 608 | #else |
609 | ext2_msg(sb, KERN_INFO, "dax option not supported"); | 609 | ext2_msg(sb, KERN_INFO, "dax option not supported"); |
610 | #endif | 610 | #endif |
@@ -613,11 +613,11 @@ static int parse_options(char *options, struct super_block *sb) | |||
613 | #if defined(CONFIG_QUOTA) | 613 | #if defined(CONFIG_QUOTA) |
614 | case Opt_quota: | 614 | case Opt_quota: |
615 | case Opt_usrquota: | 615 | case Opt_usrquota: |
616 | set_opt(sbi->s_mount_opt, USRQUOTA); | 616 | set_opt(opts->s_mount_opt, USRQUOTA); |
617 | break; | 617 | break; |
618 | 618 | ||
619 | case Opt_grpquota: | 619 | case Opt_grpquota: |
620 | set_opt(sbi->s_mount_opt, GRPQUOTA); | 620 | set_opt(opts->s_mount_opt, GRPQUOTA); |
621 | break; | 621 | break; |
622 | #else | 622 | #else |
623 | case Opt_quota: | 623 | case Opt_quota: |
@@ -629,11 +629,11 @@ static int parse_options(char *options, struct super_block *sb) | |||
629 | #endif | 629 | #endif |
630 | 630 | ||
631 | case Opt_reservation: | 631 | case Opt_reservation: |
632 | set_opt(sbi->s_mount_opt, RESERVATION); | 632 | set_opt(opts->s_mount_opt, RESERVATION); |
633 | ext2_msg(sb, KERN_INFO, "reservations ON"); | 633 | ext2_msg(sb, KERN_INFO, "reservations ON"); |
634 | break; | 634 | break; |
635 | case Opt_noreservation: | 635 | case Opt_noreservation: |
636 | clear_opt(sbi->s_mount_opt, RESERVATION); | 636 | clear_opt(opts->s_mount_opt, RESERVATION); |
637 | ext2_msg(sb, KERN_INFO, "reservations OFF"); | 637 | ext2_msg(sb, KERN_INFO, "reservations OFF"); |
638 | break; | 638 | break; |
639 | case Opt_ignore: | 639 | case Opt_ignore: |
@@ -830,6 +830,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
830 | int i, j; | 830 | int i, j; |
831 | __le32 features; | 831 | __le32 features; |
832 | int err; | 832 | int err; |
833 | struct ext2_mount_options opts; | ||
833 | 834 | ||
834 | err = -ENOMEM; | 835 | err = -ENOMEM; |
835 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); | 836 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); |
@@ -890,35 +891,39 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
890 | /* Set defaults before we parse the mount options */ | 891 | /* Set defaults before we parse the mount options */ |
891 | def_mount_opts = le32_to_cpu(es->s_default_mount_opts); | 892 | def_mount_opts = le32_to_cpu(es->s_default_mount_opts); |
892 | if (def_mount_opts & EXT2_DEFM_DEBUG) | 893 | if (def_mount_opts & EXT2_DEFM_DEBUG) |
893 | set_opt(sbi->s_mount_opt, DEBUG); | 894 | set_opt(opts.s_mount_opt, DEBUG); |
894 | if (def_mount_opts & EXT2_DEFM_BSDGROUPS) | 895 | if (def_mount_opts & EXT2_DEFM_BSDGROUPS) |
895 | set_opt(sbi->s_mount_opt, GRPID); | 896 | set_opt(opts.s_mount_opt, GRPID); |
896 | if (def_mount_opts & EXT2_DEFM_UID16) | 897 | if (def_mount_opts & EXT2_DEFM_UID16) |
897 | set_opt(sbi->s_mount_opt, NO_UID32); | 898 | set_opt(opts.s_mount_opt, NO_UID32); |
898 | #ifdef CONFIG_EXT2_FS_XATTR | 899 | #ifdef CONFIG_EXT2_FS_XATTR |
899 | if (def_mount_opts & EXT2_DEFM_XATTR_USER) | 900 | if (def_mount_opts & EXT2_DEFM_XATTR_USER) |
900 | set_opt(sbi->s_mount_opt, XATTR_USER); | 901 | set_opt(opts.s_mount_opt, XATTR_USER); |
901 | #endif | 902 | #endif |
902 | #ifdef CONFIG_EXT2_FS_POSIX_ACL | 903 | #ifdef CONFIG_EXT2_FS_POSIX_ACL |
903 | if (def_mount_opts & EXT2_DEFM_ACL) | 904 | if (def_mount_opts & EXT2_DEFM_ACL) |
904 | set_opt(sbi->s_mount_opt, POSIX_ACL); | 905 | set_opt(opts.s_mount_opt, POSIX_ACL); |
905 | #endif | 906 | #endif |
906 | 907 | ||
907 | if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_PANIC) | 908 | if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_PANIC) |
908 | set_opt(sbi->s_mount_opt, ERRORS_PANIC); | 909 | set_opt(opts.s_mount_opt, ERRORS_PANIC); |
909 | else if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_CONTINUE) | 910 | else if (le16_to_cpu(sbi->s_es->s_errors) == EXT2_ERRORS_CONTINUE) |
910 | set_opt(sbi->s_mount_opt, ERRORS_CONT); | 911 | set_opt(opts.s_mount_opt, ERRORS_CONT); |
911 | else | 912 | else |
912 | set_opt(sbi->s_mount_opt, ERRORS_RO); | 913 | set_opt(opts.s_mount_opt, ERRORS_RO); |
913 | 914 | ||
914 | sbi->s_resuid = make_kuid(&init_user_ns, le16_to_cpu(es->s_def_resuid)); | 915 | opts.s_resuid = make_kuid(&init_user_ns, le16_to_cpu(es->s_def_resuid)); |
915 | sbi->s_resgid = make_kgid(&init_user_ns, le16_to_cpu(es->s_def_resgid)); | 916 | opts.s_resgid = make_kgid(&init_user_ns, le16_to_cpu(es->s_def_resgid)); |
916 | 917 | ||
917 | set_opt(sbi->s_mount_opt, RESERVATION); | 918 | set_opt(opts.s_mount_opt, RESERVATION); |
918 | 919 | ||
919 | if (!parse_options((char *) data, sb)) | 920 | if (!parse_options((char *) data, sb, &opts)) |
920 | goto failed_mount; | 921 | goto failed_mount; |
921 | 922 | ||
923 | sbi->s_mount_opt = opts.s_mount_opt; | ||
924 | sbi->s_resuid = opts.s_resuid; | ||
925 | sbi->s_resgid = opts.s_resgid; | ||
926 | |||
922 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | | 927 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | |
923 | ((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? | 928 | ((EXT2_SB(sb)->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? |
924 | MS_POSIXACL : 0); | 929 | MS_POSIXACL : 0); |
@@ -1312,46 +1317,36 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) | |||
1312 | { | 1317 | { |
1313 | struct ext2_sb_info * sbi = EXT2_SB(sb); | 1318 | struct ext2_sb_info * sbi = EXT2_SB(sb); |
1314 | struct ext2_super_block * es; | 1319 | struct ext2_super_block * es; |
1315 | struct ext2_mount_options old_opts; | 1320 | struct ext2_mount_options new_opts; |
1316 | unsigned long old_sb_flags; | ||
1317 | int err; | 1321 | int err; |
1318 | 1322 | ||
1319 | sync_filesystem(sb); | 1323 | sync_filesystem(sb); |
1320 | spin_lock(&sbi->s_lock); | ||
1321 | 1324 | ||
1322 | /* Store the old options */ | 1325 | spin_lock(&sbi->s_lock); |
1323 | old_sb_flags = sb->s_flags; | 1326 | new_opts.s_mount_opt = sbi->s_mount_opt; |
1324 | old_opts.s_mount_opt = sbi->s_mount_opt; | 1327 | new_opts.s_resuid = sbi->s_resuid; |
1325 | old_opts.s_resuid = sbi->s_resuid; | 1328 | new_opts.s_resgid = sbi->s_resgid; |
1326 | old_opts.s_resgid = sbi->s_resgid; | 1329 | spin_unlock(&sbi->s_lock); |
1327 | 1330 | ||
1328 | /* | 1331 | /* |
1329 | * Allow the "check" option to be passed as a remount option. | 1332 | * Allow the "check" option to be passed as a remount option. |
1330 | */ | 1333 | */ |
1331 | if (!parse_options(data, sb)) { | 1334 | if (!parse_options(data, sb, &new_opts)) |
1332 | err = -EINVAL; | 1335 | return -EINVAL; |
1333 | goto restore_opts; | ||
1334 | } | ||
1335 | |||
1336 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | | ||
1337 | ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); | ||
1338 | 1336 | ||
1337 | spin_lock(&sbi->s_lock); | ||
1339 | es = sbi->s_es; | 1338 | es = sbi->s_es; |
1340 | if ((sbi->s_mount_opt ^ old_opts.s_mount_opt) & EXT2_MOUNT_DAX) { | 1339 | if ((sbi->s_mount_opt ^ new_opts.s_mount_opt) & EXT2_MOUNT_DAX) { |
1341 | ext2_msg(sb, KERN_WARNING, "warning: refusing change of " | 1340 | ext2_msg(sb, KERN_WARNING, "warning: refusing change of " |
1342 | "dax flag with busy inodes while remounting"); | 1341 | "dax flag with busy inodes while remounting"); |
1343 | sbi->s_mount_opt ^= EXT2_MOUNT_DAX; | 1342 | new_opts.s_mount_opt ^= EXT2_MOUNT_DAX; |
1344 | } | ||
1345 | if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb)) { | ||
1346 | spin_unlock(&sbi->s_lock); | ||
1347 | return 0; | ||
1348 | } | 1343 | } |
1344 | if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb)) | ||
1345 | goto out_set; | ||
1349 | if (*flags & MS_RDONLY) { | 1346 | if (*flags & MS_RDONLY) { |
1350 | if (le16_to_cpu(es->s_state) & EXT2_VALID_FS || | 1347 | if (le16_to_cpu(es->s_state) & EXT2_VALID_FS || |
1351 | !(sbi->s_mount_state & EXT2_VALID_FS)) { | 1348 | !(sbi->s_mount_state & EXT2_VALID_FS)) |
1352 | spin_unlock(&sbi->s_lock); | 1349 | goto out_set; |
1353 | return 0; | ||
1354 | } | ||
1355 | 1350 | ||
1356 | /* | 1351 | /* |
1357 | * OK, we are remounting a valid rw partition rdonly, so set | 1352 | * OK, we are remounting a valid rw partition rdonly, so set |
@@ -1362,22 +1357,20 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) | |||
1362 | spin_unlock(&sbi->s_lock); | 1357 | spin_unlock(&sbi->s_lock); |
1363 | 1358 | ||
1364 | err = dquot_suspend(sb, -1); | 1359 | err = dquot_suspend(sb, -1); |
1365 | if (err < 0) { | 1360 | if (err < 0) |
1366 | spin_lock(&sbi->s_lock); | 1361 | return err; |
1367 | goto restore_opts; | ||
1368 | } | ||
1369 | 1362 | ||
1370 | ext2_sync_super(sb, es, 1); | 1363 | ext2_sync_super(sb, es, 1); |
1371 | } else { | 1364 | } else { |
1372 | __le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb, | 1365 | __le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb, |
1373 | ~EXT2_FEATURE_RO_COMPAT_SUPP); | 1366 | ~EXT2_FEATURE_RO_COMPAT_SUPP); |
1374 | if (ret) { | 1367 | if (ret) { |
1368 | spin_unlock(&sbi->s_lock); | ||
1375 | ext2_msg(sb, KERN_WARNING, | 1369 | ext2_msg(sb, KERN_WARNING, |
1376 | "warning: couldn't remount RDWR because of " | 1370 | "warning: couldn't remount RDWR because of " |
1377 | "unsupported optional features (%x).", | 1371 | "unsupported optional features (%x).", |
1378 | le32_to_cpu(ret)); | 1372 | le32_to_cpu(ret)); |
1379 | err = -EROFS; | 1373 | return -EROFS; |
1380 | goto restore_opts; | ||
1381 | } | 1374 | } |
1382 | /* | 1375 | /* |
1383 | * Mounting a RDONLY partition read-write, so reread and | 1376 | * Mounting a RDONLY partition read-write, so reread and |
@@ -1394,14 +1387,16 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) | |||
1394 | dquot_resume(sb, -1); | 1387 | dquot_resume(sb, -1); |
1395 | } | 1388 | } |
1396 | 1389 | ||
1397 | return 0; | 1390 | spin_lock(&sbi->s_lock); |
1398 | restore_opts: | 1391 | out_set: |
1399 | sbi->s_mount_opt = old_opts.s_mount_opt; | 1392 | sbi->s_mount_opt = new_opts.s_mount_opt; |
1400 | sbi->s_resuid = old_opts.s_resuid; | 1393 | sbi->s_resuid = new_opts.s_resuid; |
1401 | sbi->s_resgid = old_opts.s_resgid; | 1394 | sbi->s_resgid = new_opts.s_resgid; |
1402 | sb->s_flags = old_sb_flags; | 1395 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | |
1396 | ((sbi->s_mount_opt & EXT2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); | ||
1403 | spin_unlock(&sbi->s_lock); | 1397 | spin_unlock(&sbi->s_lock); |
1404 | return err; | 1398 | |
1399 | return 0; | ||
1405 | } | 1400 | } |
1406 | 1401 | ||
1407 | static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf) | 1402 | static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf) |
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h index 57d4c3e2e94a..055ec6c586f7 100644 --- a/fs/isofs/isofs.h +++ b/fs/isofs/isofs.h | |||
@@ -73,41 +73,41 @@ static inline struct iso_inode_info *ISOFS_I(struct inode *inode) | |||
73 | return container_of(inode, struct iso_inode_info, vfs_inode); | 73 | return container_of(inode, struct iso_inode_info, vfs_inode); |
74 | } | 74 | } |
75 | 75 | ||
76 | static inline int isonum_711(char *p) | 76 | static inline int isonum_711(u8 *p) |
77 | { | 77 | { |
78 | return *(u8 *)p; | 78 | return *p; |
79 | } | 79 | } |
80 | static inline int isonum_712(char *p) | 80 | static inline int isonum_712(s8 *p) |
81 | { | 81 | { |
82 | return *(s8 *)p; | 82 | return *p; |
83 | } | 83 | } |
84 | static inline unsigned int isonum_721(char *p) | 84 | static inline unsigned int isonum_721(u8 *p) |
85 | { | 85 | { |
86 | return get_unaligned_le16(p); | 86 | return get_unaligned_le16(p); |
87 | } | 87 | } |
88 | static inline unsigned int isonum_722(char *p) | 88 | static inline unsigned int isonum_722(u8 *p) |
89 | { | 89 | { |
90 | return get_unaligned_be16(p); | 90 | return get_unaligned_be16(p); |
91 | } | 91 | } |
92 | static inline unsigned int isonum_723(char *p) | 92 | static inline unsigned int isonum_723(u8 *p) |
93 | { | 93 | { |
94 | /* Ignore bigendian datum due to broken mastering programs */ | 94 | /* Ignore bigendian datum due to broken mastering programs */ |
95 | return get_unaligned_le16(p); | 95 | return get_unaligned_le16(p); |
96 | } | 96 | } |
97 | static inline unsigned int isonum_731(char *p) | 97 | static inline unsigned int isonum_731(u8 *p) |
98 | { | 98 | { |
99 | return get_unaligned_le32(p); | 99 | return get_unaligned_le32(p); |
100 | } | 100 | } |
101 | static inline unsigned int isonum_732(char *p) | 101 | static inline unsigned int isonum_732(u8 *p) |
102 | { | 102 | { |
103 | return get_unaligned_be32(p); | 103 | return get_unaligned_be32(p); |
104 | } | 104 | } |
105 | static inline unsigned int isonum_733(char *p) | 105 | static inline unsigned int isonum_733(u8 *p) |
106 | { | 106 | { |
107 | /* Ignore bigendian datum due to broken mastering programs */ | 107 | /* Ignore bigendian datum due to broken mastering programs */ |
108 | return get_unaligned_le32(p); | 108 | return get_unaligned_le32(p); |
109 | } | 109 | } |
110 | extern int iso_date(char *, int); | 110 | extern int iso_date(u8 *, int); |
111 | 111 | ||
112 | struct inode; /* To make gcc happy */ | 112 | struct inode; /* To make gcc happy */ |
113 | 113 | ||
diff --git a/fs/isofs/rock.h b/fs/isofs/rock.h index ef03625431bb..1558cf22ef8a 100644 --- a/fs/isofs/rock.h +++ b/fs/isofs/rock.h | |||
@@ -7,78 +7,78 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | struct SU_SP_s { | 9 | struct SU_SP_s { |
10 | unsigned char magic[2]; | 10 | __u8 magic[2]; |
11 | unsigned char skip; | 11 | __u8 skip; |
12 | } __attribute__ ((packed)); | 12 | } __attribute__ ((packed)); |
13 | 13 | ||
14 | struct SU_CE_s { | 14 | struct SU_CE_s { |
15 | char extent[8]; | 15 | __u8 extent[8]; |
16 | char offset[8]; | 16 | __u8 offset[8]; |
17 | char size[8]; | 17 | __u8 size[8]; |
18 | }; | 18 | }; |
19 | 19 | ||
20 | struct SU_ER_s { | 20 | struct SU_ER_s { |
21 | unsigned char len_id; | 21 | __u8 len_id; |
22 | unsigned char len_des; | 22 | __u8 len_des; |
23 | unsigned char len_src; | 23 | __u8 len_src; |
24 | unsigned char ext_ver; | 24 | __u8 ext_ver; |
25 | char data[0]; | 25 | __u8 data[0]; |
26 | } __attribute__ ((packed)); | 26 | } __attribute__ ((packed)); |
27 | 27 | ||
28 | struct RR_RR_s { | 28 | struct RR_RR_s { |
29 | char flags[1]; | 29 | __u8 flags[1]; |
30 | } __attribute__ ((packed)); | 30 | } __attribute__ ((packed)); |
31 | 31 | ||
32 | struct RR_PX_s { | 32 | struct RR_PX_s { |
33 | char mode[8]; | 33 | __u8 mode[8]; |
34 | char n_links[8]; | 34 | __u8 n_links[8]; |
35 | char uid[8]; | 35 | __u8 uid[8]; |
36 | char gid[8]; | 36 | __u8 gid[8]; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | struct RR_PN_s { | 39 | struct RR_PN_s { |
40 | char dev_high[8]; | 40 | __u8 dev_high[8]; |
41 | char dev_low[8]; | 41 | __u8 dev_low[8]; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | struct SL_component { | 44 | struct SL_component { |
45 | unsigned char flags; | 45 | __u8 flags; |
46 | unsigned char len; | 46 | __u8 len; |
47 | char text[0]; | 47 | __u8 text[0]; |
48 | } __attribute__ ((packed)); | 48 | } __attribute__ ((packed)); |
49 | 49 | ||
50 | struct RR_SL_s { | 50 | struct RR_SL_s { |
51 | unsigned char flags; | 51 | __u8 flags; |
52 | struct SL_component link; | 52 | struct SL_component link; |
53 | } __attribute__ ((packed)); | 53 | } __attribute__ ((packed)); |
54 | 54 | ||
55 | struct RR_NM_s { | 55 | struct RR_NM_s { |
56 | unsigned char flags; | 56 | __u8 flags; |
57 | char name[0]; | 57 | char name[0]; |
58 | } __attribute__ ((packed)); | 58 | } __attribute__ ((packed)); |
59 | 59 | ||
60 | struct RR_CL_s { | 60 | struct RR_CL_s { |
61 | char location[8]; | 61 | __u8 location[8]; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | struct RR_PL_s { | 64 | struct RR_PL_s { |
65 | char location[8]; | 65 | __u8 location[8]; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct stamp { | 68 | struct stamp { |
69 | char time[7]; | 69 | __u8 time[7]; /* actually 6 unsigned, 1 signed */ |
70 | } __attribute__ ((packed)); | 70 | } __attribute__ ((packed)); |
71 | 71 | ||
72 | struct RR_TF_s { | 72 | struct RR_TF_s { |
73 | char flags; | 73 | __u8 flags; |
74 | struct stamp times[0]; /* Variable number of these beasts */ | 74 | struct stamp times[0]; /* Variable number of these beasts */ |
75 | } __attribute__ ((packed)); | 75 | } __attribute__ ((packed)); |
76 | 76 | ||
77 | /* Linux-specific extension for transparent decompression */ | 77 | /* Linux-specific extension for transparent decompression */ |
78 | struct RR_ZF_s { | 78 | struct RR_ZF_s { |
79 | char algorithm[2]; | 79 | __u8 algorithm[2]; |
80 | char parms[2]; | 80 | __u8 parms[2]; |
81 | char real_size[8]; | 81 | __u8 real_size[8]; |
82 | }; | 82 | }; |
83 | 83 | ||
84 | /* | 84 | /* |
@@ -94,9 +94,9 @@ struct RR_ZF_s { | |||
94 | #define TF_LONG_FORM 128 | 94 | #define TF_LONG_FORM 128 |
95 | 95 | ||
96 | struct rock_ridge { | 96 | struct rock_ridge { |
97 | char signature[2]; | 97 | __u8 signature[2]; |
98 | unsigned char len; | 98 | __u8 len; |
99 | unsigned char version; | 99 | __u8 version; |
100 | union { | 100 | union { |
101 | struct SU_SP_s SP; | 101 | struct SU_SP_s SP; |
102 | struct SU_CE_s CE; | 102 | struct SU_CE_s CE; |
diff --git a/fs/isofs/util.c b/fs/isofs/util.c index 42544bf0e222..e88dba721661 100644 --- a/fs/isofs/util.c +++ b/fs/isofs/util.c | |||
@@ -16,7 +16,7 @@ | |||
16 | * to GMT. Thus we should always be correct. | 16 | * to GMT. Thus we should always be correct. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | int iso_date(char * p, int flag) | 19 | int iso_date(u8 *p, int flag) |
20 | { | 20 | { |
21 | int year, month, day, hour, minute, second, tz; | 21 | int year, month, day, hour, minute, second, tz; |
22 | int crtime; | 22 | int crtime; |
diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index 54cf2d21b547..6702a6a0bbb5 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/sched/user.h> | 10 | #include <linux/sched/user.h> |
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/wait.h> | 12 | #include <linux/wait.h> |
13 | #include <linux/audit.h> | ||
13 | 14 | ||
14 | #include "fanotify.h" | 15 | #include "fanotify.h" |
15 | 16 | ||
@@ -65,7 +66,7 @@ static int fanotify_get_response(struct fsnotify_group *group, | |||
65 | wait_event(group->fanotify_data.access_waitq, event->response); | 66 | wait_event(group->fanotify_data.access_waitq, event->response); |
66 | 67 | ||
67 | /* userspace responded, convert to something usable */ | 68 | /* userspace responded, convert to something usable */ |
68 | switch (event->response) { | 69 | switch (event->response & ~FAN_AUDIT) { |
69 | case FAN_ALLOW: | 70 | case FAN_ALLOW: |
70 | ret = 0; | 71 | ret = 0; |
71 | break; | 72 | break; |
@@ -73,6 +74,11 @@ static int fanotify_get_response(struct fsnotify_group *group, | |||
73 | default: | 74 | default: |
74 | ret = -EPERM; | 75 | ret = -EPERM; |
75 | } | 76 | } |
77 | |||
78 | /* Check if the response should be audited */ | ||
79 | if (event->response & FAN_AUDIT) | ||
80 | audit_fanotify(event->response & ~FAN_AUDIT); | ||
81 | |||
76 | event->response = 0; | 82 | event->response = 0; |
77 | 83 | ||
78 | pr_debug("%s: group=%p event=%p about to return ret=%d\n", __func__, | 84 | pr_debug("%s: group=%p event=%p about to return ret=%d\n", __func__, |
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index 55499f5a1c96..d0d4bc4c4b70 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
@@ -179,7 +179,7 @@ static int process_access_response(struct fsnotify_group *group, | |||
179 | * userspace can send a valid response or we will clean it up after the | 179 | * userspace can send a valid response or we will clean it up after the |
180 | * timeout | 180 | * timeout |
181 | */ | 181 | */ |
182 | switch (response) { | 182 | switch (response & ~FAN_AUDIT) { |
183 | case FAN_ALLOW: | 183 | case FAN_ALLOW: |
184 | case FAN_DENY: | 184 | case FAN_DENY: |
185 | break; | 185 | break; |
@@ -190,6 +190,9 @@ static int process_access_response(struct fsnotify_group *group, | |||
190 | if (fd < 0) | 190 | if (fd < 0) |
191 | return -EINVAL; | 191 | return -EINVAL; |
192 | 192 | ||
193 | if ((response & FAN_AUDIT) && !group->fanotify_data.audit) | ||
194 | return -EINVAL; | ||
195 | |||
193 | event = dequeue_event(group, fd); | 196 | event = dequeue_event(group, fd); |
194 | if (!event) | 197 | if (!event) |
195 | return -ENOENT; | 198 | return -ENOENT; |
@@ -713,7 +716,11 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags) | |||
713 | if (!capable(CAP_SYS_ADMIN)) | 716 | if (!capable(CAP_SYS_ADMIN)) |
714 | return -EPERM; | 717 | return -EPERM; |
715 | 718 | ||
719 | #ifdef CONFIG_AUDITSYSCALL | ||
720 | if (flags & ~(FAN_ALL_INIT_FLAGS | FAN_ENABLE_AUDIT)) | ||
721 | #else | ||
716 | if (flags & ~FAN_ALL_INIT_FLAGS) | 722 | if (flags & ~FAN_ALL_INIT_FLAGS) |
723 | #endif | ||
717 | return -EINVAL; | 724 | return -EINVAL; |
718 | 725 | ||
719 | if (event_f_flags & ~FANOTIFY_INIT_ALL_EVENT_F_BITS) | 726 | if (event_f_flags & ~FANOTIFY_INIT_ALL_EVENT_F_BITS) |
@@ -795,6 +802,13 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags) | |||
795 | group->fanotify_data.max_marks = FANOTIFY_DEFAULT_MAX_MARKS; | 802 | group->fanotify_data.max_marks = FANOTIFY_DEFAULT_MAX_MARKS; |
796 | } | 803 | } |
797 | 804 | ||
805 | if (flags & FAN_ENABLE_AUDIT) { | ||
806 | fd = -EPERM; | ||
807 | if (!capable(CAP_AUDIT_WRITE)) | ||
808 | goto out_destroy_group; | ||
809 | group->fanotify_data.audit = true; | ||
810 | } | ||
811 | |||
798 | fd = anon_inode_getfd("[fanotify]", &fanotify_fops, group, f_flags); | 812 | fd = anon_inode_getfd("[fanotify]", &fanotify_fops, group, f_flags); |
799 | if (fd < 0) | 813 | if (fd < 0) |
800 | goto out_destroy_group; | 814 | goto out_destroy_group; |
diff --git a/fs/notify/fdinfo.c b/fs/notify/fdinfo.c index 517f88c1dbe5..d478629c728b 100644 --- a/fs/notify/fdinfo.c +++ b/fs/notify/fdinfo.c | |||
@@ -157,6 +157,9 @@ void fanotify_show_fdinfo(struct seq_file *m, struct file *f) | |||
157 | if (group->fanotify_data.max_marks == UINT_MAX) | 157 | if (group->fanotify_data.max_marks == UINT_MAX) |
158 | flags |= FAN_UNLIMITED_MARKS; | 158 | flags |= FAN_UNLIMITED_MARKS; |
159 | 159 | ||
160 | if (group->fanotify_data.audit) | ||
161 | flags |= FAN_ENABLE_AUDIT; | ||
162 | |||
160 | seq_printf(m, "fanotify flags:%x event-flags:%x\n", | 163 | seq_printf(m, "fanotify flags:%x event-flags:%x\n", |
161 | flags, group->fanotify_data.f_flags); | 164 | flags, group->fanotify_data.f_flags); |
162 | 165 | ||
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 9f78b5015f2e..39f1b0b0c76f 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -645,8 +645,15 @@ int dquot_writeback_dquots(struct super_block *sb, int type) | |||
645 | spin_unlock(&dq_list_lock); | 645 | spin_unlock(&dq_list_lock); |
646 | dqstats_inc(DQST_LOOKUPS); | 646 | dqstats_inc(DQST_LOOKUPS); |
647 | err = sb->dq_op->write_dquot(dquot); | 647 | err = sb->dq_op->write_dquot(dquot); |
648 | if (!ret && err) | 648 | if (err) { |
649 | ret = err; | 649 | /* |
650 | * Clear dirty bit anyway to avoid infinite | ||
651 | * loop here. | ||
652 | */ | ||
653 | clear_dquot_dirty(dquot); | ||
654 | if (!ret) | ||
655 | ret = err; | ||
656 | } | ||
650 | dqput(dquot); | 657 | dqput(dquot); |
651 | spin_lock(&dq_list_lock); | 658 | spin_lock(&dq_list_lock); |
652 | } | 659 | } |
@@ -2139,7 +2146,7 @@ int dquot_file_open(struct inode *inode, struct file *file) | |||
2139 | 2146 | ||
2140 | error = generic_file_open(inode, file); | 2147 | error = generic_file_open(inode, file); |
2141 | if (!error && (file->f_mode & FMODE_WRITE)) | 2148 | if (!error && (file->f_mode & FMODE_WRITE)) |
2142 | dquot_initialize(inode); | 2149 | error = dquot_initialize(inode); |
2143 | return error; | 2150 | return error; |
2144 | } | 2151 | } |
2145 | EXPORT_SYMBOL(dquot_file_open); | 2152 | EXPORT_SYMBOL(dquot_file_open); |
diff --git a/fs/udf/balloc.c b/fs/udf/balloc.c index e0fd65fe73e8..1b961b1d9699 100644 --- a/fs/udf/balloc.c +++ b/fs/udf/balloc.c | |||
@@ -58,7 +58,7 @@ static int __load_block_bitmap(struct super_block *sb, | |||
58 | int nr_groups = bitmap->s_nr_groups; | 58 | int nr_groups = bitmap->s_nr_groups; |
59 | 59 | ||
60 | if (block_group >= nr_groups) { | 60 | if (block_group >= nr_groups) { |
61 | udf_debug("block_group (%d) > nr_groups (%d)\n", | 61 | udf_debug("block_group (%u) > nr_groups (%d)\n", |
62 | block_group, nr_groups); | 62 | block_group, nr_groups); |
63 | } | 63 | } |
64 | 64 | ||
@@ -122,7 +122,7 @@ static void udf_bitmap_free_blocks(struct super_block *sb, | |||
122 | partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; | 122 | partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; |
123 | if (bloc->logicalBlockNum + count < count || | 123 | if (bloc->logicalBlockNum + count < count || |
124 | (bloc->logicalBlockNum + count) > partmap->s_partition_len) { | 124 | (bloc->logicalBlockNum + count) > partmap->s_partition_len) { |
125 | udf_debug("%d < %d || %d + %d > %d\n", | 125 | udf_debug("%u < %d || %u + %u > %u\n", |
126 | bloc->logicalBlockNum, 0, | 126 | bloc->logicalBlockNum, 0, |
127 | bloc->logicalBlockNum, count, | 127 | bloc->logicalBlockNum, count, |
128 | partmap->s_partition_len); | 128 | partmap->s_partition_len); |
@@ -151,9 +151,9 @@ static void udf_bitmap_free_blocks(struct super_block *sb, | |||
151 | bh = bitmap->s_block_bitmap[bitmap_nr]; | 151 | bh = bitmap->s_block_bitmap[bitmap_nr]; |
152 | for (i = 0; i < count; i++) { | 152 | for (i = 0; i < count; i++) { |
153 | if (udf_set_bit(bit + i, bh->b_data)) { | 153 | if (udf_set_bit(bit + i, bh->b_data)) { |
154 | udf_debug("bit %ld already set\n", bit + i); | 154 | udf_debug("bit %lu already set\n", bit + i); |
155 | udf_debug("byte=%2x\n", | 155 | udf_debug("byte=%2x\n", |
156 | ((char *)bh->b_data)[(bit + i) >> 3]); | 156 | ((__u8 *)bh->b_data)[(bit + i) >> 3]); |
157 | } | 157 | } |
158 | } | 158 | } |
159 | udf_add_free_space(sb, sbi->s_partition, count); | 159 | udf_add_free_space(sb, sbi->s_partition, count); |
@@ -218,16 +218,18 @@ out: | |||
218 | return alloc_count; | 218 | return alloc_count; |
219 | } | 219 | } |
220 | 220 | ||
221 | static int udf_bitmap_new_block(struct super_block *sb, | 221 | static udf_pblk_t udf_bitmap_new_block(struct super_block *sb, |
222 | struct udf_bitmap *bitmap, uint16_t partition, | 222 | struct udf_bitmap *bitmap, uint16_t partition, |
223 | uint32_t goal, int *err) | 223 | uint32_t goal, int *err) |
224 | { | 224 | { |
225 | struct udf_sb_info *sbi = UDF_SB(sb); | 225 | struct udf_sb_info *sbi = UDF_SB(sb); |
226 | int newbit, bit = 0, block, block_group, group_start; | 226 | int newbit, bit = 0; |
227 | udf_pblk_t block; | ||
228 | int block_group, group_start; | ||
227 | int end_goal, nr_groups, bitmap_nr, i; | 229 | int end_goal, nr_groups, bitmap_nr, i; |
228 | struct buffer_head *bh = NULL; | 230 | struct buffer_head *bh = NULL; |
229 | char *ptr; | 231 | char *ptr; |
230 | int newblock = 0; | 232 | udf_pblk_t newblock = 0; |
231 | 233 | ||
232 | *err = -ENOSPC; | 234 | *err = -ENOSPC; |
233 | mutex_lock(&sbi->s_alloc_mutex); | 235 | mutex_lock(&sbi->s_alloc_mutex); |
@@ -362,7 +364,7 @@ static void udf_table_free_blocks(struct super_block *sb, | |||
362 | partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; | 364 | partmap = &sbi->s_partmaps[bloc->partitionReferenceNum]; |
363 | if (bloc->logicalBlockNum + count < count || | 365 | if (bloc->logicalBlockNum + count < count || |
364 | (bloc->logicalBlockNum + count) > partmap->s_partition_len) { | 366 | (bloc->logicalBlockNum + count) > partmap->s_partition_len) { |
365 | udf_debug("%d < %d || %d + %d > %d\n", | 367 | udf_debug("%u < %d || %u + %u > %u\n", |
366 | bloc->logicalBlockNum, 0, | 368 | bloc->logicalBlockNum, 0, |
367 | bloc->logicalBlockNum, count, | 369 | bloc->logicalBlockNum, count, |
368 | partmap->s_partition_len); | 370 | partmap->s_partition_len); |
@@ -515,7 +517,7 @@ static int udf_table_prealloc_blocks(struct super_block *sb, | |||
515 | 517 | ||
516 | while (first_block != eloc.logicalBlockNum && | 518 | while (first_block != eloc.logicalBlockNum && |
517 | (etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) { | 519 | (etype = udf_next_aext(table, &epos, &eloc, &elen, 1)) != -1) { |
518 | udf_debug("eloc=%d, elen=%d, first_block=%d\n", | 520 | udf_debug("eloc=%u, elen=%u, first_block=%u\n", |
519 | eloc.logicalBlockNum, elen, first_block); | 521 | eloc.logicalBlockNum, elen, first_block); |
520 | ; /* empty loop body */ | 522 | ; /* empty loop body */ |
521 | } | 523 | } |
@@ -545,13 +547,14 @@ static int udf_table_prealloc_blocks(struct super_block *sb, | |||
545 | return alloc_count; | 547 | return alloc_count; |
546 | } | 548 | } |
547 | 549 | ||
548 | static int udf_table_new_block(struct super_block *sb, | 550 | static udf_pblk_t udf_table_new_block(struct super_block *sb, |
549 | struct inode *table, uint16_t partition, | 551 | struct inode *table, uint16_t partition, |
550 | uint32_t goal, int *err) | 552 | uint32_t goal, int *err) |
551 | { | 553 | { |
552 | struct udf_sb_info *sbi = UDF_SB(sb); | 554 | struct udf_sb_info *sbi = UDF_SB(sb); |
553 | uint32_t spread = 0xFFFFFFFF, nspread = 0xFFFFFFFF; | 555 | uint32_t spread = 0xFFFFFFFF, nspread = 0xFFFFFFFF; |
554 | uint32_t newblock = 0, adsize; | 556 | udf_pblk_t newblock = 0; |
557 | uint32_t adsize; | ||
555 | uint32_t elen, goal_elen = 0; | 558 | uint32_t elen, goal_elen = 0; |
556 | struct kernel_lb_addr eloc, uninitialized_var(goal_eloc); | 559 | struct kernel_lb_addr eloc, uninitialized_var(goal_eloc); |
557 | struct extent_position epos, goal_epos; | 560 | struct extent_position epos, goal_epos; |
@@ -700,12 +703,12 @@ inline int udf_prealloc_blocks(struct super_block *sb, | |||
700 | return allocated; | 703 | return allocated; |
701 | } | 704 | } |
702 | 705 | ||
703 | inline int udf_new_block(struct super_block *sb, | 706 | inline udf_pblk_t udf_new_block(struct super_block *sb, |
704 | struct inode *inode, | 707 | struct inode *inode, |
705 | uint16_t partition, uint32_t goal, int *err) | 708 | uint16_t partition, uint32_t goal, int *err) |
706 | { | 709 | { |
707 | struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition]; | 710 | struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition]; |
708 | int block; | 711 | udf_pblk_t block; |
709 | 712 | ||
710 | if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP) | 713 | if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP) |
711 | block = udf_bitmap_new_block(sb, | 714 | block = udf_bitmap_new_block(sb, |
diff --git a/fs/udf/dir.c b/fs/udf/dir.c index 2d0e028067eb..c19dba45aa20 100644 --- a/fs/udf/dir.c +++ b/fs/udf/dir.c | |||
@@ -43,7 +43,7 @@ static int udf_readdir(struct file *file, struct dir_context *ctx) | |||
43 | struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL}; | 43 | struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL}; |
44 | struct fileIdentDesc *fi = NULL; | 44 | struct fileIdentDesc *fi = NULL; |
45 | struct fileIdentDesc cfi; | 45 | struct fileIdentDesc cfi; |
46 | int block, iblock; | 46 | udf_pblk_t block, iblock; |
47 | loff_t nf_pos; | 47 | loff_t nf_pos; |
48 | int flen; | 48 | int flen; |
49 | unsigned char *fname = NULL, *copy_name = NULL; | 49 | unsigned char *fname = NULL, *copy_name = NULL; |
diff --git a/fs/udf/directory.c b/fs/udf/directory.c index 7aa48bd7cbaf..0a98a2369738 100644 --- a/fs/udf/directory.c +++ b/fs/udf/directory.c | |||
@@ -26,7 +26,8 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos, | |||
26 | sector_t *offset) | 26 | sector_t *offset) |
27 | { | 27 | { |
28 | struct fileIdentDesc *fi; | 28 | struct fileIdentDesc *fi; |
29 | int i, num, block; | 29 | int i, num; |
30 | udf_pblk_t block; | ||
30 | struct buffer_head *tmp, *bha[16]; | 31 | struct buffer_head *tmp, *bha[16]; |
31 | struct udf_inode_info *iinfo = UDF_I(dir); | 32 | struct udf_inode_info *iinfo = UDF_I(dir); |
32 | 33 | ||
@@ -51,7 +52,7 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos, | |||
51 | } | 52 | } |
52 | 53 | ||
53 | if (fibh->eoffset == dir->i_sb->s_blocksize) { | 54 | if (fibh->eoffset == dir->i_sb->s_blocksize) { |
54 | int lextoffset = epos->offset; | 55 | uint32_t lextoffset = epos->offset; |
55 | unsigned char blocksize_bits = dir->i_sb->s_blocksize_bits; | 56 | unsigned char blocksize_bits = dir->i_sb->s_blocksize_bits; |
56 | 57 | ||
57 | if (udf_next_aext(dir, epos, eloc, elen, 1) != | 58 | if (udf_next_aext(dir, epos, eloc, elen, 1) != |
@@ -110,7 +111,7 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos, | |||
110 | memcpy((uint8_t *)cfi, (uint8_t *)fi, | 111 | memcpy((uint8_t *)cfi, (uint8_t *)fi, |
111 | sizeof(struct fileIdentDesc)); | 112 | sizeof(struct fileIdentDesc)); |
112 | } else if (fibh->eoffset > dir->i_sb->s_blocksize) { | 113 | } else if (fibh->eoffset > dir->i_sb->s_blocksize) { |
113 | int lextoffset = epos->offset; | 114 | uint32_t lextoffset = epos->offset; |
114 | 115 | ||
115 | if (udf_next_aext(dir, epos, eloc, elen, 1) != | 116 | if (udf_next_aext(dir, epos, eloc, elen, 1) != |
116 | (EXT_RECORDED_ALLOCATED >> 30)) | 117 | (EXT_RECORDED_ALLOCATED >> 30)) |
@@ -175,7 +176,7 @@ struct fileIdentDesc *udf_get_fileident(void *buffer, int bufsize, int *offset) | |||
175 | if (fi->descTag.tagIdent != cpu_to_le16(TAG_IDENT_FID)) { | 176 | if (fi->descTag.tagIdent != cpu_to_le16(TAG_IDENT_FID)) { |
176 | udf_debug("0x%x != TAG_IDENT_FID\n", | 177 | udf_debug("0x%x != TAG_IDENT_FID\n", |
177 | le16_to_cpu(fi->descTag.tagIdent)); | 178 | le16_to_cpu(fi->descTag.tagIdent)); |
178 | udf_debug("offset: %u sizeof: %lu bufsize: %u\n", | 179 | udf_debug("offset: %d sizeof: %lu bufsize: %d\n", |
179 | *offset, (unsigned long)sizeof(struct fileIdentDesc), | 180 | *offset, (unsigned long)sizeof(struct fileIdentDesc), |
180 | bufsize); | 181 | bufsize); |
181 | return NULL; | 182 | return NULL; |
diff --git a/fs/udf/ialloc.c b/fs/udf/ialloc.c index c1ed18a10ce4..b6e420c1bfeb 100644 --- a/fs/udf/ialloc.c +++ b/fs/udf/ialloc.c | |||
@@ -50,7 +50,7 @@ struct inode *udf_new_inode(struct inode *dir, umode_t mode) | |||
50 | struct super_block *sb = dir->i_sb; | 50 | struct super_block *sb = dir->i_sb; |
51 | struct udf_sb_info *sbi = UDF_SB(sb); | 51 | struct udf_sb_info *sbi = UDF_SB(sb); |
52 | struct inode *inode; | 52 | struct inode *inode; |
53 | int block; | 53 | udf_pblk_t block; |
54 | uint32_t start = UDF_I(dir)->i_location.logicalBlockNum; | 54 | uint32_t start = UDF_I(dir)->i_location.logicalBlockNum; |
55 | struct udf_inode_info *iinfo; | 55 | struct udf_inode_info *iinfo; |
56 | struct udf_inode_info *dinfo = UDF_I(dir); | 56 | struct udf_inode_info *dinfo = UDF_I(dir); |
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 8dacf4f57414..c23744d5ae5c 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c | |||
@@ -52,7 +52,7 @@ static int udf_alloc_i_data(struct inode *inode, size_t size); | |||
52 | static sector_t inode_getblk(struct inode *, sector_t, int *, int *); | 52 | static sector_t inode_getblk(struct inode *, sector_t, int *, int *); |
53 | static int8_t udf_insert_aext(struct inode *, struct extent_position, | 53 | static int8_t udf_insert_aext(struct inode *, struct extent_position, |
54 | struct kernel_lb_addr, uint32_t); | 54 | struct kernel_lb_addr, uint32_t); |
55 | static void udf_split_extents(struct inode *, int *, int, int, | 55 | static void udf_split_extents(struct inode *, int *, int, udf_pblk_t, |
56 | struct kernel_long_ad *, int *); | 56 | struct kernel_long_ad *, int *); |
57 | static void udf_prealloc_extents(struct inode *, int, int, | 57 | static void udf_prealloc_extents(struct inode *, int, int, |
58 | struct kernel_long_ad *, int *); | 58 | struct kernel_long_ad *, int *); |
@@ -316,10 +316,10 @@ int udf_expand_file_adinicb(struct inode *inode) | |||
316 | return err; | 316 | return err; |
317 | } | 317 | } |
318 | 318 | ||
319 | struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, int *block, | 319 | struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, |
320 | int *err) | 320 | udf_pblk_t *block, int *err) |
321 | { | 321 | { |
322 | int newblock; | 322 | udf_pblk_t newblock; |
323 | struct buffer_head *dbh = NULL; | 323 | struct buffer_head *dbh = NULL; |
324 | struct kernel_lb_addr eloc; | 324 | struct kernel_lb_addr eloc; |
325 | uint8_t alloctype; | 325 | uint8_t alloctype; |
@@ -446,7 +446,7 @@ abort: | |||
446 | return err; | 446 | return err; |
447 | } | 447 | } |
448 | 448 | ||
449 | static struct buffer_head *udf_getblk(struct inode *inode, long block, | 449 | static struct buffer_head *udf_getblk(struct inode *inode, udf_pblk_t block, |
450 | int create, int *err) | 450 | int create, int *err) |
451 | { | 451 | { |
452 | struct buffer_head *bh; | 452 | struct buffer_head *bh; |
@@ -480,7 +480,7 @@ static int udf_do_extend_file(struct inode *inode, | |||
480 | int count = 0, fake = !(last_ext->extLength & UDF_EXTENT_LENGTH_MASK); | 480 | int count = 0, fake = !(last_ext->extLength & UDF_EXTENT_LENGTH_MASK); |
481 | struct super_block *sb = inode->i_sb; | 481 | struct super_block *sb = inode->i_sb; |
482 | struct kernel_lb_addr prealloc_loc = {}; | 482 | struct kernel_lb_addr prealloc_loc = {}; |
483 | int prealloc_len = 0; | 483 | uint32_t prealloc_len = 0; |
484 | struct udf_inode_info *iinfo; | 484 | struct udf_inode_info *iinfo; |
485 | int err; | 485 | int err; |
486 | 486 | ||
@@ -663,11 +663,11 @@ static sector_t inode_getblk(struct inode *inode, sector_t block, | |||
663 | struct kernel_lb_addr eloc, tmpeloc; | 663 | struct kernel_lb_addr eloc, tmpeloc; |
664 | int c = 1; | 664 | int c = 1; |
665 | loff_t lbcount = 0, b_off = 0; | 665 | loff_t lbcount = 0, b_off = 0; |
666 | uint32_t newblocknum, newblock; | 666 | udf_pblk_t newblocknum, newblock; |
667 | sector_t offset = 0; | 667 | sector_t offset = 0; |
668 | int8_t etype; | 668 | int8_t etype; |
669 | struct udf_inode_info *iinfo = UDF_I(inode); | 669 | struct udf_inode_info *iinfo = UDF_I(inode); |
670 | int goal = 0, pgoal = iinfo->i_location.logicalBlockNum; | 670 | udf_pblk_t goal = 0, pgoal = iinfo->i_location.logicalBlockNum; |
671 | int lastblock = 0; | 671 | int lastblock = 0; |
672 | bool isBeyondEOF; | 672 | bool isBeyondEOF; |
673 | 673 | ||
@@ -879,8 +879,8 @@ out_free: | |||
879 | } | 879 | } |
880 | 880 | ||
881 | static void udf_split_extents(struct inode *inode, int *c, int offset, | 881 | static void udf_split_extents(struct inode *inode, int *c, int offset, |
882 | int newblocknum, struct kernel_long_ad *laarr, | 882 | udf_pblk_t newblocknum, |
883 | int *endnum) | 883 | struct kernel_long_ad *laarr, int *endnum) |
884 | { | 884 | { |
885 | unsigned long blocksize = inode->i_sb->s_blocksize; | 885 | unsigned long blocksize = inode->i_sb->s_blocksize; |
886 | unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; | 886 | unsigned char blocksize_bits = inode->i_sb->s_blocksize_bits; |
@@ -1166,7 +1166,7 @@ static void udf_update_extents(struct inode *inode, struct kernel_long_ad *laarr | |||
1166 | } | 1166 | } |
1167 | } | 1167 | } |
1168 | 1168 | ||
1169 | struct buffer_head *udf_bread(struct inode *inode, int block, | 1169 | struct buffer_head *udf_bread(struct inode *inode, udf_pblk_t block, |
1170 | int create, int *err) | 1170 | int create, int *err) |
1171 | { | 1171 | { |
1172 | struct buffer_head *bh = NULL; | 1172 | struct buffer_head *bh = NULL; |
@@ -1193,7 +1193,7 @@ int udf_setsize(struct inode *inode, loff_t newsize) | |||
1193 | { | 1193 | { |
1194 | int err; | 1194 | int err; |
1195 | struct udf_inode_info *iinfo; | 1195 | struct udf_inode_info *iinfo; |
1196 | int bsize = i_blocksize(inode); | 1196 | unsigned int bsize = i_blocksize(inode); |
1197 | 1197 | ||
1198 | if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || | 1198 | if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || |
1199 | S_ISLNK(inode->i_mode))) | 1199 | S_ISLNK(inode->i_mode))) |
@@ -1278,14 +1278,14 @@ static int udf_read_inode(struct inode *inode, bool hidden_inode) | |||
1278 | 1278 | ||
1279 | reread: | 1279 | reread: |
1280 | if (iloc->partitionReferenceNum >= sbi->s_partitions) { | 1280 | if (iloc->partitionReferenceNum >= sbi->s_partitions) { |
1281 | udf_debug("partition reference: %d > logical volume partitions: %d\n", | 1281 | udf_debug("partition reference: %u > logical volume partitions: %u\n", |
1282 | iloc->partitionReferenceNum, sbi->s_partitions); | 1282 | iloc->partitionReferenceNum, sbi->s_partitions); |
1283 | return -EIO; | 1283 | return -EIO; |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | if (iloc->logicalBlockNum >= | 1286 | if (iloc->logicalBlockNum >= |
1287 | sbi->s_partmaps[iloc->partitionReferenceNum].s_partition_len) { | 1287 | sbi->s_partmaps[iloc->partitionReferenceNum].s_partition_len) { |
1288 | udf_debug("block=%d, partition=%d out of range\n", | 1288 | udf_debug("block=%u, partition=%u out of range\n", |
1289 | iloc->logicalBlockNum, iloc->partitionReferenceNum); | 1289 | iloc->logicalBlockNum, iloc->partitionReferenceNum); |
1290 | return -EIO; | 1290 | return -EIO; |
1291 | } | 1291 | } |
@@ -1304,13 +1304,13 @@ reread: | |||
1304 | */ | 1304 | */ |
1305 | bh = udf_read_ptagged(inode->i_sb, iloc, 0, &ident); | 1305 | bh = udf_read_ptagged(inode->i_sb, iloc, 0, &ident); |
1306 | if (!bh) { | 1306 | if (!bh) { |
1307 | udf_err(inode->i_sb, "(ino %ld) failed !bh\n", inode->i_ino); | 1307 | udf_err(inode->i_sb, "(ino %lu) failed !bh\n", inode->i_ino); |
1308 | return -EIO; | 1308 | return -EIO; |
1309 | } | 1309 | } |
1310 | 1310 | ||
1311 | if (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE && | 1311 | if (ident != TAG_IDENT_FE && ident != TAG_IDENT_EFE && |
1312 | ident != TAG_IDENT_USE) { | 1312 | ident != TAG_IDENT_USE) { |
1313 | udf_err(inode->i_sb, "(ino %ld) failed ident=%d\n", | 1313 | udf_err(inode->i_sb, "(ino %lu) failed ident=%u\n", |
1314 | inode->i_ino, ident); | 1314 | inode->i_ino, ident); |
1315 | goto out; | 1315 | goto out; |
1316 | } | 1316 | } |
@@ -1346,7 +1346,7 @@ reread: | |||
1346 | } | 1346 | } |
1347 | brelse(ibh); | 1347 | brelse(ibh); |
1348 | } else if (fe->icbTag.strategyType != cpu_to_le16(4)) { | 1348 | } else if (fe->icbTag.strategyType != cpu_to_le16(4)) { |
1349 | udf_err(inode->i_sb, "unsupported strategy type: %d\n", | 1349 | udf_err(inode->i_sb, "unsupported strategy type: %u\n", |
1350 | le16_to_cpu(fe->icbTag.strategyType)); | 1350 | le16_to_cpu(fe->icbTag.strategyType)); |
1351 | goto out; | 1351 | goto out; |
1352 | } | 1352 | } |
@@ -1547,7 +1547,7 @@ reread: | |||
1547 | udf_debug("METADATA BITMAP FILE-----\n"); | 1547 | udf_debug("METADATA BITMAP FILE-----\n"); |
1548 | break; | 1548 | break; |
1549 | default: | 1549 | default: |
1550 | udf_err(inode->i_sb, "(ino %ld) failed unknown file type=%d\n", | 1550 | udf_err(inode->i_sb, "(ino %lu) failed unknown file type=%u\n", |
1551 | inode->i_ino, fe->icbTag.fileType); | 1551 | inode->i_ino, fe->icbTag.fileType); |
1552 | goto out; | 1552 | goto out; |
1553 | } | 1553 | } |
@@ -1852,7 +1852,7 @@ struct inode *__udf_iget(struct super_block *sb, struct kernel_lb_addr *ino, | |||
1852 | return inode; | 1852 | return inode; |
1853 | } | 1853 | } |
1854 | 1854 | ||
1855 | int udf_setup_indirect_aext(struct inode *inode, int block, | 1855 | int udf_setup_indirect_aext(struct inode *inode, udf_pblk_t block, |
1856 | struct extent_position *epos) | 1856 | struct extent_position *epos) |
1857 | { | 1857 | { |
1858 | struct super_block *sb = inode->i_sb; | 1858 | struct super_block *sb = inode->i_sb; |
@@ -1994,7 +1994,7 @@ int udf_add_aext(struct inode *inode, struct extent_position *epos, | |||
1994 | 1994 | ||
1995 | if (epos->offset + (2 * adsize) > sb->s_blocksize) { | 1995 | if (epos->offset + (2 * adsize) > sb->s_blocksize) { |
1996 | int err; | 1996 | int err; |
1997 | int new_block; | 1997 | udf_pblk_t new_block; |
1998 | 1998 | ||
1999 | new_block = udf_new_block(sb, NULL, | 1999 | new_block = udf_new_block(sb, NULL, |
2000 | epos->block.partitionReferenceNum, | 2000 | epos->block.partitionReferenceNum, |
@@ -2076,7 +2076,7 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos, | |||
2076 | 2076 | ||
2077 | while ((etype = udf_current_aext(inode, epos, eloc, elen, inc)) == | 2077 | while ((etype = udf_current_aext(inode, epos, eloc, elen, inc)) == |
2078 | (EXT_NEXT_EXTENT_ALLOCDECS >> 30)) { | 2078 | (EXT_NEXT_EXTENT_ALLOCDECS >> 30)) { |
2079 | int block; | 2079 | udf_pblk_t block; |
2080 | 2080 | ||
2081 | if (++indirections > UDF_MAX_INDIR_EXTS) { | 2081 | if (++indirections > UDF_MAX_INDIR_EXTS) { |
2082 | udf_err(inode->i_sb, | 2082 | udf_err(inode->i_sb, |
@@ -2091,7 +2091,7 @@ int8_t udf_next_aext(struct inode *inode, struct extent_position *epos, | |||
2091 | block = udf_get_lb_pblock(inode->i_sb, &epos->block, 0); | 2091 | block = udf_get_lb_pblock(inode->i_sb, &epos->block, 0); |
2092 | epos->bh = udf_tread(inode->i_sb, block); | 2092 | epos->bh = udf_tread(inode->i_sb, block); |
2093 | if (!epos->bh) { | 2093 | if (!epos->bh) { |
2094 | udf_debug("reading block %d failed!\n", block); | 2094 | udf_debug("reading block %u failed!\n", block); |
2095 | return -1; | 2095 | return -1; |
2096 | } | 2096 | } |
2097 | } | 2097 | } |
@@ -2146,7 +2146,7 @@ int8_t udf_current_aext(struct inode *inode, struct extent_position *epos, | |||
2146 | *elen = le32_to_cpu(lad->extLength) & UDF_EXTENT_LENGTH_MASK; | 2146 | *elen = le32_to_cpu(lad->extLength) & UDF_EXTENT_LENGTH_MASK; |
2147 | break; | 2147 | break; |
2148 | default: | 2148 | default: |
2149 | udf_debug("alloc_type = %d unsupported\n", iinfo->i_alloc_type); | 2149 | udf_debug("alloc_type = %u unsupported\n", iinfo->i_alloc_type); |
2150 | return -1; | 2150 | return -1; |
2151 | } | 2151 | } |
2152 | 2152 | ||
@@ -2289,13 +2289,13 @@ int8_t inode_bmap(struct inode *inode, sector_t block, | |||
2289 | return etype; | 2289 | return etype; |
2290 | } | 2290 | } |
2291 | 2291 | ||
2292 | long udf_block_map(struct inode *inode, sector_t block) | 2292 | udf_pblk_t udf_block_map(struct inode *inode, sector_t block) |
2293 | { | 2293 | { |
2294 | struct kernel_lb_addr eloc; | 2294 | struct kernel_lb_addr eloc; |
2295 | uint32_t elen; | 2295 | uint32_t elen; |
2296 | sector_t offset; | 2296 | sector_t offset; |
2297 | struct extent_position epos = {}; | 2297 | struct extent_position epos = {}; |
2298 | int ret; | 2298 | udf_pblk_t ret; |
2299 | 2299 | ||
2300 | down_read(&UDF_I(inode)->i_data_sem); | 2300 | down_read(&UDF_I(inode)->i_data_sem); |
2301 | 2301 | ||
diff --git a/fs/udf/misc.c b/fs/udf/misc.c index 3949c4bec3a3..401e64cde1be 100644 --- a/fs/udf/misc.c +++ b/fs/udf/misc.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include "udf_i.h" | 28 | #include "udf_i.h" |
29 | #include "udf_sb.h" | 29 | #include "udf_sb.h" |
30 | 30 | ||
31 | struct buffer_head *udf_tgetblk(struct super_block *sb, int block) | 31 | struct buffer_head *udf_tgetblk(struct super_block *sb, udf_pblk_t block) |
32 | { | 32 | { |
33 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV)) | 33 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV)) |
34 | return sb_getblk(sb, udf_fixed_to_variable(block)); | 34 | return sb_getblk(sb, udf_fixed_to_variable(block)); |
@@ -36,7 +36,7 @@ struct buffer_head *udf_tgetblk(struct super_block *sb, int block) | |||
36 | return sb_getblk(sb, block); | 36 | return sb_getblk(sb, block); |
37 | } | 37 | } |
38 | 38 | ||
39 | struct buffer_head *udf_tread(struct super_block *sb, int block) | 39 | struct buffer_head *udf_tread(struct super_block *sb, udf_pblk_t block) |
40 | { | 40 | { |
41 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV)) | 41 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_VARCONV)) |
42 | return sb_bread(sb, udf_fixed_to_variable(block)); | 42 | return sb_bread(sb, udf_fixed_to_variable(block)); |
@@ -209,7 +209,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, | |||
209 | 209 | ||
210 | bh = udf_tread(sb, block); | 210 | bh = udf_tread(sb, block); |
211 | if (!bh) { | 211 | if (!bh) { |
212 | udf_err(sb, "read failed, block=%u, location=%d\n", | 212 | udf_err(sb, "read failed, block=%u, location=%u\n", |
213 | block, location); | 213 | block, location); |
214 | return NULL; | 214 | return NULL; |
215 | } | 215 | } |
@@ -247,7 +247,7 @@ struct buffer_head *udf_read_tagged(struct super_block *sb, uint32_t block, | |||
247 | le16_to_cpu(tag_p->descCRCLength))) | 247 | le16_to_cpu(tag_p->descCRCLength))) |
248 | return bh; | 248 | return bh; |
249 | 249 | ||
250 | udf_debug("Crc failure block %d: crc = %d, crclen = %d\n", block, | 250 | udf_debug("Crc failure block %u: crc = %u, crclen = %u\n", block, |
251 | le16_to_cpu(tag_p->descCRC), | 251 | le16_to_cpu(tag_p->descCRC), |
252 | le16_to_cpu(tag_p->descCRCLength)); | 252 | le16_to_cpu(tag_p->descCRCLength)); |
253 | error_out: | 253 | error_out: |
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 885198dfd9f8..0458dd47e105 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c | |||
@@ -164,7 +164,8 @@ static struct fileIdentDesc *udf_find_entry(struct inode *dir, | |||
164 | { | 164 | { |
165 | struct fileIdentDesc *fi = NULL; | 165 | struct fileIdentDesc *fi = NULL; |
166 | loff_t f_pos; | 166 | loff_t f_pos; |
167 | int block, flen; | 167 | udf_pblk_t block; |
168 | int flen; | ||
168 | unsigned char *fname = NULL, *copy_name = NULL; | 169 | unsigned char *fname = NULL, *copy_name = NULL; |
169 | unsigned char *nameptr; | 170 | unsigned char *nameptr; |
170 | uint8_t lfi; | 171 | uint8_t lfi; |
@@ -352,7 +353,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, | |||
352 | int nfidlen; | 353 | int nfidlen; |
353 | uint8_t lfi; | 354 | uint8_t lfi; |
354 | uint16_t liu; | 355 | uint16_t liu; |
355 | int block; | 356 | udf_pblk_t block; |
356 | struct kernel_lb_addr eloc; | 357 | struct kernel_lb_addr eloc; |
357 | uint32_t elen = 0; | 358 | uint32_t elen = 0; |
358 | sector_t offset; | 359 | sector_t offset; |
@@ -749,7 +750,7 @@ static int empty_dir(struct inode *dir) | |||
749 | struct udf_fileident_bh fibh; | 750 | struct udf_fileident_bh fibh; |
750 | loff_t f_pos; | 751 | loff_t f_pos; |
751 | loff_t size = udf_ext0_offset(dir) + dir->i_size; | 752 | loff_t size = udf_ext0_offset(dir) + dir->i_size; |
752 | int block; | 753 | udf_pblk_t block; |
753 | struct kernel_lb_addr eloc; | 754 | struct kernel_lb_addr eloc; |
754 | uint32_t elen; | 755 | uint32_t elen; |
755 | sector_t offset; | 756 | sector_t offset; |
@@ -839,7 +840,7 @@ static int udf_rmdir(struct inode *dir, struct dentry *dentry) | |||
839 | if (retval) | 840 | if (retval) |
840 | goto end_rmdir; | 841 | goto end_rmdir; |
841 | if (inode->i_nlink != 2) | 842 | if (inode->i_nlink != 2) |
842 | udf_warn(inode->i_sb, "empty directory has nlink != 2 (%d)\n", | 843 | udf_warn(inode->i_sb, "empty directory has nlink != 2 (%u)\n", |
843 | inode->i_nlink); | 844 | inode->i_nlink); |
844 | clear_nlink(inode); | 845 | clear_nlink(inode); |
845 | inode->i_size = 0; | 846 | inode->i_size = 0; |
@@ -881,7 +882,7 @@ static int udf_unlink(struct inode *dir, struct dentry *dentry) | |||
881 | goto end_unlink; | 882 | goto end_unlink; |
882 | 883 | ||
883 | if (!inode->i_nlink) { | 884 | if (!inode->i_nlink) { |
884 | udf_debug("Deleting nonexistent file (%lu), %d\n", | 885 | udf_debug("Deleting nonexistent file (%lu), %u\n", |
885 | inode->i_ino, inode->i_nlink); | 886 | inode->i_ino, inode->i_nlink); |
886 | set_nlink(inode, 1); | 887 | set_nlink(inode, 1); |
887 | } | 888 | } |
@@ -913,7 +914,7 @@ static int udf_symlink(struct inode *dir, struct dentry *dentry, | |||
913 | int eoffset, elen = 0; | 914 | int eoffset, elen = 0; |
914 | uint8_t *ea; | 915 | uint8_t *ea; |
915 | int err; | 916 | int err; |
916 | int block; | 917 | udf_pblk_t block; |
917 | unsigned char *name = NULL; | 918 | unsigned char *name = NULL; |
918 | int namelen; | 919 | int namelen; |
919 | struct udf_inode_info *iinfo; | 920 | struct udf_inode_info *iinfo; |
diff --git a/fs/udf/partition.c b/fs/udf/partition.c index 888c364b2fe9..090baff83990 100644 --- a/fs/udf/partition.c +++ b/fs/udf/partition.c | |||
@@ -32,7 +32,7 @@ uint32_t udf_get_pblock(struct super_block *sb, uint32_t block, | |||
32 | struct udf_sb_info *sbi = UDF_SB(sb); | 32 | struct udf_sb_info *sbi = UDF_SB(sb); |
33 | struct udf_part_map *map; | 33 | struct udf_part_map *map; |
34 | if (partition >= sbi->s_partitions) { | 34 | if (partition >= sbi->s_partitions) { |
35 | udf_debug("block=%d, partition=%d, offset=%d: invalid partition\n", | 35 | udf_debug("block=%u, partition=%u, offset=%u: invalid partition\n", |
36 | block, partition, offset); | 36 | block, partition, offset); |
37 | return 0xFFFFFFFF; | 37 | return 0xFFFFFFFF; |
38 | } | 38 | } |
@@ -59,7 +59,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, | |||
59 | vdata = &map->s_type_specific.s_virtual; | 59 | vdata = &map->s_type_specific.s_virtual; |
60 | 60 | ||
61 | if (block > vdata->s_num_entries) { | 61 | if (block > vdata->s_num_entries) { |
62 | udf_debug("Trying to access block beyond end of VAT (%d max %d)\n", | 62 | udf_debug("Trying to access block beyond end of VAT (%u max %u)\n", |
63 | block, vdata->s_num_entries); | 63 | block, vdata->s_num_entries); |
64 | return 0xFFFFFFFF; | 64 | return 0xFFFFFFFF; |
65 | } | 65 | } |
@@ -83,7 +83,7 @@ uint32_t udf_get_pblock_virt15(struct super_block *sb, uint32_t block, | |||
83 | 83 | ||
84 | bh = sb_bread(sb, loc); | 84 | bh = sb_bread(sb, loc); |
85 | if (!bh) { | 85 | if (!bh) { |
86 | udf_debug("get_pblock(UDF_VIRTUAL_MAP:%p,%d,%d) VAT: %d[%d]\n", | 86 | udf_debug("get_pblock(UDF_VIRTUAL_MAP:%p,%u,%u) VAT: %u[%u]\n", |
87 | sb, block, partition, loc, index); | 87 | sb, block, partition, loc, index); |
88 | return 0xFFFFFFFF; | 88 | return 0xFFFFFFFF; |
89 | } | 89 | } |
diff --git a/fs/udf/super.c b/fs/udf/super.c index 99cb81d0077f..f80e0a0f24d3 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -366,7 +366,7 @@ static int udf_show_options(struct seq_file *seq, struct dentry *root) | |||
366 | if (sbi->s_dmode != UDF_INVALID_MODE) | 366 | if (sbi->s_dmode != UDF_INVALID_MODE) |
367 | seq_printf(seq, ",dmode=%ho", sbi->s_dmode); | 367 | seq_printf(seq, ",dmode=%ho", sbi->s_dmode); |
368 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_SESSION_SET)) | 368 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_SESSION_SET)) |
369 | seq_printf(seq, ",session=%u", sbi->s_session); | 369 | seq_printf(seq, ",session=%d", sbi->s_session); |
370 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_LASTBLOCK_SET)) | 370 | if (UDF_QUERY_FLAG(sb, UDF_FLAG_LASTBLOCK_SET)) |
371 | seq_printf(seq, ",lastblock=%u", sbi->s_last_block); | 371 | seq_printf(seq, ",lastblock=%u", sbi->s_last_block); |
372 | if (sbi->s_anchor != 0) | 372 | if (sbi->s_anchor != 0) |
@@ -703,9 +703,9 @@ static loff_t udf_check_vsd(struct super_block *sb) | |||
703 | else | 703 | else |
704 | sectorsize = sb->s_blocksize; | 704 | sectorsize = sb->s_blocksize; |
705 | 705 | ||
706 | sector += (sbi->s_session << sb->s_blocksize_bits); | 706 | sector += (((loff_t)sbi->s_session) << sb->s_blocksize_bits); |
707 | 707 | ||
708 | udf_debug("Starting at sector %u (%ld byte sectors)\n", | 708 | udf_debug("Starting at sector %u (%lu byte sectors)\n", |
709 | (unsigned int)(sector >> sb->s_blocksize_bits), | 709 | (unsigned int)(sector >> sb->s_blocksize_bits), |
710 | sb->s_blocksize); | 710 | sb->s_blocksize); |
711 | /* Process the sequence (if applicable). The hard limit on the sector | 711 | /* Process the sequence (if applicable). The hard limit on the sector |
@@ -868,7 +868,7 @@ static int udf_find_fileset(struct super_block *sb, | |||
868 | 868 | ||
869 | if ((fileset->logicalBlockNum != 0xFFFFFFFF || | 869 | if ((fileset->logicalBlockNum != 0xFFFFFFFF || |
870 | fileset->partitionReferenceNum != 0xFFFF) && bh) { | 870 | fileset->partitionReferenceNum != 0xFFFF) && bh) { |
871 | udf_debug("Fileset at block=%d, partition=%d\n", | 871 | udf_debug("Fileset at block=%u, partition=%u\n", |
872 | fileset->logicalBlockNum, | 872 | fileset->logicalBlockNum, |
873 | fileset->partitionReferenceNum); | 873 | fileset->partitionReferenceNum); |
874 | 874 | ||
@@ -981,14 +981,14 @@ static int udf_load_metadata_files(struct super_block *sb, int partition, | |||
981 | mdata->s_phys_partition_ref = type1_index; | 981 | mdata->s_phys_partition_ref = type1_index; |
982 | 982 | ||
983 | /* metadata address */ | 983 | /* metadata address */ |
984 | udf_debug("Metadata file location: block = %d part = %d\n", | 984 | udf_debug("Metadata file location: block = %u part = %u\n", |
985 | mdata->s_meta_file_loc, mdata->s_phys_partition_ref); | 985 | mdata->s_meta_file_loc, mdata->s_phys_partition_ref); |
986 | 986 | ||
987 | fe = udf_find_metadata_inode_efe(sb, mdata->s_meta_file_loc, | 987 | fe = udf_find_metadata_inode_efe(sb, mdata->s_meta_file_loc, |
988 | mdata->s_phys_partition_ref); | 988 | mdata->s_phys_partition_ref); |
989 | if (IS_ERR(fe)) { | 989 | if (IS_ERR(fe)) { |
990 | /* mirror file entry */ | 990 | /* mirror file entry */ |
991 | udf_debug("Mirror metadata file location: block = %d part = %d\n", | 991 | udf_debug("Mirror metadata file location: block = %u part = %u\n", |
992 | mdata->s_mirror_file_loc, mdata->s_phys_partition_ref); | 992 | mdata->s_mirror_file_loc, mdata->s_phys_partition_ref); |
993 | 993 | ||
994 | fe = udf_find_metadata_inode_efe(sb, mdata->s_mirror_file_loc, | 994 | fe = udf_find_metadata_inode_efe(sb, mdata->s_mirror_file_loc, |
@@ -1012,7 +1012,7 @@ static int udf_load_metadata_files(struct super_block *sb, int partition, | |||
1012 | addr.logicalBlockNum = mdata->s_bitmap_file_loc; | 1012 | addr.logicalBlockNum = mdata->s_bitmap_file_loc; |
1013 | addr.partitionReferenceNum = mdata->s_phys_partition_ref; | 1013 | addr.partitionReferenceNum = mdata->s_phys_partition_ref; |
1014 | 1014 | ||
1015 | udf_debug("Bitmap file location: block = %d part = %d\n", | 1015 | udf_debug("Bitmap file location: block = %u part = %u\n", |
1016 | addr.logicalBlockNum, addr.partitionReferenceNum); | 1016 | addr.logicalBlockNum, addr.partitionReferenceNum); |
1017 | 1017 | ||
1018 | fe = udf_iget_special(sb, &addr); | 1018 | fe = udf_iget_special(sb, &addr); |
@@ -1042,7 +1042,7 @@ static void udf_load_fileset(struct super_block *sb, struct buffer_head *bh, | |||
1042 | 1042 | ||
1043 | UDF_SB(sb)->s_serial_number = le16_to_cpu(fset->descTag.tagSerialNum); | 1043 | UDF_SB(sb)->s_serial_number = le16_to_cpu(fset->descTag.tagSerialNum); |
1044 | 1044 | ||
1045 | udf_debug("Rootdir at block=%d, partition=%d\n", | 1045 | udf_debug("Rootdir at block=%u, partition=%u\n", |
1046 | root->logicalBlockNum, root->partitionReferenceNum); | 1046 | root->logicalBlockNum, root->partitionReferenceNum); |
1047 | } | 1047 | } |
1048 | 1048 | ||
@@ -1097,7 +1097,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, | |||
1097 | if (p->accessType == cpu_to_le32(PD_ACCESS_TYPE_OVERWRITABLE)) | 1097 | if (p->accessType == cpu_to_le32(PD_ACCESS_TYPE_OVERWRITABLE)) |
1098 | map->s_partition_flags |= UDF_PART_FLAG_OVERWRITABLE; | 1098 | map->s_partition_flags |= UDF_PART_FLAG_OVERWRITABLE; |
1099 | 1099 | ||
1100 | udf_debug("Partition (%d type %x) starts at physical %d, block length %d\n", | 1100 | udf_debug("Partition (%d type %x) starts at physical %u, block length %u\n", |
1101 | p_index, map->s_partition_type, | 1101 | p_index, map->s_partition_type, |
1102 | map->s_partition_root, map->s_partition_len); | 1102 | map->s_partition_root, map->s_partition_len); |
1103 | 1103 | ||
@@ -1122,7 +1122,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, | |||
1122 | } | 1122 | } |
1123 | map->s_uspace.s_table = inode; | 1123 | map->s_uspace.s_table = inode; |
1124 | map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE; | 1124 | map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_TABLE; |
1125 | udf_debug("unallocSpaceTable (part %d) @ %ld\n", | 1125 | udf_debug("unallocSpaceTable (part %d) @ %lu\n", |
1126 | p_index, map->s_uspace.s_table->i_ino); | 1126 | p_index, map->s_uspace.s_table->i_ino); |
1127 | } | 1127 | } |
1128 | 1128 | ||
@@ -1134,7 +1134,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, | |||
1134 | bitmap->s_extPosition = le32_to_cpu( | 1134 | bitmap->s_extPosition = le32_to_cpu( |
1135 | phd->unallocSpaceBitmap.extPosition); | 1135 | phd->unallocSpaceBitmap.extPosition); |
1136 | map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_BITMAP; | 1136 | map->s_partition_flags |= UDF_PART_FLAG_UNALLOC_BITMAP; |
1137 | udf_debug("unallocSpaceBitmap (part %d) @ %d\n", | 1137 | udf_debug("unallocSpaceBitmap (part %d) @ %u\n", |
1138 | p_index, bitmap->s_extPosition); | 1138 | p_index, bitmap->s_extPosition); |
1139 | } | 1139 | } |
1140 | 1140 | ||
@@ -1157,7 +1157,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, | |||
1157 | } | 1157 | } |
1158 | map->s_fspace.s_table = inode; | 1158 | map->s_fspace.s_table = inode; |
1159 | map->s_partition_flags |= UDF_PART_FLAG_FREED_TABLE; | 1159 | map->s_partition_flags |= UDF_PART_FLAG_FREED_TABLE; |
1160 | udf_debug("freedSpaceTable (part %d) @ %ld\n", | 1160 | udf_debug("freedSpaceTable (part %d) @ %lu\n", |
1161 | p_index, map->s_fspace.s_table->i_ino); | 1161 | p_index, map->s_fspace.s_table->i_ino); |
1162 | } | 1162 | } |
1163 | 1163 | ||
@@ -1169,7 +1169,7 @@ static int udf_fill_partdesc_info(struct super_block *sb, | |||
1169 | bitmap->s_extPosition = le32_to_cpu( | 1169 | bitmap->s_extPosition = le32_to_cpu( |
1170 | phd->freedSpaceBitmap.extPosition); | 1170 | phd->freedSpaceBitmap.extPosition); |
1171 | map->s_partition_flags |= UDF_PART_FLAG_FREED_BITMAP; | 1171 | map->s_partition_flags |= UDF_PART_FLAG_FREED_BITMAP; |
1172 | udf_debug("freedSpaceBitmap (part %d) @ %d\n", | 1172 | udf_debug("freedSpaceBitmap (part %d) @ %u\n", |
1173 | p_index, bitmap->s_extPosition); | 1173 | p_index, bitmap->s_extPosition); |
1174 | } | 1174 | } |
1175 | return 0; | 1175 | return 0; |
@@ -1282,7 +1282,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) | |||
1282 | /* First scan for TYPE1 and SPARABLE partitions */ | 1282 | /* First scan for TYPE1 and SPARABLE partitions */ |
1283 | for (i = 0; i < sbi->s_partitions; i++) { | 1283 | for (i = 0; i < sbi->s_partitions; i++) { |
1284 | map = &sbi->s_partmaps[i]; | 1284 | map = &sbi->s_partmaps[i]; |
1285 | udf_debug("Searching map: (%d == %d)\n", | 1285 | udf_debug("Searching map: (%u == %u)\n", |
1286 | map->s_partition_num, partitionNumber); | 1286 | map->s_partition_num, partitionNumber); |
1287 | if (map->s_partition_num == partitionNumber && | 1287 | if (map->s_partition_num == partitionNumber && |
1288 | (map->s_partition_type == UDF_TYPE1_MAP15 || | 1288 | (map->s_partition_type == UDF_TYPE1_MAP15 || |
@@ -1291,7 +1291,7 @@ static int udf_load_partdesc(struct super_block *sb, sector_t block) | |||
1291 | } | 1291 | } |
1292 | 1292 | ||
1293 | if (i >= sbi->s_partitions) { | 1293 | if (i >= sbi->s_partitions) { |
1294 | udf_debug("Partition (%d) not found in partition map\n", | 1294 | udf_debug("Partition (%u) not found in partition map\n", |
1295 | partitionNumber); | 1295 | partitionNumber); |
1296 | ret = 0; | 1296 | ret = 0; |
1297 | goto out_bh; | 1297 | goto out_bh; |
@@ -1483,7 +1483,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, | |||
1483 | struct metadataPartitionMap *mdm = | 1483 | struct metadataPartitionMap *mdm = |
1484 | (struct metadataPartitionMap *) | 1484 | (struct metadataPartitionMap *) |
1485 | &(lvd->partitionMaps[offset]); | 1485 | &(lvd->partitionMaps[offset]); |
1486 | udf_debug("Parsing Logical vol part %d type %d id=%s\n", | 1486 | udf_debug("Parsing Logical vol part %d type %u id=%s\n", |
1487 | i, type, UDF_ID_METADATA); | 1487 | i, type, UDF_ID_METADATA); |
1488 | 1488 | ||
1489 | map->s_partition_type = UDF_METADATA_MAP25; | 1489 | map->s_partition_type = UDF_METADATA_MAP25; |
@@ -1505,17 +1505,17 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, | |||
1505 | udf_debug("Metadata Ident suffix=0x%x\n", | 1505 | udf_debug("Metadata Ident suffix=0x%x\n", |
1506 | le16_to_cpu(*(__le16 *) | 1506 | le16_to_cpu(*(__le16 *) |
1507 | mdm->partIdent.identSuffix)); | 1507 | mdm->partIdent.identSuffix)); |
1508 | udf_debug("Metadata part num=%d\n", | 1508 | udf_debug("Metadata part num=%u\n", |
1509 | le16_to_cpu(mdm->partitionNum)); | 1509 | le16_to_cpu(mdm->partitionNum)); |
1510 | udf_debug("Metadata part alloc unit size=%d\n", | 1510 | udf_debug("Metadata part alloc unit size=%u\n", |
1511 | le32_to_cpu(mdm->allocUnitSize)); | 1511 | le32_to_cpu(mdm->allocUnitSize)); |
1512 | udf_debug("Metadata file loc=%d\n", | 1512 | udf_debug("Metadata file loc=%u\n", |
1513 | le32_to_cpu(mdm->metadataFileLoc)); | 1513 | le32_to_cpu(mdm->metadataFileLoc)); |
1514 | udf_debug("Mirror file loc=%d\n", | 1514 | udf_debug("Mirror file loc=%u\n", |
1515 | le32_to_cpu(mdm->metadataMirrorFileLoc)); | 1515 | le32_to_cpu(mdm->metadataMirrorFileLoc)); |
1516 | udf_debug("Bitmap file loc=%d\n", | 1516 | udf_debug("Bitmap file loc=%u\n", |
1517 | le32_to_cpu(mdm->metadataBitmapFileLoc)); | 1517 | le32_to_cpu(mdm->metadataBitmapFileLoc)); |
1518 | udf_debug("Flags: %d %d\n", | 1518 | udf_debug("Flags: %d %u\n", |
1519 | mdata->s_flags, mdm->flags); | 1519 | mdata->s_flags, mdm->flags); |
1520 | } else { | 1520 | } else { |
1521 | udf_debug("Unknown ident: %s\n", | 1521 | udf_debug("Unknown ident: %s\n", |
@@ -1525,7 +1525,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, | |||
1525 | map->s_volumeseqnum = le16_to_cpu(upm2->volSeqNum); | 1525 | map->s_volumeseqnum = le16_to_cpu(upm2->volSeqNum); |
1526 | map->s_partition_num = le16_to_cpu(upm2->partitionNum); | 1526 | map->s_partition_num = le16_to_cpu(upm2->partitionNum); |
1527 | } | 1527 | } |
1528 | udf_debug("Partition (%d:%d) type %d on volume %d\n", | 1528 | udf_debug("Partition (%d:%u) type %u on volume %u\n", |
1529 | i, map->s_partition_num, type, map->s_volumeseqnum); | 1529 | i, map->s_partition_num, type, map->s_volumeseqnum); |
1530 | } | 1530 | } |
1531 | 1531 | ||
@@ -1533,7 +1533,7 @@ static int udf_load_logicalvol(struct super_block *sb, sector_t block, | |||
1533 | struct long_ad *la = (struct long_ad *)&(lvd->logicalVolContentsUse[0]); | 1533 | struct long_ad *la = (struct long_ad *)&(lvd->logicalVolContentsUse[0]); |
1534 | 1534 | ||
1535 | *fileset = lelb_to_cpu(la->extLocation); | 1535 | *fileset = lelb_to_cpu(la->extLocation); |
1536 | udf_debug("FileSet found in LogicalVolDesc at block=%d, partition=%d\n", | 1536 | udf_debug("FileSet found in LogicalVolDesc at block=%u, partition=%u\n", |
1537 | fileset->logicalBlockNum, | 1537 | fileset->logicalBlockNum, |
1538 | fileset->partitionReferenceNum); | 1538 | fileset->partitionReferenceNum); |
1539 | } | 1539 | } |
@@ -2159,7 +2159,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
2159 | ret = udf_load_vrs(sb, &uopt, silent, &fileset); | 2159 | ret = udf_load_vrs(sb, &uopt, silent, &fileset); |
2160 | if (ret < 0) { | 2160 | if (ret < 0) { |
2161 | if (!silent && ret != -EACCES) { | 2161 | if (!silent && ret != -EACCES) { |
2162 | pr_notice("Scanning with blocksize %d failed\n", | 2162 | pr_notice("Scanning with blocksize %u failed\n", |
2163 | uopt.blocksize); | 2163 | uopt.blocksize); |
2164 | } | 2164 | } |
2165 | brelse(sbi->s_lvid_bh); | 2165 | brelse(sbi->s_lvid_bh); |
@@ -2184,7 +2184,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
2184 | goto error_out; | 2184 | goto error_out; |
2185 | } | 2185 | } |
2186 | 2186 | ||
2187 | udf_debug("Lastblock=%d\n", sbi->s_last_block); | 2187 | udf_debug("Lastblock=%u\n", sbi->s_last_block); |
2188 | 2188 | ||
2189 | if (sbi->s_lvid_bh) { | 2189 | if (sbi->s_lvid_bh) { |
2190 | struct logicalVolIntegrityDescImpUse *lvidiu = | 2190 | struct logicalVolIntegrityDescImpUse *lvidiu = |
@@ -2255,7 +2255,7 @@ static int udf_fill_super(struct super_block *sb, void *options, int silent) | |||
2255 | /* perhaps it's not extensible enough, but for now ... */ | 2255 | /* perhaps it's not extensible enough, but for now ... */ |
2256 | inode = udf_iget(sb, &rootdir); | 2256 | inode = udf_iget(sb, &rootdir); |
2257 | if (IS_ERR(inode)) { | 2257 | if (IS_ERR(inode)) { |
2258 | udf_err(sb, "Error in udf_iget, block=%d, partition=%d\n", | 2258 | udf_err(sb, "Error in udf_iget, block=%u, partition=%u\n", |
2259 | rootdir.logicalBlockNum, rootdir.partitionReferenceNum); | 2259 | rootdir.logicalBlockNum, rootdir.partitionReferenceNum); |
2260 | ret = PTR_ERR(inode); | 2260 | ret = PTR_ERR(inode); |
2261 | goto error_out; | 2261 | goto error_out; |
@@ -2389,7 +2389,7 @@ static unsigned int udf_count_free_bitmap(struct super_block *sb, | |||
2389 | struct buffer_head *bh = NULL; | 2389 | struct buffer_head *bh = NULL; |
2390 | unsigned int accum = 0; | 2390 | unsigned int accum = 0; |
2391 | int index; | 2391 | int index; |
2392 | int block = 0, newblock; | 2392 | udf_pblk_t block = 0, newblock; |
2393 | struct kernel_lb_addr loc; | 2393 | struct kernel_lb_addr loc; |
2394 | uint32_t bytes; | 2394 | uint32_t bytes; |
2395 | uint8_t *ptr; | 2395 | uint8_t *ptr; |
diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c index 42b8c57795cb..b647f0bd150c 100644 --- a/fs/udf/truncate.c +++ b/fs/udf/truncate.c | |||
@@ -48,7 +48,7 @@ static void extent_trunc(struct inode *inode, struct extent_position *epos, | |||
48 | 48 | ||
49 | if (elen != nelen) { | 49 | if (elen != nelen) { |
50 | udf_write_aext(inode, epos, &neloc, nelen, 0); | 50 | udf_write_aext(inode, epos, &neloc, nelen, 0); |
51 | if (last_block - first_block > 0) { | 51 | if (last_block > first_block) { |
52 | if (etype == (EXT_RECORDED_ALLOCATED >> 30)) | 52 | if (etype == (EXT_RECORDED_ALLOCATED >> 30)) |
53 | mark_inode_dirty(inode); | 53 | mark_inode_dirty(inode); |
54 | 54 | ||
diff --git a/fs/udf/udfdecl.h b/fs/udf/udfdecl.h index fa206558128d..f5e0fe78979e 100644 --- a/fs/udf/udfdecl.h +++ b/fs/udf/udfdecl.h | |||
@@ -74,6 +74,8 @@ static inline size_t udf_ext0_offset(struct inode *inode) | |||
74 | /* computes tag checksum */ | 74 | /* computes tag checksum */ |
75 | u8 udf_tag_checksum(const struct tag *t); | 75 | u8 udf_tag_checksum(const struct tag *t); |
76 | 76 | ||
77 | typedef uint32_t udf_pblk_t; | ||
78 | |||
77 | struct dentry; | 79 | struct dentry; |
78 | struct inode; | 80 | struct inode; |
79 | struct task_struct; | 81 | struct task_struct; |
@@ -145,15 +147,17 @@ static inline struct inode *udf_iget(struct super_block *sb, | |||
145 | return __udf_iget(sb, ino, false); | 147 | return __udf_iget(sb, ino, false); |
146 | } | 148 | } |
147 | extern int udf_expand_file_adinicb(struct inode *); | 149 | extern int udf_expand_file_adinicb(struct inode *); |
148 | extern struct buffer_head *udf_expand_dir_adinicb(struct inode *, int *, int *); | 150 | extern struct buffer_head *udf_expand_dir_adinicb(struct inode *inode, |
149 | extern struct buffer_head *udf_bread(struct inode *, int, int, int *); | 151 | udf_pblk_t *block, int *err); |
152 | extern struct buffer_head *udf_bread(struct inode *inode, udf_pblk_t block, | ||
153 | int create, int *err); | ||
150 | extern int udf_setsize(struct inode *, loff_t); | 154 | extern int udf_setsize(struct inode *, loff_t); |
151 | extern void udf_evict_inode(struct inode *); | 155 | extern void udf_evict_inode(struct inode *); |
152 | extern int udf_write_inode(struct inode *, struct writeback_control *wbc); | 156 | extern int udf_write_inode(struct inode *, struct writeback_control *wbc); |
153 | extern long udf_block_map(struct inode *, sector_t); | 157 | extern udf_pblk_t udf_block_map(struct inode *inode, sector_t block); |
154 | extern int8_t inode_bmap(struct inode *, sector_t, struct extent_position *, | 158 | extern int8_t inode_bmap(struct inode *, sector_t, struct extent_position *, |
155 | struct kernel_lb_addr *, uint32_t *, sector_t *); | 159 | struct kernel_lb_addr *, uint32_t *, sector_t *); |
156 | extern int udf_setup_indirect_aext(struct inode *inode, int block, | 160 | extern int udf_setup_indirect_aext(struct inode *inode, udf_pblk_t block, |
157 | struct extent_position *epos); | 161 | struct extent_position *epos); |
158 | extern int __udf_add_aext(struct inode *inode, struct extent_position *epos, | 162 | extern int __udf_add_aext(struct inode *inode, struct extent_position *epos, |
159 | struct kernel_lb_addr *eloc, uint32_t elen, int inc); | 163 | struct kernel_lb_addr *eloc, uint32_t elen, int inc); |
@@ -169,8 +173,9 @@ extern int8_t udf_current_aext(struct inode *, struct extent_position *, | |||
169 | struct kernel_lb_addr *, uint32_t *, int); | 173 | struct kernel_lb_addr *, uint32_t *, int); |
170 | 174 | ||
171 | /* misc.c */ | 175 | /* misc.c */ |
172 | extern struct buffer_head *udf_tgetblk(struct super_block *, int); | 176 | extern struct buffer_head *udf_tgetblk(struct super_block *sb, |
173 | extern struct buffer_head *udf_tread(struct super_block *, int); | 177 | udf_pblk_t block); |
178 | extern struct buffer_head *udf_tread(struct super_block *sb, udf_pblk_t block); | ||
174 | extern struct genericFormat *udf_add_extendedattr(struct inode *, uint32_t, | 179 | extern struct genericFormat *udf_add_extendedattr(struct inode *, uint32_t, |
175 | uint32_t, uint8_t); | 180 | uint32_t, uint8_t); |
176 | extern struct genericFormat *udf_get_extendedattr(struct inode *, uint32_t, | 181 | extern struct genericFormat *udf_get_extendedattr(struct inode *, uint32_t, |
@@ -229,8 +234,8 @@ extern void udf_free_blocks(struct super_block *, struct inode *, | |||
229 | struct kernel_lb_addr *, uint32_t, uint32_t); | 234 | struct kernel_lb_addr *, uint32_t, uint32_t); |
230 | extern int udf_prealloc_blocks(struct super_block *, struct inode *, uint16_t, | 235 | extern int udf_prealloc_blocks(struct super_block *, struct inode *, uint16_t, |
231 | uint32_t, uint32_t); | 236 | uint32_t, uint32_t); |
232 | extern int udf_new_block(struct super_block *, struct inode *, uint16_t, | 237 | extern udf_pblk_t udf_new_block(struct super_block *sb, struct inode *inode, |
233 | uint32_t, int *); | 238 | uint16_t partition, uint32_t goal, int *err); |
234 | 239 | ||
235 | /* directory.c */ | 240 | /* directory.c */ |
236 | extern struct fileIdentDesc *udf_fileident_read(struct inode *, loff_t *, | 241 | extern struct fileIdentDesc *udf_fileident_read(struct inode *, loff_t *, |
diff --git a/fs/udf/unicode.c b/fs/udf/unicode.c index 695389a4fc23..f897e55f2cd0 100644 --- a/fs/udf/unicode.c +++ b/fs/udf/unicode.c | |||
@@ -200,7 +200,7 @@ static int udf_name_from_CS0(uint8_t *str_o, int str_max_len, | |||
200 | cmp_id = ocu[0]; | 200 | cmp_id = ocu[0]; |
201 | if (cmp_id != 8 && cmp_id != 16) { | 201 | if (cmp_id != 8 && cmp_id != 16) { |
202 | memset(str_o, 0, str_max_len); | 202 | memset(str_o, 0, str_max_len); |
203 | pr_err("unknown compression code (%d)\n", cmp_id); | 203 | pr_err("unknown compression code (%u)\n", cmp_id); |
204 | return -EINVAL; | 204 | return -EINVAL; |
205 | } | 205 | } |
206 | u_ch = cmp_id >> 3; | 206 | u_ch = cmp_id >> 3; |