From ec44ef84f81e229155b45134c0e5a7fb7d5796f8 Mon Sep 17 00:00:00 2001 From: gueFDF <3237455241@qq.com> Date: Wed, 13 Sep 2023 16:29:07 +0800 Subject: [PATCH] add: patch for dcache parameter support --- add-dcache-parameter-support.patch | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 add-dcache-parameter-support.patch diff --git a/add-dcache-parameter-support.patch b/add-dcache-parameter-support.patch new file mode 100644 index 0000000..ba5f578 --- /dev/null +++ b/add-dcache-parameter-support.patch @@ -0,0 +1,49 @@ +diff --git a/super.c b/super.c +index 18f222c..aee7d47 100644 +--- a/super.c ++++ b/super.c +@@ -21,6 +21,9 @@ enum { + OPT_NO_OFFLINE_STASH, + OPT_NO_DENTRY_CACHE, + OPT_USER_ID, ++ OPT_DCACHE_THRESHOLD, ++ OPT_DCACHE_PRECISION, ++ OPT_DCACHE_TIMEOUT, + OPT_ERR, + }; + +@@ -33,6 +36,9 @@ static match_table_t hmdfs_tokens = { + { OPT_NO_OFFLINE_STASH, "no_offline_stash" }, + { OPT_NO_DENTRY_CACHE, "no_dentry_cache" }, + { OPT_USER_ID, "user_id=%s"}, ++ {OPT_DCACHE_THRESHOLD, "dcache_threshold=%d"}, ++ {OPT_DCACHE_PRECISION, "dcache_precision=%d"}, ++ {OPT_DCACHE_TIMEOUT, "dcache_timeout=%d"}, + { OPT_ERR, NULL }, + }; + +@@ -150,6 +156,24 @@ int hmdfs_parse_options(struct hmdfs_sb_info *sbi, const char *data) + sbi->user_id = user_id; + } + break; ++ case OPT_DCACHE_THRESHOLD: ++ err = match_int(&args[0], &decache); ++ if (err) ++ goto out; ++ sbi->dcache_threshold = decache; ++ break; ++ case OPT_DCACHE_PRECISION: ++ err = match_int(&args[0], &decache); ++ if (err) ++ goto out; ++ sbi->dcache_precision = decache; ++ break; ++ case OPT_DCACHE_TIMEOUT: ++ err = match_int(&args[0], &decache); ++ if (err) ++ goto out; ++ sbi->dcache_timeout = decache; ++ break; + default: + err = -EINVAL; + goto out; -- Gitee