super.c (f50a4c8149cc135921a8a0476bff8e622f59aef9) super.c (0234576d041b9b2cc7043691ea61d2c2ca597aaa)
1/*
2 * super.c - NILFS module and super block management.
3 *
4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 465 unchanged lines hidden (view full) ---

474 seq_printf(seq, ",cp=%llu",
475 (unsigned long long int)sbi->s_snapshot_cno);
476 if (nilfs_test_opt(sbi, ERRORS_RO))
477 seq_printf(seq, ",errors=remount-ro");
478 if (nilfs_test_opt(sbi, ERRORS_PANIC))
479 seq_printf(seq, ",errors=panic");
480 if (nilfs_test_opt(sbi, STRICT_ORDER))
481 seq_printf(seq, ",order=strict");
1/*
2 * super.c - NILFS module and super block management.
3 *
4 * Copyright (C) 2005-2008 Nippon Telegraph and Telephone Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 465 unchanged lines hidden (view full) ---

474 seq_printf(seq, ",cp=%llu",
475 (unsigned long long int)sbi->s_snapshot_cno);
476 if (nilfs_test_opt(sbi, ERRORS_RO))
477 seq_printf(seq, ",errors=remount-ro");
478 if (nilfs_test_opt(sbi, ERRORS_PANIC))
479 seq_printf(seq, ",errors=panic");
480 if (nilfs_test_opt(sbi, STRICT_ORDER))
481 seq_printf(seq, ",order=strict");
482 if (nilfs_test_opt(sbi, NORECOVERY))
483 seq_printf(seq, ",norecovery");
482
483 return 0;
484}
485
486static const struct super_operations nilfs_sops = {
487 .alloc_inode = nilfs_alloc_inode,
488 .destroy_inode = nilfs_destroy_inode,
489 .dirty_inode = nilfs_dirty_inode,

--- 52 unchanged lines hidden (view full) ---

542static const struct export_operations nilfs_export_ops = {
543 .fh_to_dentry = nilfs_fh_to_dentry,
544 .fh_to_parent = nilfs_fh_to_parent,
545 .get_parent = nilfs_get_parent,
546};
547
548enum {
549 Opt_err_cont, Opt_err_panic, Opt_err_ro,
484
485 return 0;
486}
487
488static const struct super_operations nilfs_sops = {
489 .alloc_inode = nilfs_alloc_inode,
490 .destroy_inode = nilfs_destroy_inode,
491 .dirty_inode = nilfs_dirty_inode,

--- 52 unchanged lines hidden (view full) ---

544static const struct export_operations nilfs_export_ops = {
545 .fh_to_dentry = nilfs_fh_to_dentry,
546 .fh_to_parent = nilfs_fh_to_parent,
547 .get_parent = nilfs_get_parent,
548};
549
550enum {
551 Opt_err_cont, Opt_err_panic, Opt_err_ro,
550 Opt_nobarrier, Opt_snapshot, Opt_order,
552 Opt_nobarrier, Opt_snapshot, Opt_order, Opt_norecovery,
551 Opt_err,
552};
553
554static match_table_t tokens = {
555 {Opt_err_cont, "errors=continue"},
556 {Opt_err_panic, "errors=panic"},
557 {Opt_err_ro, "errors=remount-ro"},
558 {Opt_nobarrier, "nobarrier"},
559 {Opt_snapshot, "cp=%u"},
560 {Opt_order, "order=%s"},
553 Opt_err,
554};
555
556static match_table_t tokens = {
557 {Opt_err_cont, "errors=continue"},
558 {Opt_err_panic, "errors=panic"},
559 {Opt_err_ro, "errors=remount-ro"},
560 {Opt_nobarrier, "nobarrier"},
561 {Opt_snapshot, "cp=%u"},
562 {Opt_order, "order=%s"},
563 {Opt_norecovery, "norecovery"},
561 {Opt_err, NULL}
562};
563
564static int parse_options(char *options, struct super_block *sb)
565{
566 struct nilfs_sb_info *sbi = NILFS_SB(sb);
567 char *p;
568 substring_t args[MAX_OPT_ARGS];

--- 34 unchanged lines hidden (view full) ---

603 case Opt_snapshot:
604 if (match_int(&args[0], &option) || option <= 0)
605 return 0;
606 if (!(sb->s_flags & MS_RDONLY))
607 return 0;
608 sbi->s_snapshot_cno = option;
609 nilfs_set_opt(sbi, SNAPSHOT);
610 break;
564 {Opt_err, NULL}
565};
566
567static int parse_options(char *options, struct super_block *sb)
568{
569 struct nilfs_sb_info *sbi = NILFS_SB(sb);
570 char *p;
571 substring_t args[MAX_OPT_ARGS];

--- 34 unchanged lines hidden (view full) ---

606 case Opt_snapshot:
607 if (match_int(&args[0], &option) || option <= 0)
608 return 0;
609 if (!(sb->s_flags & MS_RDONLY))
610 return 0;
611 sbi->s_snapshot_cno = option;
612 nilfs_set_opt(sbi, SNAPSHOT);
613 break;
614 case Opt_norecovery:
615 nilfs_set_opt(sbi, NORECOVERY);
616 break;
611 default:
612 printk(KERN_ERR
613 "NILFS: Unrecognized mount option \"%s\"\n", p);
614 return 0;
615 }
616 }
617 return 1;
618}

--- 239 unchanged lines hidden (view full) ---

858 sbi->s_snapshot_cno != old_opts.snapshot_cno) {
859 printk(KERN_WARNING "NILFS (device %s): couldn't "
860 "remount to a different snapshot. \n",
861 sb->s_id);
862 err = -EINVAL;
863 goto restore_opts;
864 }
865
617 default:
618 printk(KERN_ERR
619 "NILFS: Unrecognized mount option \"%s\"\n", p);
620 return 0;
621 }
622 }
623 return 1;
624}

--- 239 unchanged lines hidden (view full) ---

864 sbi->s_snapshot_cno != old_opts.snapshot_cno) {
865 printk(KERN_WARNING "NILFS (device %s): couldn't "
866 "remount to a different snapshot. \n",
867 sb->s_id);
868 err = -EINVAL;
869 goto restore_opts;
870 }
871
872 if (!nilfs_valid_fs(nilfs)) {
873 printk(KERN_WARNING "NILFS (device %s): couldn't "
874 "remount because the filesystem is in an "
875 "incomplete recovery state.\n", sb->s_id);
876 err = -EINVAL;
877 goto restore_opts;
878 }
879
866 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
867 goto out;
868 if (*flags & MS_RDONLY) {
869 /* Shutting down the segment constructor */
870 nilfs_detach_segment_constructor(sbi);
871 sb->s_flags |= MS_RDONLY;
872
873 sbi->s_snapshot_cno = nilfs_last_cno(nilfs);

--- 304 unchanged lines hidden ---
880 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
881 goto out;
882 if (*flags & MS_RDONLY) {
883 /* Shutting down the segment constructor */
884 nilfs_detach_segment_constructor(sbi);
885 sb->s_flags |= MS_RDONLY;
886
887 sbi->s_snapshot_cno = nilfs_last_cno(nilfs);

--- 304 unchanged lines hidden ---