Commit Graph

364 Commits

Author SHA1 Message Date
arvidn 549db2beb9 fix comment 2020-01-14 14:20:19 +01:00
Pavel Pimenov c7c7cd41d2 remove m_inode 2020-01-04 23:03:46 +01:00
arvidn f4f1425115 use UNC paths pervasively on windows 2019-01-12 21:00:40 +01:00
Alden Torres 6b04c4f642 removed unused file::sparse_end 2019-01-11 02:02:06 +01:00
Alden Torres 94d737ff77 removed unused directory::inode() 2019-01-06 17:21:34 +01:00
Arvid Norberg 8abce44708 restore permissions on directories to 1.1. i.e. rely on umask 2018-12-28 12:45:28 +01:00
arvidn 5383854768 make span's and sha1_hash's index and size types signed (instead of unsigned). Specifically std::ptrdiff_t. In line with the direction of gsl span and reduce signed->unsigned casts 2018-11-16 14:06:22 +01:00
arvidn 3fb05d77d8 fix warnings 2018-10-20 20:56:26 +02:00
arvidn 55215742af merged RC_1_1 into master 2018-08-25 14:13:51 +02:00
Arvid Norberg 6e80f1f615 improve handling of filesystems not supporting fallocate() 2018-08-22 08:35:22 +02:00
arvidn 3416da41d9 fix narrowing warning 2018-08-03 21:02:44 +02:00
Arvid Norberg 8f0cf7e1a9 some refactor to reduce duplicate code 2018-07-25 18:48:34 +02:00
arvidn 52af3eaa7f simplify preadv and pwritev emulation functions 2018-07-14 09:03:15 +02:00
Andrei Kurushin 7a34b27499 fix Windows "file::preadv" emulation EOF handling 2018-07-12 23:54:34 +02:00
Andrei Kurushin 5399a14027 Windows async read EOF handling (#3162)
fix Windows "file::preadv" emulation EOF handling
2018-07-12 23:30:50 +02:00
arvidn 59343f4f95 merged RC_1_1 into master 2018-07-12 20:20:02 +02:00
d-komarov 490d8eb328 Fix previous patch fixing deadlock in DllMain (#3158)
Simplify `get_manage_volume_privs()` and renamed it
2018-07-12 16:46:36 +02:00
Arvid Norberg 3fede4b223 merged RC_1_1 into master 2018-07-08 11:55:32 +02:00
d_komarov 1c86e94de6 Fix deadlock when loading libtorrent Dll
Definition of `bool file::has_manage_volume_privs` involves a call to
`get_manage_volume_privs()`, causing restricted tasks to be performed
from within `DllMain` function. They introduce possibility that client
application deadlocks or crashes.

You should never perform the following tasks from within DllMain:

* Call `LoadLibrary` or `LoadLibraryEx` (either directly or indirectly).
  This can cause a deadlock or a crash.

* Call the registry functions. These functions are implemented in
  'Advapi32.dll'. If not initialized before your DLL, it can access
  uninitialized memory and cause the process to crash.
2018-07-07 18:00:07 +02:00
arvidn 16b32741ce fix coalesce read bug 2018-06-23 21:46:52 +02:00
Steven Siloti 396c5dd3af remove use of deprecated function readdir_r
Ports 140b8ace onto RC_1_1 branch
2018-05-28 16:06:41 +02:00
arvidn 3b0ce8d2e1 merged RC_1_1 into master 2018-05-28 15:56:22 +02:00
arvidn 77191a3820 fix hidden attribute in file class 2018-05-23 10:39:10 +02:00
arvidn f0227451a6 merged RC_1_1 into master 2018-04-13 01:47:41 +02:00
Alden Torres 9b1e79660f removed unnecessary parentheses around min/max, added some const modifier (#2926) 2018-04-11 15:19:00 +02:00
arvidn aaf9304a3b update year in copyright header 2018-04-09 09:04:33 +02:00
arvidn 9df4d4b7f8 replace typedef with using. replace NULL with nullptr. cleanup page_aligned_allocator 2018-03-23 11:19:46 +01:00
arvidn 720bfa54cd merged RC_1_1 into master 2018-01-29 01:20:08 +01:00
arvidn b729021625 make coalesce-buffers work on windows and systemps with pwritev()/preadv() 2018-01-28 23:05:01 +01:00
arvidn f29bb69612 fix error handling of unsupported hard-links 2018-01-13 08:36:48 -05:00
arvidn 65fef972a2 apply some c++11 modernization 2018-01-11 04:51:39 -05:00
arvidn 244d18dcf8 merged RC_1_1 into master 2017-10-17 09:38:51 +02:00
arvidn 205fe5e7ea fix full allocation failure on APFS 2017-10-16 00:08:10 +02:00
Andrei Kurushin c8d51689bb backport: fix windows file preallocation issue 2017-09-28 12:53:28 -07:00
Andrei Kurushin 6e396a85c2 fix windows file preallocation issue 2017-09-28 02:14:20 +03:00
arvidn 65d16142aa remove redundant null check 2017-09-18 00:51:26 +02:00
Steven Siloti 0232dc35cd deprecate lock_files (#2344)
File locking interacts poorly with the path to replace a read only file handle
with a read/write one. For performance reasons the old handle is not closed
until the new one is put in place. With file locking this obviously cannot
work because the first handle is holding a lock on the file. As a result,
file_pool::open_file fails in this case. Even if we dropped the reference to
the read only file handle before attempting to re-open it, the open could still
fail if another thread is holding a reference to the read only handle.

There doesn't seem to be a good way around this. The simple solution would be
to always open files in read/write mode, but that has obvious safety downsides.
Any other solution would significantly complicate the file pool code.
Deprecating file locking seems to be the least bad option.
2017-09-17 10:43:27 +02:00
Alden Torres 582d9dfc24 removed leading :: in posix_fadvise to allow for fix in old android API build (#2341) 2017-09-16 13:47:49 +02:00
arvidn 93bb84d94c some random cleanup 2017-09-13 08:28:46 +02:00
Alden Torres cb114a80e1 reverted ino_t cast and added fix only for android 2017-08-04 21:22:20 +02:00
Alden Torres 35232a5a5f fixed -Wshorten-64-to-32 in 32 bits and explicit nullptr check 2017-08-04 06:07:18 +02:00
Steven Siloti 140b8ace8d remove use of deprecated function readdir_r 2017-07-22 22:40:17 -07:00
arvidn c4afb5e949 use a dedicated class template for flags types instead of enum class. It's more backwards compatible and improves ergonomics 2017-07-15 01:15:57 -07:00
arvidn 5c37eb174f drop support for windows compilers without std::string and wchar_t (believed to be old cygwin) 2017-07-02 08:24:55 -04:00
arvidn b80c477733 merged RC_1_1 into master 2017-06-16 00:24:41 -04:00
Steven Siloti a48cdd0281 fix check for fully allocated file on windows
The file allocation size is in terms of clusters so it will likely be larger
than the file size even with a freshly allocated file.
2017-06-15 06:36:34 -04:00
arvidn ffaabd846c make file open mode flags be an enum class for type-safety 2017-05-28 11:16:59 -04:00
arvidn 749d0da875 make iovec_t an alias for span<char>, in preparation for removing it altogether in favour of span 2017-04-30 11:49:08 -04:00
arvidn 480bde9333 change formatting of namespace declarations 2017-04-12 14:26:35 -04:00
arvidn 79d7ae3638 separate path and filesystem functions out into its own translation unit/header file pair, separating it from the file and directory class 2017-04-11 18:07:55 -04:00