1// SPDX-License-Identifier: GPL-2.0
2/*
3 * fs/f2fs/super.c
4 *
5 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
6 * http://www.samsung.com/
7 */
8#include <linux/module.h>

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

158 Opt_compress_chksum,
159 Opt_compress_mode,
160 Opt_compress_cache,
161 Opt_atgc,
162 Opt_gc_merge,
163 Opt_nogc_merge,
164 Opt_discard_unit,
165 Opt_memory_mode,
166 Opt_age_extent_cache,
167 Opt_err,
168};
169
170static match_table_t f2fs_tokens = {
171 {Opt_gc_background, "background_gc=%s"},
172 {Opt_disable_roll_forward, "disable_roll_forward"},
173 {Opt_norecovery, "norecovery"},
174 {Opt_discard, "discard"},

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

237 {Opt_compress_chksum, "compress_chksum"},
238 {Opt_compress_mode, "compress_mode=%s"},
239 {Opt_compress_cache, "compress_cache"},
240 {Opt_atgc, "atgc"},
241 {Opt_gc_merge, "gc_merge"},
242 {Opt_nogc_merge, "nogc_merge"},
243 {Opt_discard_unit, "discard_unit=%s"},
244 {Opt_memory_mode, "memory=%s"},
245 {Opt_age_extent_cache, "age_extent_cache"},
246 {Opt_err, NULL},
247};
248
249void f2fs_printk(struct f2fs_sb_info *sbi, const char *fmt, ...)
250{
251 struct va_format vaf;
252 va_list args;
253 int level;

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

1254 F2FS_OPTION(sbi).memory_mode =
1255 MEMORY_MODE_LOW;
1256 } else {
1257 kfree(name);
1258 return -EINVAL;
1259 }
1260 kfree(name);
1261 break;
1262 case Opt_age_extent_cache:
1263 set_opt(sbi, AGE_EXTENT_CACHE);
1264 break;
1265 default:
1266 f2fs_err(sbi, "Unrecognized mount option \"%s\" or missing value",
1267 p);
1268 return -EINVAL;
1269 }
1270 }
1271default_check:
1272#ifdef CONFIG_QUOTA

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

1958 else
1959 seq_puts(seq, ",barrier");
1960 if (test_opt(sbi, FASTBOOT))
1961 seq_puts(seq, ",fastboot");
1962 if (test_opt(sbi, READ_EXTENT_CACHE))
1963 seq_puts(seq, ",extent_cache");
1964 else
1965 seq_puts(seq, ",noextent_cache");
1966 if (test_opt(sbi, AGE_EXTENT_CACHE))
1967 seq_puts(seq, ",age_extent_cache");
1968 if (test_opt(sbi, DATA_FLUSH))
1969 seq_puts(seq, ",data_flush");
1970
1971 seq_puts(seq, ",mode=");
1972 if (F2FS_OPTION(sbi).fs_mode == FS_MODE_ADAPTIVE)
1973 seq_puts(seq, "adaptive");
1974 else if (F2FS_OPTION(sbi).fs_mode == FS_MODE_LFS)
1975 seq_puts(seq, "lfs");

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

2221 struct f2fs_mount_info org_mount_opt;
2222 unsigned long old_sb_flags;
2223 int err;
2224 bool need_restart_gc = false, need_stop_gc = false;
2225 bool need_restart_ckpt = false, need_stop_ckpt = false;
2226 bool need_restart_flush = false, need_stop_flush = false;
2227 bool need_restart_discard = false, need_stop_discard = false;
2228 bool no_read_extent_cache = !test_opt(sbi, READ_EXTENT_CACHE);
2229 bool no_age_extent_cache = !test_opt(sbi, AGE_EXTENT_CACHE);
2230 bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT);
2231 bool no_io_align = !F2FS_IO_ALIGNED(sbi);
2232 bool no_atgc = !test_opt(sbi, ATGC);
2233 bool no_discard = !test_opt(sbi, DISCARD);
2234 bool no_compress_cache = !test_opt(sbi, COMPRESS_CACHE);
2235 bool block_unit_discard = f2fs_block_unit_discard(sbi);
2236 struct discard_cmd_control *dcc;
2237#ifdef CONFIG_QUOTA

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

2316 }
2317
2318 /* disallow enable/disable extent_cache dynamically */
2319 if (no_read_extent_cache == !!test_opt(sbi, READ_EXTENT_CACHE)) {
2320 err = -EINVAL;
2321 f2fs_warn(sbi, "switch extent_cache option is not allowed");
2322 goto restore_opts;
2323 }
2324 /* disallow enable/disable age extent_cache dynamically */
2325 if (no_age_extent_cache == !!test_opt(sbi, AGE_EXTENT_CACHE)) {
2326 err = -EINVAL;
2327 f2fs_warn(sbi, "switch age_extent_cache option is not allowed");
2328 goto restore_opts;
2329 }
2330
2331 if (no_io_align == !!F2FS_IO_ALIGNED(sbi)) {
2332 err = -EINVAL;
2333 f2fs_warn(sbi, "switch io_bits option is not allowed");
2334 goto restore_opts;
2335 }
2336
2337 if (no_compress_cache == !!test_opt(sbi, COMPRESS_CACHE)) {

--- 2466 unchanged lines hidden ---