Commit Graph
43 Commits
Author SHA1 Message Date
Jim906 d0b07ec244 nfs4: Disable file cache to invalidate it
* When resetting the file cache, use file_cache_disable() to remove
  all pages, instead of calling file_cache_delete().
* Possible fix for #19656.

file_cache_delete doesn't actually delete the VMCache object, so when
file_cache_create() is called the returned file_cache_ref just points
to the same VMCache as before.

Change-Id: Ifba42b51c52f11980fd97212d0c3bdfdc1e55085
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9448
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-07-09 17:57:29 +00:00
Jim906 258fce50e0 nfs4: Check for stale nodes when reload dir cache
* When the DirectoryCache is updated, compare the new contents with
  the old.  If any of the old entries are obsolete, treat the
  respective node as stale.
* Create FileSystem::TrashStaleNode() to avoid duplicating code.
* Possible fix for #19656.

This helps the client keep current with changes made to server files
by other users.

While the comparison will be slow for a large directory, it won't be
executed unless another user has changed the contents of a directory
since the last time the Haiku client read the directory.

Change-Id: I03e65aaaad5027c66b10265f2b4a21ed9d2b6744
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9445
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-07-07 15:16:10 +00:00
Jim906 3738985e2c fat: Fix error handling in buffer IO functions
* Have bread() output a NULL *bpp when returning an error (consistent
  with FreeBSD).

* Enable brelse() to handle a NULL argument (consistent with FreeBSD).

* Ensure that when getblkx() returns an error, no clean-up remains to
  be done by bread() or getblk().

* Let allocate_data() set buf::b_owned, and set it only if successful
  in allocating, so the flag won't be misleading to put_buf() after a
  failure.

* Revise vput() to avoid situations when, after an error, it might
  call put_vnode() before the node is published to the VFS.

Change-Id: I42cc1684fe5b68333284b149e72a794c93ac71ff
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9393
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-06-26 14:44:39 +00:00
Jim906 45037be110 nfs4: zero out possible garbage values
* When a file hole is created, zero the start of the page where the
  hole ends.

In my test setup at least, the server takes care of zeroing any full
pages in the hole created when a write begins at a position after the
existing EOF. Since the file cache page where the write starts will be
written back to the server, we just need to partially zero that page.

This change allows the driver to pass the 'holey file' test in the
nfs connectathon test suite.

Change-Id: I5a0d52af5cce4fb9e2d9f928f45fd0adcfa23627
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9381
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-06-20 09:06:43 +00:00
Jim906 b3ffc5acf6 nfs4: Fix minor private cache issues
* Allow Inode::LookUp to handle the case in which the inode number in
  a DirectoryCache entry has no corresponding entry in the InoIdMap.
  This situation can occur after an unused node is freed (due to low
  system resources), since ~VnodeToInode will remove the node's
  InoIdMap entry.
* When a file is overwritten by a rename operation, remove the
  overwritten file's entry from the parent DirectoryCache (although a
  file with this name is still present in the directory, the old
  DirectoryCache entry is now invalid because the name is now linked
  to a different inode).
* Invalidate the cached stat info, including the number of links, in
  Inode::fMetaCache when linking to that inode.
* Make a correction to the assert added in
  https://review.haiku-os.org/c/haiku/+/9282. Entries may still be
  left in this client's InoIdMap if the file was deleted by another
  client.

Change-Id: Id437be32e51a4b324eb818b398d7facd23b7be56
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9308
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-05-26 18:27:35 +00:00
Jim906 4dd25011f0 nfs4: Avoid deleting nodes when unlinking
* Stop deleting Inode objects in VnodeToInode::Unlink().
* Allow ~VnodeToInode() to do this in nfs4_remove_vnode(), instead.

At the time the unlink hook is called, other threads could still have
the file open.

With this change, the nfs4 driver can pass the open/unlink test in the
Connectathon NFS testsuite.

Change-Id: I6e4f67fbafad73dd2eeb285dbd2b9fa9670bf5b5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9282
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-05-14 16:05:28 +00:00
Jim906 5650b97673 nfs4: Acquire fFileCacheLock in Inode::Read()
* Prevent file_cache_read() from being called in the middle of
  Inode::RevalidateFileCache().
* Correct an apparent typo in RevalidateFileCache.
* Fixes #16395.

If file_cache_read is called in one thread while RevalidateFileCache
is in progress in another thread, the file_cache_ref could be deleted
while file_cache_read is in progress.

Currently, RevalidateFileCache does not update fChange after it
obtains a new change value from the server.  As a result, for a file
that has been changed at least once since its node was constructed,
RevalidateFileCache will delete and recreate the file cache each time
it is called, instead of returning early as it would if fChange had
been updated the last time it ran.

Change-Id: Ifbf5a892c3003e41b2c73d9c3c806d8fbd79dff7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9147
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2025-03-28 19:23:51 +00:00
Jim906 0aaaf60dec nfs4: Allow GetInode to fail for removed nodes
* Stop FileSystem::GetInode from firing an assert when
InodeIdMap::GetFileInfo returns an error code, in the case where the
node has been marked removed.
* Fixes #10409 and #16396.

GetInode is sometimes called on a removed file. For example, when a
directory is deleted in Tracker, after nfs4_remove_dir is called,
nfs4_release_lock, nfs4_close, and nfs4_free_cookie are all called,
each of which use GetInode at a time when GetFileInfo is liable to
fail because InodeIdMap::RemoveName has been called on this InodeIdMap
entry already.

Change-Id: I9ac5ffdc351f131e290574b23ca4a1675b1ec2e5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9144
Reviewed-by: Adrien Destugues <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2025-03-25 13:59:26 +00:00
Jim906 ed030a3905 nfs4: Add debug output functions
* Create Dump functions for several classes.
* Add 2 nfs4 kernel debugger commands.
* Incorporate the shared macros from DebugSupport.h.

The Dump functions accept an argument that determines type of output
(dprintf/kprint).  In cases where the class has an internal lock, Dump
is calling a separate _DumpLocked(), just so the output can be
done by a const function.

Change-Id: Id8da904726cb1a3ffcf9e9ac13452d1be1c9e00a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9134
Reviewed-by: waddlesplash <[email protected]>
2025-03-20 17:32:51 +00:00
Jim906 4407440099 nfs4: Remove stale nodes when their ino is reused
* Add FileSystem::EnsureNoCollision to check for a stale node with
  the given inode number, and remove it if it exists.
* Call EnsureNoCollision from Inode::CreateObject and
  Inode::CreateState to cover creation of directory files and regular
  files, respectively.
* Stop using the entry cache.  Instead, make use of the driver's
  DirectoryCache in the lookup hook.
* Fixes #16924.

When a shared file is deleted, and no clients have the file open, the
server considers the file ID number of the deleted file to be eligible
for reassignment to new files.  If the deletion was performed by the
server or by some other client, the Haiku client does't know the file
was deleted, and still may hold a vnode for it.  This interferes with
the creation of a new file by the client, when the file ID / ino of
the new file is the same as that of the stale node.

The reason for disabling the entry cache is to give the driver a
chance to check the server for changes in name-to-ino mapping when the
VFS function lookup_dir_entry is called.  At least in its current
form, the driver isn't able to deal with outdated entry cache
information.  For example, if the Haiku client has added temp.txt to
its entry cache, and then temp.txt is deleted by the server, running
'nano temp.txt' on the client will attempt to open the (non-existent)
file instead of creating it.

Change-Id: Ic3ec21d18c8616fcfeb9234aafb0e647746d23cd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9068
Reviewed-by: waddlesplash <[email protected]>
2025-03-06 19:59:15 +00:00
Jim906 1c0da902ab userlandfs: Ensure room for requests in port
* Add a parameter to RequestAllocator::AllocateAddress and ::AllocateData
  that allows the client to specify a minimum amount of free space that
  must remain in the port buffer.
* Make use of the new parameter in some operations that can fail
  without it.

The Port buffer can be used to store data associated with a Request.
For some file system operations, further requests must be sent through
the port (by calling AllocateRequest) after reserving port buffer
space for data. Unlike AllocateAddress and AllocateData, which can
use an area if the data is larger than the port buffer capacity,
AllocateRequest can only allocate space in the port buffer. If data
previously allocated in the port buffer happens to be large enough to
fill it, then these further AllocateRequest calls will fail.

Change-Id: If03e0afdfbd9fbc36f0e1a04b5d0a20031932b91
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8866
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2025-01-29 17:17:16 +00:00
Jim906 46b22ab208 nfs4: Make buildable under userlandfs
* 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]>
2025-01-04 14:30:33 +00:00
Jim906 7020e10ab8 userlandfs: Fix file_cache_read
* 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]>
2024-12-30 17:00:48 +00:00
Jim906 1a98f27639 Tracker: handle case-insensitive move target error
* 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]>
2024-12-03 16:09:11 +00:00
Jim906 9bb1816c14 block_cache: enable prefetching
* 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]>
2024-11-16 18:26:21 +00:00
Jim906 b14c5d98b2 FAT: prevent sector count overflow
* 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]>
2024-09-30 15:52:06 +00:00
Jim906 7bb3369978 FAT: allow RW access to volumes up to 2 TB
* 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]>
2024-09-25 13:58:40 +00:00
Jim906 ed37f3a29d FAT: Fix potential dereference of NULL pointer
* Can occur if bread() returns an error code in readep().
* Fixes #19105.

Change-Id: I975c7d729c59b175c4a6249bbb4660e1294a0ef1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8363
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
Haiku-Format: Haiku-format Bot <[email protected]>
2024-09-24 14:59:36 +00:00
Jim906 a2a5b10065 FAT: fix volume label errors
* 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]>
2024-08-26 17:12:57 +00:00
Jim906 51e9765aff FAT: Speed up mounting of large volumes
* 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]>
2024-08-24 17:17:23 +00:00
Jim906 4d8b0552d1 FAT: Fix media byte initialization error
* 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]>
2024-08-20 14:49:48 +00:00
Jim906 ffd9482847 FAT: Extend volume size limit
* 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]>
2024-07-31 16:25:42 +00:00
Jim906 9e11f4e9a5 FAT: Prevent Tracker deadlock when copying files
* 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]>
2024-07-24 20:43:10 +00:00
Jim906 2802139f24 FAT: fix divide-by-zero in check_bootsector()
* Zero-test sectorsPerCluster.
* This value will be checked more thoroughly later by parse_bpb().
* Fixes #11119.

Change-Id: I2318fbf3ea7f3c6c49b317ddd7d895757cf5944d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7840
Haiku-Format: Haiku-format Bot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2024-07-15 12:37:43 +00:00
Jim906 342a1b221b FAT: revise using code from FreeBSD
* 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]>
2024-07-09 06:40:55 +00:00
Jim906 fd8513028f Tracker: deal with race condition in CopyFile
* 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]>
2024-04-26 19:44:55 +00:00
Jim906 429e730135 mount_server: remember read-only attribute
* 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]>
2023-02-24 15:59:15 +00:00
Jim906 5214106737 WebPositive: draggable page icon
* 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]>
2023-02-10 19:15:04 +00:00
Jim906 c565d98b6b Window: initialize fUpdatesEnabled to false
* 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]>
2022-12-29 10:57:24 +00:00
Jim906 83c65dbb04 fat: record time of file modification
* 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]>
2022-12-23 09:03:04 +00:00
Jim906 e7893cc94f tracker/infowindow: display filesystem type
* 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]>
2022-08-01 06:54:01 +00:00
Jim906 3f377da09a BFilePanel: save state less often
* 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]>
2022-07-17 07:37:10 +00:00
Jim906 5e0c100f78 BFilePanel: use position from FilePanelSettings
* 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]>
2022-07-06 16:03:10 +00:00
Jim906 5b5da451b3 StyledEdit: give initial focus to the TextView
* 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]>
2022-06-29 06:44:08 +00:00
Jim906 f386770953 Tracker: Restore search criteria when edit query
* 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]>
2022-06-08 21:31:01 +00:00
Jim906 c90d79f03a tracker/FindPanel: style cleanup
* No functional change.

Change-Id: I8e5e941fe626a77134036e3828f23ab245d2f5c7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5358
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-06-08 21:30:34 +00:00
Jim906 f7eda03757 WebPositive: Don't display '...' icon when empty
* 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]>
2022-05-26 07:42:49 +00:00
Jim906 07d5dba065 kernel/drivers/disk: enable Werror
* For NVMe library, disable warnings.
* Otherwise, change code to avoid generating warnings.
* No functional change.
* Fixes #9460.

Change-Id: Ia790de391e6b230c909dff7023f00a19bdd574be
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5284
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-05-17 11:33:25 +00:00
Jim906 9570ee3534 FileTypes: Improve ApplicationTypeWindow cascading
* 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]>
2022-05-17 11:31:12 +00:00
Jim906 2bda927298 MediaPlayer: add .pls playlist support
* 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]>
2022-04-24 15:55:51 +00:00
Jim906 b59abca856 DiskUsage: Ensure window opens on screen
* Use BWindow::MoveOnScreen to center the window if it opens outside of the screen frame.
* Fixes #16980.

Change-Id: Icf777aea70ed0e91f57bcd425b3dddbdcb7600df
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5180
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-04-08 06:00:58 +00:00
Jim906 a12cf089ee FileTypes: save ApplicationTypeWindow position
* 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]>
2022-04-01 09:38:32 +00:00
Jim906 f159a01a02 FileTypes: Allow expansion of Supported types box
* 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]>
2022-03-31 11:02:52 +00:00