This can be used to replace mutex_trylock/mutex_unlock pairs. Once the
locker has been created, the success of the locking attempt needs to be
checked via locker.IsLocked().
Change-Id: Iba4b4ce21cac5059a3577a84a6eebe28d2cc4058
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8179
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The maximum supported descriptor count is used at least in virtio_block
as the maximum vector count for IO operations. When the indirect entry
count is set lower than the supported one and indirect descriptors are
used, virtio_block can overrun that count as it was given a higher max.
Queuing would then fail and lead to transfers that never complete and
timeout after 10 seconds because the return value was not checked.
This was easily reproducible with lots of disk IO under QEMU where such
indirect descriptors are used with a maximum of 256 while the previous
hardcoded indirect count was just 128.
Change-Id: Id6f87b318e93506b04e65807d627a1cf2e8e39b5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8178
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
* Rename NumBlocks to NumBitmapBlocks, as this is the number
of blocks in the block bitmap, not on the filesystem.
* Rename AllocationGroup::Block(index) to Chunk(index), as it refers
to a "chunk" of 32 bits within the bitmap block. This gives us
one less usage of the term "block" in this file.
* Remove superfluous comment.
No functional change intended.
Change-Id: If736387fcd9963a4a74bb0dde12ede81da5502f3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8185
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The colors in the user usage conditions are
corrected.
Change-Id: I509441f5185ec521053045d2406d901a0644b0c7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8234
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
We never actually remove these (except on destruction) and only
iterate over them sequentially, so just use a singly linked list.
Combined with previous changes, this reduces the size of NodeAttributes
from 64 to 48 bytes (on x86_64).
So that it has the same naming as DoublyLinkedList.
No functional change. It seems there aren't any users
of this API in the default build at the moment.
* PackageData::fVersion is (for now) static const, until such time
as there's a HPKGv3.
* Remove locking from DataAccessor as it was only needed for V1.
We want them for the heap buffers, but the rest will generally only
be used when other packagefs locks are acquired (during mounting
or unmounting of packages), so the depots are just a waste.
* This is the closest thing ARM has the semantics of write-combining
MTR on x86.
Change-Id: I12a1582e0af871e2ab729262e90695ffe928c85b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8223
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
* This fixes arm64 where disabling caching also disables
unaligned accesses.
* This matches how FreeBSD implements this callback.
Change-Id: Iee081d4ecff05b05c3758502d0cdacfbc56b11d8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8191
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
According to the POSIX specification:
> The sem_timedwait() function shall fail if:
> [EINVAL]
> The process or thread would have blocked, and the abstime
> parameter specified a nanoseconds field value less than zero
> or greater than or equal to 1000 million.
Fixes #16693, #16694.
Haiku's Be-style semaphores have a global limit, but the
POSIX-style semaphores do not. Functionally there will be a limit
as to how many can be waited on at a time, but one will probably
hit thread limits before that happens.
This matches what FreeBSD does: specifies 256 for _POSIX_SEM_NSEMS_MAX
but then returns -1 for the sysconf value.
Fixes #16692.
If a multibyte Unicode character is specified to MultibyteToWchar
one byte at a time, then resetting the state will lose the data
for the second character. We thus shouldn't re-read but instead
keep the existing character and just read the second one.
Fixes #19035.
Otherwise, when the current locale timezone is one that has
an offset to GMT of 0, we would wind up with its name in tm_zone
and not "GMT".
Follows up to #19047.
We can be called with a timezone that isn't the same as the one
set in the current locale, in particular from gmtime(). We thus need
to handle this case properly by checking that the gmtoff is really
the timezone in the locale, or if it's GMT, to just use a static
string for the tm_zone instead.
Fixes #19047.
-1 was our previous value for AT_FDCWD, so we should retain support
for it here for the moment. All other negative values will now result
in an error.
Part of #19048.
The local transferEndOffset should be relative to the parent (us),
not to the underlying filesystem. We thus need to subtract our
own offset from the operation's offset.
This fixes a regression from be8080575a5ae9e8ecba3494afdd081cb4fd94a2.
Errors transferring data should now be properly reported in more cases.
i.e. not on Deskbar team menu, menu field menus or the clock
options menu but all regular menus at the top of the window
and other context-click menus.
Change-Id: If551aecd040500973a92fda2138b6ffe03cda279
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8154
Haiku-Format: Haiku-format Bot <no-reply+haikuformatbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: John Scipione <jscipione@gmail.com>
Some things that call these macros put expressions in them; to avoid
operator precedence problems we should put them in parens.
Change-Id: I57335ffb190c484778c4bc8075d5ca3597f1e7e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8184
Reviewed-by: waddlesplash <waddlesplash@gmail.com>