* Adjust some nfs4 code depending on _KERNEL_MODE / USER.
* Add several functions needed by this driver to kernelland_emu.
* Fixes#15556.
Change-Id: I36c1727d9cff088aa93870806bfe69b46dbdd4e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8712
Reviewed-by: waddlesplash <[email protected]>
* Prevent the userlandfs server from calling clone_area on an area
that might have already been deleted.
* _HandleRequest(FileCacheReadRequest*) waits for a reply from the
server when bytesRead > 0. This ensures that the server has time to
use the area holding the returned data, before that area is deleted
when the RequestAllocator goes out of scope in the kernel add-on.
However, if bytesRead is 0, the server will still call clone_area,
even though by that time the area has probably been deleted. This
leads to a B_BAD_VALUE error when the FS tries to use the emulated
file_cache_read at the end of a file, which differs from the
normal behavior of file_cache_read.
* _HandleRequest(ReadFromIORequestRequest*) has similar logic in that
it waits for a server reply, but not if size == 0. It's possible
that a similar problem could occur here. This test can be
dropped if no requests with size 0 are ever sent from the server to
begin with.
* For other _HandleRequest overrides, the kernel never waits for a
server reply, and this causes no problems. This could be because the
size of data returned fits in the port buffer, so no external area
needs to be created by RequestAllocator::AllocateAddress.
Change-Id: If070901c25d446e00e67a74a7883808d8a38dae2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8721
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Do not call entry_cache_add_missing from the FAT driver, because it
can lead the VFS to believe a filename is missing when it is
actually present (in a different case).
* Remove CopyFile code that was added to handle a race condition when
dragging multiple files to a FAT volume. The race condition only
occurred in the first place because of the above driver bug.
* Ensure the FAT driver can fail gracefully if dosfs_read_vnode is
called with an inode number that is not present in the FAT vcache.
Without any 'missing' entries in the entry cache, there is an
increased chance that multiple (non-missing) entries representing
the same file will be added to the entry cache, which can result in
the VFS calling the FS get_vnode hook on a file after it has been
unlinked.
* Follows up on https://review.haiku-os.org/c/haiku/+/7623.
Change-Id: I5667119d8149954e0c8a5829617a7d93a6fc7aae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8595
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Allocate blocks and add them to the hash table so they are
available for a future block_cache_get call.
* Make use of prefetching in FAT driver.
* A client filesystem may request to prefetch a block run that
contains some blocks that are already cached. The request will
be truncated at the first such block in the run.
* Fixes#19186.
Change-Id: I8d2e3cff15e5b46569438e0dc085e2b391aa57a5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8525
Reviewed-by: waddlesplash <[email protected]>
* Don't let users format a volume with more sectors than can fit in
the 32 bits that the FAT spec provides for storing the sector count on
disk. Since dosfs_initialize() assumes 512-byte sectors, this
will truncate FAT volumes at ~2.2 TB when a user tries for format
a partition larger than that.
* Mount read-only if the sector count read from disk is lower than it
should be.
* Account for an unrelated overflow in struct device_geometry that
could theoretically occur when mounting a large FAT image file.
* Set the struct mount read-only flag earlier during mounting, to
avoid a fillinusemap error when changing to read-only inside
fat_volume_init.
* Addresses #19079.
Change-Id: I3d15940dc18f50e5c8562fefee3b1749c4b93b6f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8426
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
* Fix an instance of storing block number in a signed 32-bit variable,
which could overflow on volumes > 1 TiB.
* See discussion in #11119.
Change-Id: I138b56613775c364b259e3a0e68ba8bfe9a7f904
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8362
Reviewed-by: waddlesplash <[email protected]>
* Initialize pm_firstcluster in dosfs_identify_partition for use by
read_label, for FAT32 volumes. This is necessary for reading the
volume name from the root directory.
* Create label_to_fat() and call it at both points where volume
labels can be assigned, for uniform behavior in setting
labels. Force all-caps when setting labels, for widest
compatability of the volume with other systems.
* Remove the redundant LABEL_ILLEGAL string listing illegal label
characters, and consistently rely on sAcceptable (a list of legal
characters) when setting labels.
* For clarity, rename sanitize_label() to label_from_fat and remove code
that causes labels to be displayed to the user in all lowercase.
* See #11119.
Change-Id: I7b5e6b998f13d9eb7ba56ed50c0d53b8c051fad0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8115
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Skip the complete comparison of FAT mirrors if the FAT size is over
4096 blocks.
* This complete check was not done in either the previous Haiku
driver, or in the original FreeBSD driver that the current driver is
largely based on.
* Remove the media descriptor byte check of the active FAT, which is
redundant with fillinusemap().
* Follows up on #18969.
Change-Id: I34dd1d71852e1f3e9dc42d125759989c091f5108
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8095
Reviewed-by: waddlesplash <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
* Ensure that when initializing a FAT partition, the media byte value
assigned in the bootsector matches that in the first FAT entry.
* See #18969.
Change-Id: Iffc3dd7549b918954e9145a2a02221616c38a016
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8081
Reviewed-by: waddlesplash <[email protected]>
* Extend the volume size limit in bsd_device_init() from 32 GB to 256
GB.
* Permit read-only access above this threshold.
* I would like to do more testing before allowing write access above
256 GB.
* See #11119.
Change-Id: Ica7872d5f4c06415c1501f7a8ffb955785f91a29
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7911
Reviewed-by: waddlesplash <[email protected]>
* Don't write-lock the node when opening or closing a file unless the
node is actually being modified.
* Incidentally, move code from dosfs_close to dosfs_free_cookie. This
is not necessary to avoid this deadlock, but it is more consistent
with the approach of the BFS driver.
* When dragging and dropping a large file (e.g. 100 MB) in Tracker, it
is possible for BPoseView::AttributeChanged() to open the file in the
middle of the operation, which will deadlock with MoveItem() if
opening involves a write lock.
Change-Id: Ifc430e1e583cacff2eeb7283100417e16e3f1f5b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7881
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Rewrite most hook functions, modeling many after FreeBSD hooks and
making use of support functions ported from FreeBSD. As it stands
now, most of the FreeBSD driver files are present with minimal
changes, with a pseudo-BSD compatability layer added to make them
work in Haiku. Performance is not what it could be if the BSD code
was rewritten to interface directly with the Haiku kernel, but under
the current approach the driver might be easier to maintain in terms
of porting future FreeBSD bugfixes.
* Add support for FAT in userlandfs. Aside from being useful for
debugging, the userlandfs module provides better filename support
for characters that are not in code page 850, because it can link
libiconv.
* Update the fat_test.sh script to use dosfstools to format the tested
device, instead of the internal dosfs_initialize hook. The script
is written to test specific cluster sizes, but the initialize hook
still does not support user-specified cluster sizes.
* Coding guidelines: lightly-modified BSD files and lightly-modified
original Haiku driver files have not been revised to adhere to the
Haiku style guidelines. For BSD files, this is meant to make it
easier to compare with the FreeBSD repository when merging future
FreeBSD patches. For existing driver files, this is to highlight the
functional changes made in this change request (I can submit a
separate patch later to clean up style in these files). Also, some
#include lines are not alphbetized (they are instead ordered like
they would be in FreeBSD, because one header relies on another).
Change-Id: I92521d4b700d7aa52fe6c664cf8f83a4d9395809
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7660
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
* If a user selects 2 files whose names differ only in case,
right-drags them to a FAT volume Tracker window as a set, chooses
the move option from the drop-down, and chooses to continue if an
alert box appears, the second file in line to be copied will be lost
(this is consistently reproducible on my system).
* Eliminate the option to continue in this situation, so that the move
will always be aborted instead of progressing to deletion of the
second file from the origin directory.
Change-Id: I52197945fe28072eeddcd68e91ce5e7b8534b184
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7623
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Record the read-only status of a partition in settings/mount_server
so it will be applied if automatically mounting on next boot.
* Fixes#18081.
Change-Id: Idd7267fd356f35689bb6ad79de4a45bf071164f1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6080
Tested-by: Automation <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Enable user to drag the WebPositive web page icon to the bookmark
bar to create a bookmark there, or drag it to a Tracker window to
create a bookmark in the displayed directory.
* Send a message to the drag target that can be handled by Tracker's
generic drop routine.
* Overload _CreateBookmark with a more flexible version and a
_CreateBookmark(BMessage*) that handles both the icon being dropped
on the bookmark bar, and the message that Tracker sends if the icon
is dropped on Tracker.
* Account for the fact that, when _CreateBookmark(BMessage*) is called,
Tracker may or may not have already determined the file name to use and
created the file, depending on whether the icon was dragged to
Tracker or not.
* Use page-specific small and large icons for the bookmark file, if
they are available (currently Haiku WebKit doesn't seem to provide
them though).
* Follows CharacterMap as a model for dragging an icon and ShowImage
for dragging to Tracker.
* Fixes#10795.
Change-Id: I7f32013cc1372dab1894b5d92335d3a4cbfb671f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6007
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
* Set it to true when the client's message loop is started.
* Prevents a Window from sending messages to the client BWindow when
the BWindow's message loop is not running.
* If a Window sends an _UPDATE_ message to its client and does not
receive the expected reply, it will later refuse to draw to the area
that was updated. This can happen in the case of a BView that is a
child of an OffscreenWindow (BBitmap::fWindow).
* Fixes#9064.
Change-Id: I8ab840852f3875cb323842d927ee1e50b0aa3511
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5967
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
* Add a function that updates the last-modified time of a fat
vnode; call it when the driver writes, creates, deletes,
or moves a file.
* The function optionally copies the new time from the vnode to the
corresponding direntry (useful if the calling function is not
going to do that anyway).
* Add a function that updates the last-modified time of the parent
directory of a fat vnode and copies the new time to the corresponding
direntry; call it when the driver deletes a file (not needed
for creating or moving because the parent directory vnodes are
directly accessible).
* Fixes#11119.
Change-Id: Ic7c0bda55190f236e9fd31d5d140d753138f7997
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5798
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
* If the target is a volume, include a line on the Information tab of
the Get Info window that lists the filesystem name, block size, and
whether the volume is indexed.
* Fixes#16945.
Change-Id: I888ae708a15a2f7729f50806fb59dbb4df506cfa
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5507
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
* Change BContainerWindow::fStateNeedsSaving from private to
protected, so that TFilePanel functions can set it to false, like
the analagous BContainerWindow functions do.
* Prevent fStateNeedsSaving from being set to true because of a change
to window size/position, unless the window is active. This is
meant to distinguish changes made during object setup from changes
made by the user.
* Add more calls to ViewState::_StorePrevious state.
BContainer::fPoseView triggers saving on some occasions because its
member fViewState needs to save. fViewState needs saving when there
are mismatches between pairs of f[x] and fPrevious[x], e.g. fIconSize and
fPreviousIconSize. These mismatches can arise when the ViewState
is set up. These pairs are synchonized by _StorePreviousState.
* Rearrange the modified ViewState functions to keep the 'const'
modifier on the existing code.
* Fixes#17374.
Change-Id: I2a6c1c1d9c5c3656eab2ebc770a5915010e7500c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5447
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
* Set a flag if TFilePanel::RestoreState successfully reads the
FilePanelSettings file.
* Check for this flag in BFilePanel::Show.
* Part of #17374.
Change-Id: I4431c01f9282fe411fa7b30667215bba9249bd96
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5433
Reviewed-by: Adrien Destugues <[email protected]>
* Move the existing MakeFocus call to after the window layout is built.
* Also, add calls to Activate so that StyledEdit becomes the active
window after its find or replace window is closed/hidden, even if
another application is set to 'always on top.'
* Fixes#17733.
Change-Id: I8380e8ce2760ffa3f3467a618a0d843826e4ac99
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5416
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: humdinger <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
* Have FindPanel::AttachedToWindow check to see if a MIME type is
already selected, before it sets MIME type to the default value.
* Fixes#14946.
Change-Id: Iab3b9058bbc3ef1f055475ed54a72d4032643632
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5357
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
* Conditionally add/remove fOverflowMenu to BookmarkBar when window
is resized or a bookmark is added/removed.
* Improve handling of large window size changes (e.g. zoom button)
which require moving multiple bookmarks to/from fOverflowMenu in a
single call to FrameResized.
* Fixes#17616.
Change-Id: Id3e991167ec8d7aa540dd0644749cad1612de293
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5324
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
* Using StyledEditApp as a model, ensure that multiple Application Type windows do not cascade so far that they open partially off-screen.
* Add a dedicated function, FileTypes::_AppTypeCascade, to set the position of the next ApplicationTypeWindow to be constructed and save this position in FileTypes::fSettings.
* Unlike StyledEditApp, do not add an uncascade function, because existing code in ApplicationTypeWindow::QuitRequested already resets app_type_next_frame.
* Follows up on https://review.haiku-os.org/c/haiku/+/5164.
Change-Id: I9cbb58ba391ddafdd1ea136157e5c6129bf41ebd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5307
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
* Add PlaylistFileReader class and derived M3uReader and PlsReader classes.
* Move most of the code from Playlist::AppendM3uToPlaylist to PlaylistFileReader::_AppendItemToPlaylist
* For each File line in the .pls file, a PlaylistItem is added to the MediaPlayer playlist.
* For each Title/Length line, the data is applied to the most recently added PlaylistItem.
* The NumberOfEntries and Version lines are read to make them available for future use, but currently they have no effect.
* Fixes#6813
Change-Id: Ifa23d0df2e4d5b466aa7b85649a78276cff986ef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5201
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
* Move the default size and position settings for ApplicationTypeWindow from its constructor to FileTypesWindow::fSettings, and update these settings when the window is closed.
* Add _Frame() for extracting a BRect from fSettings.
* Keep a BPoint parameter in the constructor, which allows each new instance of the window to be slightly offset from the last one.
* Submitted in response to a comment by humdinger on https://review.haiku-os.org/c/haiku/+/4926
Change-Id: I0fa8a9ca8f18cf4093363bff713f0f80f6c04cd5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5164
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
* In the Application Type window, increase the weight of typeBox so the primary effect of resizing the window is to control height of the Supported types scrollView.
* Increase the height of scrollView so that it extends below the Remove button (presence of a button in a row seems to make row height static, preventing scrollView expansion).
* Modify ComplexLayouter in attempt to address root cause of the initial height of typeBox being too small to properly display the contents.
* Fixes#14936
Change-Id: I94ad8c5c8140814bfc2c399803f4d629ecd467bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4926
Reviewed-by: humdinger <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>