Commit Graph

2953 Commits

Author SHA1 Message Date
Augustin Cavalier 9d242fb955 file_systems & Tracker: Do not assume sizeof(dirent) contains 1 byte for the name.
At present, it does, but that is an oddity we have preserved from BeOS
that the next commit is going to remove. (This commit thus wastes 1 byte
without the following one.)

Most changes are pretty straightforward: only a +1 is needed,
and a few removed from sizing calculations. Some filesystems like UDF
originally passed back the length with the \0 included, so they have
been adjusted further. UFS2 had some other sizing problems which are also
corrected in this commit.
2021-11-18 16:24:04 -05:00
Coldfirex 2ca1376080 Mass updating of OpenBeOS text to Haiku
No functional code altered.

https://dev.haiku-os.org/ticket/17197

Change-Id: I75cc74f6be0ad968fd77c31fbe5b0f650a6fe9e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4364
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-07 10:00:35 +00:00
Alexander von Gluck IV a80813fdd1 qemu/riscv64: Misc fixups for qemu
* Disable overly verbose PCI IO access
* Add ati to riscv64 minimum image for qemu
* Update qemu test script with "best" gpu settings
  for the moment

Change-Id: I5d16ace0f8589f8b17cc50c7a1db04266907269f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4699
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-11-07 09:58:15 +00:00
Augustin Cavalier dde8b8972d DemangleTest: Add a test for demangle_symbol_gcc3 without the full demangler.
This tests what 0945c7e4e6 fixed.
Also fix one of the GCC2 tests which had expectation and input swapped.
2021-10-19 18:10:10 -04:00
Augustin Cavalier 6209570e34 Replace usages of B_FILE_NOT_FOUND in public-facing APIs.
As BeOS R5 had deprecated this error code, this should in theory
not cause any particular problems.
2021-10-19 11:34:32 -04:00
Jérôme Duval f89943d822 build/x86: also test the stack protector on x86 secondary arch
on x86, gcc emits a local reference to __stack_chk_fail_local
which can only be provided by a static library. as we don't have
a libroot_nonshared, we use libgcc from gcc, in which libssp_nonshared
was merged, from version 8.3.0_2019_05_24-11.

Change-Id: I22bf26dec5c1fe69a3915a923bd716a494f846ce
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4564
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-10-14 19:42:07 +00:00
Máximo Castañeda c10931f3b0 app_server tests: stacking of inverse clipping
A few visual tests of clipping composition with different combinations of
layers with and without the inverse bit.

Change-Id: Icddb377508733463378f93b24075fd06e54ef2cb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4454
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-10-14 18:49:18 +00:00
Augustin Cavalier c4eec9f1e8 Distinguish KERNEL_ARCH_DIR from KERNEL_ARCH.
On x86_64, the KERNEL_ARCH should really be "x86_64", but it was "x86"
as the architecture sources/headers directory is shared between 32 and 64 bit.

Should not be a functional change on any platform outside x86_64.
2021-10-01 16:26:45 -04:00
Augustin Cavalier d5f7f40504 tests/interface/bshelf: Import Container and ShelfInspector.
These come from the Haiku Newsletter, issue 56 article 2, which I
managed to retrieve the source from the Wayback Machine. (They
are based on applications from Be's Sample Code distributions.)

Jamfiles not yet included; the source is in unmodified form,
except the RSRCs have been decompiled to RDEFs.
2021-09-27 16:18:54 -04:00
Jérôme Duval bb187c91d8 interface: add colorspaces support for RGB48 and RGBA64
these colorspaces are packed as RGB or RGBA, not BGR or BGRA.
RGB48_BIG and RGBA64 only differ in the endianess of the channel the 2-byte value.

this is a big difference with RGB24_BIG and RGBA32_BIG, in which case _BIG
means the order is RGB (BGR) and not BGR (BGRA).
BGR48, BGRA64 could indeed be added, if needed.

I chose 0x11 and 0x12 arbitrarily, but given the order of channels 0x1011
and 0x1012 might make more sense. This would mean using another bit for "real"
bigendian colorspaces.

Only the color conversion to 32-bits is implemented.

Tested with the RAWTranslator modified to output 16bpp with success.

Found some references in enum AVPixelFormat in libavutil/pixfmt.h.

Change-Id: I4b023dec85d01f1e63e1b053139e5bb5d263a0e0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4468
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-09-27 07:21:27 +00:00
Coldfirex 4411ed75b4 Kernelland_emu: Fix Wformat-security
Change-Id: I3b031335844ab4512b8eebc8ead216af9c5fc4ee
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4476
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2021-09-17 21:24:13 +00:00
Niels Sascha Reedijk 0b86520c4d BString: add support for move semantics with C++11 and up.
This implements the "rule of 5" for this type. While the copy operation for
BString was already using shallow copies of the underlying data, this change
further optimizes moving the data from one object to another.

While it is not the intention to implement move semantics to all types in the
legacy Haiku/Be kits, data types like BString are good candidates, because move
operations are often useful when working with data within an application.

In this implementation, the internal data of the string object will be set to
NULL, thus leaving an empty string.

Change-Id: I16bf9424f9b17f622b0b57659b80628e18760288
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4428
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-09-08 07:07:36 +00:00
Alexander von Gluck IV 34fe8ba793 system/boot: Finish cleaning up remaining platform_get_boot_partition
* Fixes the riscv64 build
* Should fix next_m68k loader (untested)

Change-Id: Ic9b2d4305302d28a9ca0c71f8e1e502c763162d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4199
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
2021-07-10 01:22:12 +00:00
Adrien Destugues 3ca5eec002 libnetservices: fix handling of HEAD requests and 204 responses
We were incorrectly reporting a B_IO_ERROR for these requests because we
could not read the content after the headers. There is no content in
these cases.

Add an unit test for both HEAD and 204 status, checking that there is no
content and the headers are correct.

Fixes #16885.

Change-Id: I98fefc5c604253bb2545b50395b7af9f8834def0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4142
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Niels Sascha Reedijk <niels.reedijk@gmail.com>
2021-07-04 08:07:59 +00:00
Jérôme Duval 1b0f948ea2 demangler/gcc3+: handle vendor-specific suffix
fix bug #13720

Change-Id: I3363572b88aaa674f5ee7cf69866b9f2bbb4e84c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4084
Reviewed-by: Rene Gollent <rene@gollent.com>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2021-06-11 01:42:54 +00:00
CruxBox b4763972bd xfs: B+Tree ExtentMap reading
We can now read all the extent maps from the leaves. This will be needed
to implement the GetNext() functionality.

Change-Id: Ie10b453c33bec6e6d3109743d695f86a90de45cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3119
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-06-04 12:50:56 +00:00
X512 af435dd1c9 libroot: remove delete_driver_settings
It is not present in BeOS R5 and it just call unload_driver_settings.

Replace delete_driver_settings usages with unload_driver_settings.
Keep the symbol on x86 for binary compatibility.

Change-Id: I1382710e3a4cb5c65d1249ea0e5880891e6800e4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3485
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2021-05-31 06:51:45 +00:00
Jérôme Duval 04be20a75a Implement stack protection support
this adds kernel & libroot stack protector hooks. it uses /dev/random in userspace.
A configure option --enable-stack-protector is added to activate -fstack-protector
on selected system components (ATM apps, kits, servers).

Change-Id: If3a2920ba9aa0a85eaff4ba6778947f8c76ade31
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3895
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-05-03 17:52:31 +00:00
HrithikKumar49 5685473e0c formatted file using clang-format with _haiku-format formatting options
Change-Id: Iac91219ac10be70bc5b4ae2ffc0d4e44893d8a44
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3864
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-04-19 19:49:40 +00:00
Alexander von Gluck IV 4ae0376c1f src/tests: Update standardized qemu testing script
* Adds riscv64
* Improves serial output to virtual console and on-disk logs
* Add log check for kernel load

Change-Id: If66cd3b9d342953b71d2362de1003d8e7547e6ae
2021-04-09 19:27:13 -05:00
CruxBox 19488d5c68 xfs: Reading Node Directories
Node directories can now be read. With this, extent directories are
complete.
Change-Id: Ic42c8464e810137cff4946e8c975edc121daaa4f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3045
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-14 14:03:24 +00:00
Andrew Lindesay 564de1924a Locale: Support for Percent Formatting
Updates BNumberFormat to be able to format
percentages.  Also re-introduces some unit
tests and updates the BNumberFormat ones.

This doesn't actually fix #16312 as the
defaults for percentage formatting don't seem
to track the selected language, but goes part
way there.

Related to #16312

Change-Id: Id6ddf426ce5571f4e8513c0eb1663cf42ac53cb1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3767
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-13 00:29:32 +00:00
Andrew Lindesay dfbcbde1e1 HaikuDepot: Remove Custom List
Closes #15534

Change-Id: I23fa60145607c3e8f25552f24c5e2c630b940537
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3758
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-03-11 08:34:16 +00:00
Jérôme Duval a44af2ec16 libroot: call thread exit hooks before destroying tls
Change-Id: Ide2799ccf8620e42650a8f45177fb5fac4f09696
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3762
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2021-03-06 10:31:51 +00:00
Leorize 78b1442051 libbnetapi: BUrlRequest now outputs to BDataIO
Previously, BUrlRequest returns data received via a callback that can't
return any value. This approach have several issues:

- It's not possible to signify failures to the request.
- Users have to implement custom listeners just to handle the common
  case of outputting to a buffer/file/etc.
- The received data has to be serialized into BMessage when
  BUrlProtocolDispatchingListener is employed. This can cause a
  noticible slowdown in real-world scenarios as evident by #10748.

With this change, BUrlRequest will output directly into a BDataIO, which
exposes a richer API for request handlers to work with (for example a
BitTorrent client can request a BPositionIO for non-linear data
delivery), as well as simplifying common cases for users.

The adaptation only requires one additional API:
BHttpRequest::SetStopOnError(). This API simply instructs the HTTP
request handler to cancel the request if an HTTP error is occurred.

Change-Id: I4160884d77bff0e7678e0a623e2587987704443a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3084
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-02-28 20:39:31 +00:00
Leorize 3e27f8d5a7 libbnetservices: BUrlResult is no longer a BArchivable
The switch to make BUrlResult serializable was debuted in
f9e1854f19 with the rationale is that
BHttpRequest auto-redirection might cause the headers to become
obsolete by the time a client process the BMessage received from
BUrlProtocolDispatchingListener.

With the change to BHttpRequest to not notify listeners when
auto-redirection is enabled, this is no longer the case and the
serialization code can go away now. This simplifies BUrlResult and its
subclasses, and gain us some performance for clients using
BUrlProtocolDispatchingListener as the result object no longer has to be
serialized.

This also change the ABI of BUrlProtocolListener::HeadersReceived to no
longer passing a BUrlResult.

Additionally, BUrlResult and BHttpResult now express the size of the content
as an off_t, thus allowing results larger than 4 GB.

Change-Id: I9dd29a8b26fdd9aa8e5bbad8d1728084f136312d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3082
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-02-28 20:39:31 +00:00
Leorize 8e3c76b3d2 HttpRequest: Don't trigger listener on auto redirect
When the user enable auto-redirection, what they meant is that they do
not want to handle redirections, thus we should take total control of this
step and hide it from the user. In fact, a majority of in-tree users
write code to disable their listener when a redirection happen.

This should also allow us to simplify BUrlResult, which has been turned
into a BArchivable for the sole reason of "preserving" headers when
auto redirect is enabled when used with BUrlDispatchingListener, which
has been shown to have little (if any) practical usage.

Change-Id: I9b10b81de0a13edbaec25f6b48ed7a4335ea691a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3081
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2021-02-28 20:39:31 +00:00
Niels Sascha Reedijk 85a6d6530a libnetservices.a: fix unit test builds after hrev54923 2021-01-30 14:42:25 +00:00
Alexander von Gluck IV 9293eadbda opengl/glinfo: Fix broken GLinfo app
* Can't call InfoView() with an unlocked BGLView.
* If unable to obtain to glGetString, show some "unknown" messages

Change-Id: I17d8ff84feed166644d54b0e19e0ef1fce202a74
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3476
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-12-08 00:25:45 +00:00
Adrien Destugues a959262cd0 implement mlock(), munlock()
Change-Id: I2f04b8986d2ed32bb4d30d238d668e21a1505778
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1991
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-03 07:58:05 +00:00
CruxBox bd0708fd41 xfs: Attempt at reading Leaf Directories
We can read leaf directories now but I've only checked for a single
block working right now. I might make a few more changes in an upcoming
patch.

Change-Id: I325de8a6fad4ef9298e7810256cba47a87c45187
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3027
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-12-03 07:57:15 +00:00
Andrew Lindesay 027d608682 HaikuDepot: LRU Cache for Icons
Only keep a fixed number of icons in memory at once.

Completes To #15370

Change-Id: I23e3a4fa7559894034f45afb3b536910ea037078
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3367
Reviewed-by: Rene Gollent <rene@gollent.com>
2020-11-15 20:16:14 +00:00
Leorize e67a4284c0 libbnetapi: Disallow instantiation of BUrlRequest subclasses directly
This API change forces all creation of BUrlRequest to be done via
BUrlProtocolRoster::MakeRequest(). This allows the structure of protocol
addons to be altered without breaking ABI for client applications.

Change-Id: I1785c9136c50d19eaa9e57cb9d259ed8d88a5b56
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3080
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-10-12 06:36:00 +00:00
Jérôme Duval 06ed32b8c4 BCursor: add a constructor with bitmap and point
* enhancement #15169
* get_mouse_bitmap(): also reads the colorspace from app_server.
* docs and tests

Change-Id: Iba63f8a2789530ae596c30b92f14828f31761d98
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3292
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-10-08 08:23:31 +00:00
Jérôme Duval 125a4e9c32 kernelland_emu: avoid dprintf conflict from stdio
pretending to be in kernel mode

Change-Id: Ib396f9aae0b6d8ebff0edc332a583c66c59f1067
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3283
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-10-04 19:34:40 +00:00
Andrew Lindesay f0e491d390 HaikuDepot: Icon / Tarball Handling
Instead of exploding the tar-ball of icons from
HDS, keep it as a tar-ball, index it and read
data directly out from specific indicies on demand.

This will speed up the process of downloading
the icons by removing the unpack.  Also updates
will be faster by avoiding the need to delete the
old icon files.

Because icons are loaded on-demand, the start
time is faster by avoiding all the icon loads.
There are also savings on memory consumption.

Indexing on each load is surprisingly fast so
no external index is maintained.  Likewise for
the tar-balls's meta-data.

This commit does not cover the implementation
of an LRU cache of the icons in memory.

Relates to #15370

Change-Id: Ia1647d8c805be89618f493d2592bf7877fca3f14
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3205
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-09-12 23:06:24 +00:00
Adrien Destugues 2c09e0dc7f Installer: separate writing bootsector from other install finishing code
Remove the InstallerInitScript (it does nothing) and the
InstallerFinishScript (it does too many things). Instead implement the
finishing directly in Installer. Separate writing the bootsector, so
that the "write bootsector" menu writes only the bootsector.

Fixes #16303
2020-08-05 12:52:04 +02:00
Leorize 1f569db086 FileRequest: Make Stop() cancel the request as soon as possible
This commit implements a check for the flag raised by Stop() to cancel
a given request as soon as possible. Cancelled requests will return
B_INTERRUPTED regardless of whether the request has completed,
on par with how BHttpRequest is behaving at the moment.

Change-Id: Ia8a95b910cff158c710c5b2ed58b4675e705642e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3071
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-07-25 18:13:20 +00:00
Kyle Ambroff-Kao e0e5d12ea3 test/haikudepot: Fix build of haikudepottest.so
hrev54429 added some changes to logging in HaikuDepot which broke the
build of the tests.

The build for haikudepottest.so adds some cpp files from the
HaikuDepot source. Now that Logger::NameForLevel and
Logger::IsLevelEnabled are referenced in some of the code being tested
we need to include Logger.cpp as well.

This just adds Logger.cpp to the haikudepottest.so build.

Change-Id: I80a8bb2053c3c78d821ce3cf9902c3a42b0def37
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3056
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-23 07:23:37 +00:00
CruxBox 9593c05ac5 xfs: An attempt to read block directories
Map entries can be read, most structures are in place. Next is to
actually work with the directory block.

Change-Id: I700ee2e003bdef97838b1f06a95e53a5e4293658
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2981
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-08 06:23:24 +00:00
Leorize a3f0ca5023 tests/system/kernel/vm/Jamfile: remove non-existent
This non-existent file causes unittests builds to fail.

Change-Id: I0ea2164487279fefcbc9e5c930440db3f2e6ccb9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2969
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-05 21:16:20 +00:00
Andrew Lindesay 9295c1f645 HaikuDepot: Url -> Identifier
This change will rename the confusing "url" within
HaikuDepot to be "identifier" in line with
corresponding changes in pkg kit and HDS.  Also at
the same time support is introduced for HDS
repos' meta-data to artificially match against
multiple repos; as requested for the future R1B3
release process.  Some tidy-ups and extensions have
been made to the JSON schema-to-model and the
schema-to-parser scripts.

Change-Id: I402e7d610986039f58d72028bda7de977e9115e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2986
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-05 09:41:54 +00:00
Suhel Mehta 239a1c3561 ufs2: implementing open_dir and read_dir function
Root directory is read sucessfully.

Change-Id: I8bdc8c1a52edb679a6cb4b5f70e7f42eb2b2c8f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2907
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-03 19:21:06 +00:00
CruxBox 7e1b5cf809 xfs: An attempt at reading shortform dir
This patch gets read_dir, lookup and few others to work. Entries cannot
be listed yet except the root.

Change-Id: Ic4b7b61a794a1b75849e45777a383b3315b15aa8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2915
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-07-03 08:13:27 +00:00
Kacper Kasper 97bd6fe8d4 app_server: Implement more composition modes
* Use agg::comp_op classes to blend pixels.
* Subpixel path not implemented.
* Needed by WebKit.
* Implements #10274.

Change-Id: I07b0002196fd0a05fc100bd9f6d703c33cadc85b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2932
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-06-29 14:07:42 +00:00
CruxBox 406d14d4ce xfs: Reading Inodes
This patch successfully reads inodes. There are also some style fixes.
The inodes aren't published and some useful hooks are yet to implement.

Change-Id: I73e6c68f1c2177871fbd0b241a67826aea1b17be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2738
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-06-15 06:44:23 +00:00
Jérôme Duval a9f415f06a add simple avx test
Change-Id: Ia17524929672b420e20d9b491fdafd21cc5a928f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2850
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-06-03 13:57:35 +00:00
Kyle Ambroff-Kao 57672294e9 tests/storage: Fix BDirectory tests
After this patch "UnitTester BDirectory" passes.

Most of this test suite already documented the differences in behavior
between BeOS R5 and Haiku. I verified whether these comments were
accurate and removed the cases which handle BeOS specific behavior.

Most of the differences are just Haiku using more specific errors:

* Initializing BDirectory with an entry that is not a directory
  results in B_NOT_A_DIRECTORY.
* There is obviously no /boot/beos. Use /boot/system for this test
  instead. BDirectory::IsRootDirectory returns true for this path
  since it is the root of the system package.
* Initializing to child path "" results in B_ENTRY_NOT_FOUND instead
  of successful initialization with B_OK only to later return
  B_BAD_VALUE if the BDirectory is used.
* BDirectory::Find(NULL, BEntry*) doesn't touch the BEntry parameter
  since the provided path is NULL, where BeOS R5 will set the BEntry's
  status to B_BAD_VALUE.
* Clean up -Wparentheses warnings for assertions of the form
  CPPUNIT_ASSERT(path == existingSub == B_OK), which is another way of
  saying path != existingSub. This is because the path ends up being a
  normalied path, but the input path is not. For example
  /tmp/existing-dir becomes /boot/system/cache/tmp/existing-dir. I
  verified that this is the same behavior as BeOS, and then added some
  normalized paths to compare against.

Change-Id: I5125ef221fba92793959efead96d7daaa181a119
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2826
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-05-29 14:34:47 +00:00
Kyle Ambroff-Kao 44a4bc5fd6 tcp: Remove sanity checks from BufferQueue in release builds
Each TCPEndpoint has two BufferQueue members, one for the send queue
and one for the receive queue.

If DEBUG_BUFFER_QUEUE is enabled, then most methods of BufferQueue
call BufferQueue::Verify(), sometimes twice. This member function
performs some sanity checking which requires iterating through every
net_buffer in the queue.

Disabling this in a debug build improved throughput by a factor of 5x
over the loopback interface on my laptop. Using iperf the measured
throughput went from 900Mbps to around 4.8Gbps.

This patch turns this sanity checking off for release builds.

* Rename DEBUG_BUFFER_QUEUE to DEBUG_TCP_BUFFER_QUEUE
* Change the default in BufferQueue.h to disabled
* Set DEBUG_TCP_BUFFER_QUEUE to KDEBUG_LEVEL_2 in
  kernel_debug_config.h

Change-Id: I262dac5d7e2889d2942bbdcf6b667cc0cbafa4c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2780
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2020-05-23 02:32:58 +00:00
Suhel Mehta ac754f75e9 ufs2: Reading inodes of ufs2.
Now file system can be mounted sucessfully.

Adding documentation for using the code.

Change-Id: I2bd1b72e06ffc3b5f6306aaa69c59becf4cb882b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2696
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2020-05-18 12:16:32 +00:00