Commit Graph

1161 Commits

Author SHA1 Message Date
Andrew Gaul
7bb9609827
Return errors from AutoFdEntity::Open (#2296)
Found via pjdfstest which creates a PATH_MAX path that should return
NAMETOOLONG.
2023-08-29 22:57:30 +09:00
Andrew Gaul
82107f4b6c
Skip is_uid_include_group when GID available (#2292)
This can avoid an expensive computation which is 20% of test runtime.
2023-08-27 15:24:33 +09:00
Eryu Guan
ee49ca4abf
s3fs: print fuse context in s3fs fuse operations (#2274)
Print fuse context like pid in fuse operations, so we know which process
is triggering this operation.

Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
2023-08-27 14:00:57 +09:00
Andrew Gaul
48548f0896
Remove unused functions (#2289) 2023-08-22 23:17:43 +09:00
Andrew Gaul
981e97ee76
Use default move constructor (#2288)
This is identical to the explicit one.
2023-08-22 23:14:09 +09:00
Andrew Gaul
a568aa70fd
Replace uses of emplace with operator=(&&) (#2287)
emplace does not overwrite the value if the key already exists.  C++17 has
insert_or_assign but C++11 only has operator= which invokes the default
constructor.  Follows on to 6781ef5bd1.
2023-08-22 23:12:12 +09:00
Takeshi Nakatani
218adcb29b
Fixed errors in cache.cpp from cppcheck 2.11.1 (#2286) 2023-08-20 19:00:20 +09:00
Andrew Gaul
6c55bcfdd8
Own values in add_header (#2285)
Also fix up indentation.
2023-08-20 18:59:18 +09:00
Andrew Gaul
8d04ee3e01
Own values in stat_cache and symlink_cache (#2284)
This removes an unnecessary use of unique_ptr.
2023-08-20 12:10:47 +09:00
Takeshi Nakatani
6781ef5bd1 Reverted to direct array access instead of std::map emplace 2023-08-20 09:44:38 +09:00
Andrew Gaul
7e94b64ae7
Use unique_ptr in SSL functions (#2282)
References #2261.
2023-08-19 23:29:00 +09:00
Andrew Gaul
50f6c38c84
Replace xattr_value with std::string (#2280) 2023-08-19 11:12:43 +09:00
Takeshi Nakatani
280ed5d706
Additional fix for #2276(Convert BodyData to std::string) (#2278) 2023-08-18 00:35:50 +09:00
Andrew Gaul
2518ff3568
Convert BodyData to std::string (#2276)
This is simpler and avoids some copies.
2023-08-17 22:49:41 +09:00
Andrew Gaul
c65ce8a42c
Add clang-tidy to CI (#2270) 2023-08-17 22:42:11 +09:00
Andrew Gaul
b2bb12fd2c
Remove unneeded explicit std::string constructors (#2273)
std::string(const char*) implicitly constructs these.  The remaining call sites
requires string literals from C++14.
2023-08-17 22:12:28 +09:00
Andrew Gaul
7f30353fb9
Return std::unique_ptr from S3fsCurl callbacks (#2272)
References #2261.
2023-08-17 22:08:56 +09:00
Andrew Gaul
67e6b9e495
Simplify xattr_value with owned values (#2262)
References #2261.
2023-08-15 22:54:46 +09:00
Andrew Gaul
6823c5a7ec
Enable clang-tidy cppcoreguidelines (#2269) 2023-08-15 22:12:33 +09:00
Andrew Gaul
d1272d296a
Tighten up CLI argument handling (#2268)
This ensures that each option is only handled once.
2023-08-15 21:45:38 +09:00
Andrew Gaul
d120e54284
Improve illegal bucket name error message (#2263)
This may help users debug situations like:

https://stackoverflow.com/questions/76359564/why-does-mounting-s3fs-bucket-on-centos-7-using-fstab-fail-but-mount-a-works
2023-08-15 21:31:05 +09:00
Andrew Gaul
e157d811cb
Use std::string::compare and operator== where possible (#2256) 2023-08-15 21:22:36 +09:00
Andrew Gaul
56a4e67009
Replace more raw pointers with std::unique_ptr (#2255) 2023-08-14 00:03:10 +09:00
Takeshi Nakatani
5b93765802 Fixed a warning for compiling C/C++ codes 2023-08-13 20:49:39 +09:00
Takeshi Nakatani
acea1d33f9 Fixed string test for s3fs_base64 2023-08-13 20:48:38 +09:00
Andrew Gaul
528a61718d
Convert manual memory allocations to std::unique_ptr (#2253) 2023-08-11 23:26:07 +09:00
Andrew Gaul
c5a75a1fb2
Delete copy constructors and assignment operators (#2257)
One of these was buggy and others had the wrong parameters and return
types.
2023-08-11 13:12:03 +09:00
Andrew Gaul
3790a0f8b4
Calculate MD5 without using a temporary file (#2252)
This mirrors the SHA256 code.
2023-08-07 00:17:15 +09:00
Andrew Gaul
779afe5d62
Make help more consistent (#2251) 2023-08-06 22:25:10 +09:00
Andrew Gaul
26b5658d70
Wrap ps3fscred with std::unique_ptr (#2250)
This removes many manual memory deallocations.
2023-08-06 22:23:25 +09:00
Andrew Gaul
c568a69452
Return std::string from base64 encoding function (#2248)
This is avoids manual memory allocations.
2023-08-06 22:22:02 +09:00
Andrew Gaul
13ad53eef7
Convert most std::list to std::vector (#2247)
This tends to be more efficient due to fewer allocations.  Also fix std::sort
comparator which should be strictly less than.
2023-08-05 10:05:32 +09:00
Andrew Gaul
b5c3fc0a08
Convert fixed-size allocations to C++11 std::array (#2242)
This is safer and more efficient.
2023-08-05 09:36:22 +09:00
Andrew Gaul
b29f8d0f2b
Use C++ enum class for most enums (#2241)
This promotes type-safety.
2023-07-30 22:53:17 +09:00
Andrew Gaul
5699875e30
Use C++11 emplace where possible (#2240)
This is more concise and sometimes more efficient.
2023-07-30 22:51:20 +09:00
Andrew Gaul
a7b38a6940
Address stray warnings (#2237) 2023-07-29 09:19:18 +09:00
Andrew Gaul
1f04165a33
Convert most str callers to C++11 std::to_string (#2238)
Remaining ones handle timespec.
2023-07-28 18:21:55 +09:00
Andrew Gaul
36db898d01
Use C++11 std::map::erase return value (#2236) 2023-07-27 23:34:43 +09:00
Andrew Gaul
a4a2841c05
Use C++11 nullptr instead of 0 or NULL (#2234)
This improves type-safety.
2023-07-27 21:56:58 +09:00
Andrew Gaul
0ece204393 Fix -Wshorten-64-to-32 warnings 2023-07-27 12:23:26 +09:00
Andrew Gaul
6344d74ae3
Replace some raw pointers with std::unique_ptr (#2195)
This simplifies code paths and makes memory leaks less likely.  It
also makes memory ownership more explicit by requiring std::move.
This commit requires C++11.  References #2179.
2023-07-27 09:12:28 +09:00
Takeshi Nakatani
faec0d9d15 Refixed for cppcheck 2.1x 2023-07-26 07:55:33 +09:00
Takeshi Nakatani
cb3dc28e6e Supported cppcheck 2.10(and changed std from c++03 to c++11 for RHEL7) 2023-07-25 08:08:06 +09:00
Andrew Gaul
2405706643
Insert SSE headers when appropriate (#2228)
References #2218.  References #2227.
2023-07-23 16:17:34 +09:00
Eryu Guan
7978395083 Use smart pointer to manage pcfstat object
Previously pcfstat points to a raw pointer, and it may be leaked if
function returned before deleting it.

So use smart pointer to automatically release the object.

Note that currently s3fs only uses c++03, so we use auto_ptr here, not
unique_ptr, which requires c++11.

Fixes: 6ca5a24a7f ("Fix two inconsistency issues between stat cache and cache file (#2152)")
Signed-off-by: Eryu Guan <eguan@linux.alibaba.com>
2023-07-19 20:15:55 +09:00
Takeshi Nakatani
d0a944fcaa Fixed data race about fuse_fill_dir_t function and data pointer 2023-07-14 22:32:12 +09:00
Andrew Gaul
537384e9b5
Guard filler calls with filled check (#2215)
Follows on to e650d8c55c.
2023-07-13 22:46:19 +09:00
Andrew Gaul
e650d8c55c
Explicitly handle CommonPrefixes with nocompat_dir (#2212)
Previously the test missed listing implicit directories and another
test was incorrect.  This fixes a regression from 1.91.
2023-07-13 21:15:34 +09:00
Takeshi Nakatani
9663215bb4 Fixed data race at OPENSSL_sk_dup/free in libcurl 2023-07-12 22:51:57 +09:00
Takeshi Nakatani
b2537052ef Fixed data race in threads found thread sanitizer 2023-07-09 20:53:27 +09:00