Enable notsup_compat_dir by default (#1970)

Few applications create the dir_$folder$ objects and users can enable
compat_dir if required.  This commit reduces readdir latency by 33%.
Also remove notsup_compat_dir from tests since these directories are
never created.  Fixes #927.  References #1643.
This commit is contained in:
Andrew Gaul 2022-06-28 07:56:06 +09:00 committed by GitHub
parent ac72bf34dd
commit 8b90cd6ba1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 15 deletions

View File

@ -331,15 +331,13 @@ This name will be added to logging messages and user agent headers sent by s3fs.
s3fs complements lack of information about file/directory mode if a file or a directory object does not have x-amz-meta-mode header.
As default, s3fs does not complements stat information for a object, then the object will not be able to be allowed to list/modify.
.TP
\fB\-o\fR notsup_compat_dir (disable support of alternative directory names)
\fB\-o\fR compat_dir (enable support of alternative directory names)
.RS
s3fs supports the three different naming schemas "dir/", "dir" and "dir_$folder$" to map directory names to S3 objects and vice versa. As a fourth variant, directories can be determined indirectly if there is a file object with a path (e.g. "/dir/file") but without the parent directory.
s3fs supports two different naming schemas "dir/" and "dir" to map directory names to S3 objects and vice versa by default. As a third variant, directories can be determined indirectly if there is a file object with a path (e.g. "/dir/file") but without the parent directory. This option enables a fourth variant, "dir_$folder$", created by older applications.
.TP
S3fs uses only the first schema "dir/" to create S3 objects for directories.
.TP
The support for these different naming schemas causes an increased communication effort.
.TP
If all applications exclusively use the "dir/" naming scheme and the bucket does not contain any objects with a different naming scheme, this option can be used to disable support for alternative naming schemes. This reduces access time and can save costs.
.RE
.TP
\fB\-o\fR use_wtf8 - support arbitrary file system encoding.

View File

@ -90,7 +90,7 @@ static off_t multipart_threshold = 25 * 1024 * 1024;
static int64_t singlepart_copy_limit = 512 * 1024 * 1024;
static bool is_specified_endpoint = false;
static int s3fs_init_deferred_exit_status = 0;
static bool support_compat_dir = true;// default supports compatibility directory type
static bool support_compat_dir = false;// default does not support compatibility directory type
static int max_keys_list_object = 1000;// default is 1000
static off_t max_dirty_data = 5LL * 1024LL * 1024LL * 1024LL;
static bool use_wtf8 = false;
@ -4164,9 +4164,15 @@ static int my_fuse_opt_proc(void* data, const char* arg, int key, struct fuse_ar
return 0;
}
if(0 == strcmp(arg, "notsup_compat_dir")){
S3FS_PRN_WARN("notsup_compat_dir is enabled by default and a future version will remove this option.");
support_compat_dir = false;
return 0;
}
if(0 == strcmp(arg, "compat_dir")){
support_compat_dir = true;
return 0;
}
if(0 == strcmp(arg, "enable_content_md5")){
S3fsCurl::SetContentMd5(true);
return 0;

View File

@ -412,23 +412,20 @@ static const char help_string[] =
" for a object, then the object will not be able to be allowed to\n"
" list/modify.\n"
"\n"
" notsup_compat_dir (disable support of alternative directory names)\n"
" s3fs supports the three different naming schemas \"dir/\",\n"
" \"dir\" and \"dir_$folder$\" to map directory names to S3\n"
" objects and vice versa. As a fourth variant, directories can be\n"
" compat_dir (enable support of alternative directory names)\n"
" s3fs supports two different naming schemas \"dir/\" and\n"
" \"dir\" to map directory names to S3 objects and\n"
" vice versa by default. As a third variant, directories can be\n"
" determined indirectly if there is a file object with a path (e.g.\n"
" \"/dir/file\") but without the parent directory.\n"
" This option enables a fourth variant, \"dir_$folder$\", created by\n"
" older applications.\n"
" \n"
" S3fs uses only the first schema \"dir/\" to create S3 objects for\n"
" directories."
" \n"
" The support for these different naming schemas causes an increased\n"
" communication effort.\n"
" \n"
" If all applications exclusively use the \"dir/\" naming scheme and\n"
" the bucket does not contain any objects with a different naming \n"
" scheme, this option can be used to disable support for alternative\n"
" naming schemes. This reduces access time and can save costs.\nq"
"\n"
" use_wtf8 - support arbitrary file system encoding.\n"
" S3 requires all object names to be valid UTF-8. But some\n"

View File

@ -48,7 +48,6 @@ if [ -n "${ALL_TESTS}" ]; then
"max_stat_cache_size=100"
nocopyapi
nomultipart
notsup_compat_dir
sigv2
sigv4
"singlepart_copy_limit=10" # limit size to exercise multipart code paths