super.c (d147b3d630edef1d34de6ea819787a1ac1b8603b) super.c (2fbe8d1ebe004425b4f7b8bba345623d2280be82)
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * super.c
5 *
6 * load/unload driver, mount/dismount volumes
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

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

82MODULE_LICENSE("GPL");
83
84struct mount_options
85{
86 unsigned long commit_interval;
87 unsigned long mount_opt;
88 unsigned int atime_quantum;
89 signed short slot;
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * super.c
5 *
6 * load/unload driver, mount/dismount volumes
7 *
8 * Copyright (C) 2002, 2004 Oracle. All rights reserved.

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

82MODULE_LICENSE("GPL");
83
84struct mount_options
85{
86 unsigned long commit_interval;
87 unsigned long mount_opt;
88 unsigned int atime_quantum;
89 signed short slot;
90 unsigned int localalloc_opt;
90};
91
92static int ocfs2_parse_options(struct super_block *sb, char *options,
93 struct mount_options *mopt,
94 int is_remount);
95static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt);
96static void ocfs2_put_super(struct super_block *sb);
97static int ocfs2_mount_volume(struct super_block *sb);

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

146 Opt_nointr,
147 Opt_hb_none,
148 Opt_hb_local,
149 Opt_data_ordered,
150 Opt_data_writeback,
151 Opt_atime_quantum,
152 Opt_slot,
153 Opt_commit,
91};
92
93static int ocfs2_parse_options(struct super_block *sb, char *options,
94 struct mount_options *mopt,
95 int is_remount);
96static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt);
97static void ocfs2_put_super(struct super_block *sb);
98static int ocfs2_mount_volume(struct super_block *sb);

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

147 Opt_nointr,
148 Opt_hb_none,
149 Opt_hb_local,
150 Opt_data_ordered,
151 Opt_data_writeback,
152 Opt_atime_quantum,
153 Opt_slot,
154 Opt_commit,
155 Opt_localalloc,
154 Opt_err,
155};
156
157static match_table_t tokens = {
158 {Opt_barrier, "barrier=%u"},
159 {Opt_err_panic, "errors=panic"},
160 {Opt_err_ro, "errors=remount-ro"},
161 {Opt_intr, "intr"},
162 {Opt_nointr, "nointr"},
163 {Opt_hb_none, OCFS2_HB_NONE},
164 {Opt_hb_local, OCFS2_HB_LOCAL},
165 {Opt_data_ordered, "data=ordered"},
166 {Opt_data_writeback, "data=writeback"},
167 {Opt_atime_quantum, "atime_quantum=%u"},
168 {Opt_slot, "preferred_slot=%u"},
169 {Opt_commit, "commit=%u"},
156 Opt_err,
157};
158
159static match_table_t tokens = {
160 {Opt_barrier, "barrier=%u"},
161 {Opt_err_panic, "errors=panic"},
162 {Opt_err_ro, "errors=remount-ro"},
163 {Opt_intr, "intr"},
164 {Opt_nointr, "nointr"},
165 {Opt_hb_none, OCFS2_HB_NONE},
166 {Opt_hb_local, OCFS2_HB_LOCAL},
167 {Opt_data_ordered, "data=ordered"},
168 {Opt_data_writeback, "data=writeback"},
169 {Opt_atime_quantum, "atime_quantum=%u"},
170 {Opt_slot, "preferred_slot=%u"},
171 {Opt_commit, "commit=%u"},
172 {Opt_localalloc, "localalloc=%d"},
170 {Opt_err, NULL}
171};
172
173/*
174 * write_super and sync_fs ripped right out of ext3.
175 */
176static void ocfs2_write_super(struct super_block *sb)
177{

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

597 goto read_super_error;
598 }
599 brelse(bh);
600 bh = NULL;
601 osb->s_mount_opt = parsed_options.mount_opt;
602 osb->s_atime_quantum = parsed_options.atime_quantum;
603 osb->preferred_slot = parsed_options.slot;
604 osb->osb_commit_interval = parsed_options.commit_interval;
173 {Opt_err, NULL}
174};
175
176/*
177 * write_super and sync_fs ripped right out of ext3.
178 */
179static void ocfs2_write_super(struct super_block *sb)
180{

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

600 goto read_super_error;
601 }
602 brelse(bh);
603 bh = NULL;
604 osb->s_mount_opt = parsed_options.mount_opt;
605 osb->s_atime_quantum = parsed_options.atime_quantum;
606 osb->preferred_slot = parsed_options.slot;
607 osb->osb_commit_interval = parsed_options.commit_interval;
608 osb->local_alloc_size = parsed_options.localalloc_opt;
605
606 sb->s_magic = OCFS2_SUPER_MAGIC;
607
608 /* Hard readonly mode only if: bdev_read_only, MS_RDONLY,
609 * heartbeat=none */
610 if (bdev_read_only(sb->s_bdev)) {
611 if (!(sb->s_flags & MS_RDONLY)) {
612 status = -EACCES;

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

751
752 mlog_entry("remount: %d, options: \"%s\"\n", is_remount,
753 options ? options : "(none)");
754
755 mopt->commit_interval = 0;
756 mopt->mount_opt = 0;
757 mopt->atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;
758 mopt->slot = OCFS2_INVALID_SLOT;
609
610 sb->s_magic = OCFS2_SUPER_MAGIC;
611
612 /* Hard readonly mode only if: bdev_read_only, MS_RDONLY,
613 * heartbeat=none */
614 if (bdev_read_only(sb->s_bdev)) {
615 if (!(sb->s_flags & MS_RDONLY)) {
616 status = -EACCES;

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

755
756 mlog_entry("remount: %d, options: \"%s\"\n", is_remount,
757 options ? options : "(none)");
758
759 mopt->commit_interval = 0;
760 mopt->mount_opt = 0;
761 mopt->atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;
762 mopt->slot = OCFS2_INVALID_SLOT;
763 mopt->localalloc_opt = OCFS2_DEFAULT_LOCAL_ALLOC_SIZE;
759
760 if (!options) {
761 status = 1;
762 goto bail;
763 }
764
765 while ((p = strsep(&options, ",")) != NULL) {
766 int token, option;

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

829 goto bail;
830 }
831 if (option < 0)
832 return 0;
833 if (option == 0)
834 option = JBD_DEFAULT_MAX_COMMIT_AGE;
835 mopt->commit_interval = HZ * option;
836 break;
764
765 if (!options) {
766 status = 1;
767 goto bail;
768 }
769
770 while ((p = strsep(&options, ",")) != NULL) {
771 int token, option;

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

834 goto bail;
835 }
836 if (option < 0)
837 return 0;
838 if (option == 0)
839 option = JBD_DEFAULT_MAX_COMMIT_AGE;
840 mopt->commit_interval = HZ * option;
841 break;
842 case Opt_localalloc:
843 option = 0;
844 if (match_int(&args[0], &option)) {
845 status = 0;
846 goto bail;
847 }
848 if (option >= 0 && (option <= ocfs2_local_alloc_size(sb) * 8))
849 mopt->localalloc_opt = option;
850 break;
837 default:
838 mlog(ML_ERROR,
839 "Unrecognized mount option \"%s\" "
840 "or missing value\n", p);
841 status = 0;
842 goto bail;
843 }
844 }

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

881
882 if (osb->s_atime_quantum != OCFS2_DEFAULT_ATIME_QUANTUM)
883 seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum);
884
885 if (osb->osb_commit_interval)
886 seq_printf(s, ",commit=%u",
887 (unsigned) (osb->osb_commit_interval / HZ));
888
851 default:
852 mlog(ML_ERROR,
853 "Unrecognized mount option \"%s\" "
854 "or missing value\n", p);
855 status = 0;
856 goto bail;
857 }
858 }

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

895
896 if (osb->s_atime_quantum != OCFS2_DEFAULT_ATIME_QUANTUM)
897 seq_printf(s, ",atime_quantum=%u", osb->s_atime_quantum);
898
899 if (osb->osb_commit_interval)
900 seq_printf(s, ",commit=%u",
901 (unsigned) (osb->osb_commit_interval / HZ));
902
903 if (osb->local_alloc_size != OCFS2_DEFAULT_LOCAL_ALLOC_SIZE)
904 seq_printf(s, ",localalloc=%d", osb->local_alloc_size);
905
889 return 0;
890}
891
892static int __init ocfs2_init(void)
893{
894 int status;
895
896 mlog_entry_void();

--- 889 unchanged lines hidden ---
906 return 0;
907}
908
909static int __init ocfs2_init(void)
910{
911 int status;
912
913 mlog_entry_void();

--- 889 unchanged lines hidden ---