super.c (12607c1ba7637e750402f555b6695c50fce77a2b) super.c (71644dff481180ba024ac4f5cb1f068756357adf)
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,
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,
166 Opt_err,
167};
168
169static match_table_t f2fs_tokens = {
170 {Opt_gc_background, "background_gc=%s"},
171 {Opt_disable_roll_forward, "disable_roll_forward"},
172 {Opt_norecovery, "norecovery"},
173 {Opt_discard, "discard"},

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

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

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

1252 F2FS_OPTION(sbi).memory_mode =
1253 MEMORY_MODE_LOW;
1254 } else {
1255 kfree(name);
1256 return -EINVAL;
1257 }
1258 kfree(name);
1259 break;
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;
1260 default:
1261 f2fs_err(sbi, "Unrecognized mount option \"%s\" or missing value",
1262 p);
1263 return -EINVAL;
1264 }
1265 }
1266default_check:
1267#ifdef CONFIG_QUOTA

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

1953 else
1954 seq_puts(seq, ",barrier");
1955 if (test_opt(sbi, FASTBOOT))
1956 seq_puts(seq, ",fastboot");
1957 if (test_opt(sbi, READ_EXTENT_CACHE))
1958 seq_puts(seq, ",extent_cache");
1959 else
1960 seq_puts(seq, ",noextent_cache");
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");
1961 if (test_opt(sbi, DATA_FLUSH))
1962 seq_puts(seq, ",data_flush");
1963
1964 seq_puts(seq, ",mode=");
1965 if (F2FS_OPTION(sbi).fs_mode == FS_MODE_ADAPTIVE)
1966 seq_puts(seq, "adaptive");
1967 else if (F2FS_OPTION(sbi).fs_mode == FS_MODE_LFS)
1968 seq_puts(seq, "lfs");

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

2214 struct f2fs_mount_info org_mount_opt;
2215 unsigned long old_sb_flags;
2216 int err;
2217 bool need_restart_gc = false, need_stop_gc = false;
2218 bool need_restart_ckpt = false, need_stop_ckpt = false;
2219 bool need_restart_flush = false, need_stop_flush = false;
2220 bool need_restart_discard = false, need_stop_discard = false;
2221 bool no_read_extent_cache = !test_opt(sbi, READ_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);
2222 bool enable_checkpoint = !test_opt(sbi, DISABLE_CHECKPOINT);
2223 bool no_io_align = !F2FS_IO_ALIGNED(sbi);
2224 bool no_atgc = !test_opt(sbi, ATGC);
2225 bool no_discard = !test_opt(sbi, DISCARD);
2226 bool no_compress_cache = !test_opt(sbi, COMPRESS_CACHE);
2227 bool block_unit_discard = f2fs_block_unit_discard(sbi);
2228 struct discard_cmd_control *dcc;
2229#ifdef CONFIG_QUOTA

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

2308 }
2309
2310 /* disallow enable/disable extent_cache dynamically */
2311 if (no_read_extent_cache == !!test_opt(sbi, READ_EXTENT_CACHE)) {
2312 err = -EINVAL;
2313 f2fs_warn(sbi, "switch extent_cache option is not allowed");
2314 goto restore_opts;
2315 }
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 }
2316
2317 if (no_io_align == !!F2FS_IO_ALIGNED(sbi)) {
2318 err = -EINVAL;
2319 f2fs_warn(sbi, "switch io_bits option is not allowed");
2320 goto restore_opts;
2321 }
2322
2323 if (no_compress_cache == !!test_opt(sbi, COMPRESS_CACHE)) {

--- 2466 unchanged lines hidden ---
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 ---