#
5d361b60 |
| 26-Sep-2024 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[FREELDR] fs.c: Fix handling of file handles, (de)referencing, and direct-device access (#7414)
- The original code was just incrementing the reference counts (RefCounts) of the device objects or
[FREELDR] fs.c: Fix handling of file handles, (de)referencing, and direct-device access (#7414)
- The original code was just incrementing the reference counts (RefCounts) of the device objects or the device/file handles, without decrementing them when closing the handles. This is now fixed.
Notice the following:
* When opening a file on a device (disk), the device's (and its handle's) RefCount is incremented, and the file handle's RefCount is incremented as well.
* When closing a file, the file handle's RefCount is decremented (and the file closed if the RefCount reaches zero), and the file's parent device handle is also closed, recursively. This has the effect of decrementing the parent device handle's RefCount, and the device's own RefCount is decremented as well.
IMPORTANT NOTE: The usefulness of handle-level RefCount is still under question, and might be (consistently) removed in the future.
- Fix opening a device (disk) in direct access, when this device is already opened. Indeed, we previously allowed direct access only if the device was opened as such for the very first time (its RefCount = 0 originally); no filesystem mounting was attempted as well. Then for any later open-operations on this device (while keeping an already-opened handle to it), filesystem access was assumed.
Thus, this problem would show up in two ways:
* Either the device is first opened for direct access, this succeeded and no filesystem was mounted. Then, for any other open-operations, the filesystem was NOT mounted, and opening files on it would fail. Direct accesses would succeed but would create an unnecessary second file handle.
* Or, the device is first opened for file-access: a filesystem was mounted and file opening would succeed. Any other file opening operation would succeed as well (if the file exists). But, a direct access open-operation would fail, because now any open-operations on the device would be assumed to be a file opening.
This is now correctly fixed. If direct-open is requested, just do it. If this is a file opening, we open the device, then try to mount a filesystem on it (if not already done), then we try to open the file.
If file opening fails, derereference the device.
- Pass the file path to the filesystem-specific Open() functions without truncating the leading path separator, if any. This has to be handled by the filesystem routines themselves.
show more ...
|
Revision tags: 0.4.16-dev, 0.4.15, 0.4.14-release |
|
#
25e1235f |
| 09-Mar-2021 |
Serge Gautherie <32623169+SergeGautherie@users.noreply.github.com> |
[FREELDR] Remove a few useless code lines (#3503)
CORE-14516
|
Revision tags: 0.4.15-dev, 0.4.14-RC, 0.4.13-release |
|
#
f4fdc957 |
| 26-Jan-2020 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[FREELDR] Use RTL copy/zero-memory helper functions.
|
#
79092842 |
| 09-Oct-2019 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[FREELDR] Advance the file pointers every time a read operation is performed, in accordance with the ARC specification.
|
Revision tags: 0.4.14-dev, 0.4.13-RC, 0.4.12-release |
|
#
e18e7b10 |
| 18-Sep-2019 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[FREELDR] Implement 'SeekRelative' mode for the *Seek() methods for disks & filesystems.
|
#
4843c1a9 |
| 13-Sep-2019 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[FREELDR] Other enhancements.
- Add optional arguments BootDrive and BootPartition to ChainLoadBiosBootSectorCode() so as not to modify explicitly the FrldrBootDrive and FrldrBootPartition varia
[FREELDR] Other enhancements.
- Add optional arguments BootDrive and BootPartition to ChainLoadBiosBootSectorCode() so as not to modify explicitly the FrldrBootDrive and FrldrBootPartition variables, that should remain purely internal.
- Implement ChainLoadBiosBootSectorCode() for x64.
- Get rid of the machine-specific DiskGetBootPath(), and instead do its job only once in the machine-specific InitializeBootDevices() (or in MachInit() for PPC). Cache the result of this operation into the globally-accessible FrldrBootPath buffer. This avoids the unneeded calls to (Mach)DiskGetBootPath() we used to do before. Also remove the separate distinction between the PC and XBOX versions of this functionality.
- Move the PC-specific DiskIsDriveRemovable() and DiskGetBootPath() as well as the disk-IO-error functionality, back into the corresponding PC-arch files.
- Simplify IniFileInitialize(), getting rid of IniOpenIniFile().
show more ...
|
#
602fc29a |
| 30-Aug-2019 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[FREELDR] Formatting only.
|
#
c9a20ced |
| 10-Aug-2019 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[FREELDR] Rework EXT2 filesystem to interface with ARC and not be tied to the boot volume.
See 28bf1f3b (r42537) and c599bd7d (r43267) for additional information.
|
#
8d94b2a6 |
| 10-Aug-2019 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[FREELDR] Diverse enhancements.
- Get rid of the FsCloseFile(), FsReadFile(), FsGetFileInformation(), FsGetFileSize() and FsSetFilePointer() wrappers and use the ARC functions directly instead.
[FREELDR] Diverse enhancements.
- Get rid of the FsCloseFile(), FsReadFile(), FsGetFileInformation(), FsGetFileSize() and FsSetFilePointer() wrappers and use the ARC functions directly instead. Make FsOpenFile() return an ARC file descriptor ID of the correct type. Get rid of unused FS_* defines.
- Use TRACEs in the ***Mount() filesystem functions for diagnostics purposes.
- Remove a leak in FatGetFatEntry(). Assign stuff via QuadPart where possible in FatMount(). Remove an unused member in FAT_FILE_INFO.
- Reduce code indentation in BtrFsMount() and remove a leak there.
- Disable reading the "BootPath" parameter in the linux loader since we don't use this parameter (yet??)
show more ...
|
#
b3821455 |
| 29-Jul-2019 |
Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org> |
[FREELDR] Improve some *GetFileInformation() traces.
|
Revision tags: 0.4.12-RC, 0.4.13-dev, 0.4.11-release, 0.4.11-RC, 0.4.12-dev, 0.4.10-release, 0.4.11-dev, 0.4.10-RC, 0.4.9-release, 0.4.10-dev, 0.4.9-RC, 0.4.8-release, 0.4.8-RC, 0.4.9-dev, 0.4.7-release, v0.4.7, 0.4.8-dev, 0.4.7-rc1 |
|
#
c2c66aff |
| 03-Oct-2017 |
Colin Finck <colin@reactos.org> |
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
|
Revision tags: backups/GSoC_2017/rapps@75905, ReactOS-0.4.6, backups/ros-branch-0_4_6@75728, 0.4.7-dev, ReactOS-0.4.5, backups/ros-branch-0_4_5@74569, ReactOS-0.4.4-CLT2017, backups/ReactOS-0.4.4-CLT2017@74182, ReactOS-0.4.4, backups/ros-branch-0_4_4@74002, ReactOS-0.4.4-FOSDEM2017, backups/ReactOS-0.4.4-FOSDEM2017@73667, ReactOS-0.4.3, backups/ros-branch-0_4_3@73437, backups/sndblst@72664, ReactOS-0.4.2, backups/ros-branch-0_4_2@73087, ReactOS-0.4.1, backups/ros-branch-0_4_1@71718 |
|
#
321bcc05 |
| 24-Apr-2016 |
Pierre Schweitzer <pierre@reactos.org> |
Create the AHCI branch for Aman's work
svn path=/branches/GSoC_2016/AHCI/; revision=71203
|