diff options
author | Yuezhang Mo <Yuezhang.Mo@sony.com> | 2023-07-20 14:40:08 +0800 |
---|---|---|
committer | Namjae Jeon <linkinjeon@kernel.org> | 2023-10-31 10:01:45 +0900 |
commit | ee785c15b5906a69d4007b4754e8ae40fb41e0b4 (patch) | |
tree | d5960f2815f9fa05ae3310aadad0670aebee52a4 /fs/exfat/super.c | |
parent | dab48b8f2fe7264d51ec9eed0adea0fe3c78830a (diff) | |
download | lwn-ee785c15b5906a69d4007b4754e8ae40fb41e0b4.tar.gz lwn-ee785c15b5906a69d4007b4754e8ae40fb41e0b4.zip |
exfat: support create zero-size directory
This commit adds mount option 'zero_size_dir'. If this option
enabled, don't allocate a cluster to directory when creating
it, and set the directory size to 0.
On Windows, a cluster is allocated for a directory when it is
created, so the mount option is disabled by default.
Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Reviewed-by: Aoyama Wataru <wataru.aoyama@sony.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'fs/exfat/super.c')
-rw-r--r-- | fs/exfat/super.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/exfat/super.c b/fs/exfat/super.c index ecee1664ab7f..d9d4fa91010b 100644 --- a/fs/exfat/super.c +++ b/fs/exfat/super.c @@ -165,6 +165,8 @@ static int exfat_show_options(struct seq_file *m, struct dentry *root) seq_puts(m, ",sys_tz"); else if (opts->time_offset) seq_printf(m, ",time_offset=%d", opts->time_offset); + if (opts->zero_size_dir) + seq_puts(m, ",zero_size_dir"); return 0; } @@ -209,6 +211,7 @@ enum { Opt_keep_last_dots, Opt_sys_tz, Opt_time_offset, + Opt_zero_size_dir, /* Deprecated options */ Opt_utf8, @@ -237,6 +240,7 @@ static const struct fs_parameter_spec exfat_parameters[] = { fsparam_flag("keep_last_dots", Opt_keep_last_dots), fsparam_flag("sys_tz", Opt_sys_tz), fsparam_s32("time_offset", Opt_time_offset), + fsparam_flag("zero_size_dir", Opt_zero_size_dir), __fsparam(NULL, "utf8", Opt_utf8, fs_param_deprecated, NULL), __fsparam(NULL, "debug", Opt_debug, fs_param_deprecated, @@ -305,6 +309,9 @@ static int exfat_parse_param(struct fs_context *fc, struct fs_parameter *param) return -EINVAL; opts->time_offset = result.int_32; break; + case Opt_zero_size_dir: + opts->zero_size_dir = true; + break; case Opt_utf8: case Opt_debug: case Opt_namecase: |