f2fs-tools: do not support user-space cache
PATCH 1/1 f2fs-tools: do not support user-space cache
From: Daeho Jeong <[email protected]>
We don't have lots of benefits from this, since block devices already have page caches in the kernel. Moreover, this feature has some stability issues corrupting metadata. So, we better make this deprecated.
Signed-off-by Daeho Jeong <[email protected]>
--- fsck/main.c | 18 +-- include/f2fs_fs.h | 18 --- lib/libf2fs_io.c | 329 ---------------------------------------------- 3 files changed, 2 insertions(+), 363 deletions(-)
fsck/main.c +2 -16
@@ -10,9 +10,6 @@* Liu Shuoran <[email protected]> * Jaegeuk Kim <[email protected]> * : add sload.f2fs -* Copyright (c) 2019 Google Inc. -* Robin Hsu <[email protected]> -* : add cache layer * Copyright (c) 2020 Google Inc. * Robin Hsu <[email protected]> * : add sload compression support
@@ -26,7 +23,6 @@#include <ctype.h> #include <time.h> #include <getopt.h> -#include <stdbool.h> #include "quotaio.h" #include "compress.h"
@@ -59,10 +55,6 @@ void fsck_usage()MSG (0 ,"\nUsage: fsck.f2fs [options] device\n" );MSG (0 ,"[options]:\n" );MSG (0 ," -a check/fix potential corruption, reported by f2fs\n" ); -MSG (0 ," -c <num-cache-entry> set number of cache entries" -" (default 0)\n" ); -MSG (0 ," -m <max-hash-collision> set max cache hash collision" -" (default 16)\n" );MSG (0 ," -C encoding[:flag1,flag2] Set options for enabling" " casefolding\n" );MSG (0 ," -d debug level [default:0]\n" );
@@ -80,7 +72,6 @@ void fsck_usage()MSG (0 ," --dry-run do not really fix corruptions\n" );MSG (0 ," --no-kernel-check skips detecting kernel change\n" );MSG (0 ," --kernel-check checks kernel change\n" ); -MSG (0 ," --debug-cache to debug cache when -c is used\n" );exit (1 ); }
@@ -241,8 +232,6 @@ void f2fs_parse_options(int argc, char *argv[]) }; c.func =FSCK ; - c.cache_config.max_hash_collision =16 ; - c.cache_config.dbg_en = false;while ((option =getopt_long (argc, argv, option_string, long_opt, &opt)) !=EOF ) {switch (option) {
@@ -259,18 +248,15 @@ void f2fs_parse_options(int argc, char *argv[])MSG (0 ,"Info: Do Kernel Check\n" );break ;case 4 : - c.cache_config.dbg_en = true; +MSG (0 ,"Info: Deprecated option \"debug-cache\"\n" );break ;case 'a' : c.auto_fix =1 ;MSG (0 ,"Info: Fix the reported corruption.\n" );break ;case 'c' : - c.cache_config.num_cache_entry =atoi (optarg); -break ;case 'm' : - c.cache_config.max_hash_collision = -atoi (optarg); +MSG (0 ,"Info: Deprecated option \'%c\'\n" , option);break ;case 'g' :if (!strcmp (optarg,"android" )) {
include/f2fs_fs.h +0 -18
@@ -3,8 +3,6 @@* * Copyright (c) 2012 Samsung Electronics Co., Ltd. * http://www.samsung.com/ -* Copyright (c) 2019 Google Inc. -* http://www.google.com/ * Copyright (c) 2020 Google Inc. * Robin Hsu <[email protected]> * : add sload compression support
@@ -443,16 +441,6 @@ struct device_info {size_t *zone_cap_blocks; }; -typedef struct { -/* Value 0 means no cache, minimum 1024 */ -long num_cache_entry; - -/* Value 0 means always overwrite (no collision allowed). maximum 16 */ -unsigned max_hash_collision; - -bool dbg_en; -}dev_cache_config_t ; -/* f2fs_configration for compression used for sload.f2fs */ typedef struct { void (*init)(struct compress_ctx *cc);
@@ -1471,9 +1459,6 @@ struct f2fs_configuration {/* precomputed fs UUID checksum for seeding other checksums */ uint32_t chksum_seed; -/* cache parameters */ -dev_cache_config_t cache_config; -/* compression support for sload.f2fs */ compress_config_t compress;
@@ -1519,9 +1504,6 @@ extern void f2fs_release_sparse_resource(void);extern int f2fs_finalize_device (void );extern int f2fs_fsync_device (void ); -extern void dcache_init (void ); -extern void dcache_release (void ); -extern int dev_read (void *,__u64 ,size_t );#ifdef POSIX_FADV_WILLNEED extern int dev_readahead (__u64 ,size_t );
lib/libf2fs_io.c +0 -329
365 lines not on this page · raw message
Signature · 1 line
2.42.0.582.g8ccd20d70d-goog
Quoted 7 lines · Daeho Jeong
From: Daeho Jeong <[email protected]>
We don't have lots of benefits from this, since block devices already have page caches in the kernel. Moreover, this feature has some stability issues corrupting metadata. So, we better make this deprecated.
Signed-off-by Daeho Jeong <[email protected]>
Reviewed-by Chao Yu <[email protected]>
Thanks,