Start implementing statistics support. So far, everything is just nulled.
These 0 can be properly queried with fsutil fsinfo statistics.
svn path=/trunk/; revision=75937
- Stop passing DO, directly pass VCB
- Try to compute some unique value as internal ID for objects. As MS, return the LBO
CORE-13489
svn path=/trunk/; revision=75210
Modify ReadVolumeLabel() so that it is able to read the volume label, even without using the VCB, the root FCB, Cc, the universe.
This is important, because in case of device verifying, you cannot rely on these elements anylonger, but you need to read the label.
A readme has been attached to the function, to indicate how to call it (I wish I could have put more asserts!). It's ugly, I know.
This allows fixing a FIXME in VfatVerify(): we can also check the volume label for FATX volumes.
The FIXME comment was misleading: MS FastFAT doesn't make any checksum or whatever of FAT root. Let's not do it.
svn path=/trunk/; revision=73830
Generalize the usage of functions pointers for FatX vs Fat specific code (direntry).
This should also help speeding up FastFAT.
svn path=/trunk/; revision=73822
In the FCB, get rid of the FCB_IS_FATX_ENTRY flag. It makes no sense to have it on each and every file as the VCB already has such flag
svn path=/trunk/; revision=73821
More FastFAT cleanup.
Except a light performances boost due to useless checks removal in read/write and to some functions inlining
More to follow...
svn path=/trunk/; revision=73819
Take the volume label into account when comparing the FAT volumes in case of a verify.
This helps avoiding remounting every removable device on verify. Current hack is only kept for FATX volumes for now.
svn path=/trunk/; revision=73733
After renaming a directory, rename any children FCB that would still exist in the FSD. This will allow next directory opening to properly work and open correct data.
This defeats corruption on directory renaming.
Unfortunately, this solution is not ideal and our driver should be reworked so that it quits using a hash table and it quits storing the whole path in the FCBs.
Deep thanks to Wim Hueskes and Thomas Faber for their help debugging the issue!
CORE-11377
svn path=/trunk/; revision=72145
Properly round up 64b values.
This fixes reads on 4GB+ volumes.
Patch by Wim Hueskes.
CORE-10932 #resolve #comment Thanks for the patch! Commited in r71610
svn path=/trunk/; revision=71610
In case we're performing an in-place move (ie, in the same directory), if short name matches before and after, keep it.
This avoids that a file with long file name sees its short name changing on normally 'non-effect' renames.
For instance, in case of case-change only rename, short name will now be preserved.
See ya, you 7y old bug :-)
CORE-3875 #resolve #comment Fixed with r71270
svn path=/trunk/; revision=71270
- Return the appropriate status code when encountering file system corruption
- When encountering corruption, print a message by default instead of breaking into the debugger
svn path=/trunk/; revision=69768
- Don't try to free an uninitialized pointer in VfatSetRenameInformation. CID 1250303
- Actually use the dynamically calculated HashTableSize. CID 1237119/1237120/1237121
svn path=/trunk/; revision=68986
Implement support for FastIO for:
- FastIoQueryBasicInfo
- FastIoQueryStandardInfo
Now, with this commit and the two previous, ReactOS won't attempt to issue an IRP for these query, but will directly go with the FastIO path.
The performance improvement is really visible in 1st stage (at least, here with VBox).
svn path=/trunk/; revision=67824
Fix a fixme in VfatGetUserBuffer():
Only request high priority page when in the paging path. Otherwise, request normal priority
svn path=/trunk/; revision=67808
Bring in initiated work on IRPs in NTFS (and complete it).
This simplifies the way IRPs and their context are handled in the driver.
Only VfatDispatchRequest() is responsible of completing IRPs (if required), freeing the IRP context (if required), and queueing the IRP for later completion (if required).
This allows removing duplicated code, hacks, and so on. It might help reducing IRP leaks, or memory leaks.
By default, VfatDispatchRequest() will complete the IRP and delete the IRP context.
In case you don't want it to complete the IRP (because you passed it down, for instance), remove the IRPCONTEXT_COMPLETE flag. See for instance: VfatDeviceControl().
In case you want to queue the IRP (you previously called: VfatQueueRequest()), call the newly introduced VfatMarkIrpContextForQueue() function that will prepare it.
svn path=/trunk/; revision=67743
So far, totally disable VPB swapout on dismount. It appears to have brought more issues than it actually solves.
A more accurate implementation will be required.
CORE-8928 #comment Can you please retry with r65801
svn path=/trunk/; revision=65801
- Add a flag to enable (or disable depends on your reading ;-)) the VPB swapout process for volume umount.
- By default, disable it for MSVC builds.
This *might* lolfix the MSVC builds.
Just for the record, we also have a bug in the GCC builds but it doesn't seem to show up.
The main issue is that after formatting, we close handle to the volume, and IRP_MJ_CLEANUP is properly received and initiates a bit of dismount.
But then, the IRP_MJ_CLOSE is never received (why????) and thus, dismount cannot properly end.
This is a real & serious issue.
svn path=/trunk/; revision=65527
- Implement VPB swapout in our FAT driver for dismout (see VfatCheckForDismount)
- Dereference volume handles on close (not on cleanup)
- Keep track of the VDO in our VCB
- Let VfatCheckForDismount() do the actual dismount, instead of VfatDismountVolume() which just initiates it
CORE-8732 #comment Can you retry?
svn path=/trunk/; revision=65372
On the road for getting rid of IopParseDevice() hack....
- Add support for FSCTL_LOCK_VOLUME, FSCTL_UNLOCK_VOLUME, FSCTL_DISMOUNT_VOLUME in VfatFileSystemControl()
- Implement VfatLockOrUnlockVolume(). This brings some kind of volume locking to FastFAT FSD. It's likely not fully accurate and welcome to race conditions. But, its main purpose is to be used in usetup. So, this is fine for now.
- Stubplement VfatDismountVolume(). This will be implemented later on, but should be relatively straightforward as it requires volume to be locked (so, we're the last ones on it :-)).
svn path=/trunk/; revision=65129
- Implement vfatPrepareTargetForRename() that prepares for renaming. It tries to open target and deletes it if it exists and if allowed. And then, it opens the parent directory.
- Implement VfatSetRenameInformation() that actually does the renaming (call as SetInformationFile). It handles cases we we have (or we don't have) TargetDirectory provided. It sends notifications as appropriated on demands.
- Implement vfatRenameEntry() that renames an entry in place. So far, it only supports FATX entries renaming. FAT entries are a bit more complex. It falls back to vfatMoveEntry() in later cases.
- Implement VfatMoveEntry() that will move an entry accross directories (or in place for FAT). Its principles are simple: it deletes the entry in old parent, and recreate it in new parent, keeping file metadata & data.
- Modify VfatDelEntry() and VfatAddEntry() so that they can handle deleting an entry without touching its data and adding an entry with an already provided FCB and thus use the given metadata.
- Implement vfatDelFCBFromTable() which is just old code moved to new routine to allow reuse. It deletes a FCB entry from hash table. Doesn't deal with references!
- Implement vfatMakeFullName() which is mostly old code moved to new routine to allow reuse. It allocates buffer and copy data for FCB full name.
- Implement vfatUpdateFCB() that will update a FCB with new names and parent. It will remove anything related to old name and will recreate using new data. It will adjust references count.
- Modify vfatMakeFCBFromDirEntry() so that it calls vfatMakeFullName().
- Modify vfatReleaseFCB() so that it calls vfatDelFCBFromTable().
- Revert VfatOpenFile() to its previous features.
- Modify VfatCreateFile() to reimplement support for SL_OPEN_TARGET_DIRECTORY. It is way less hackish than previously. It also properly opens parent now, by incrementing its handle count and by setting appropriate access rights.
[KERNEL32]
- Rewritten MoveFileWithProgressW() to implement all the missing features that are used in Windows 2k3 including links and reparse points.
- Implemented BasepMoveFileDelayed() to replace deprecated add_boot_rename_entry(). This functions is matching the features implemented in SMSS.
- Implemented BasepMoveFileCopyProgress() which is used in MoveFileWithProgressW().
- Stubbed BasepNotifyTrackingService() which is not use at the moment (FastFAT, even in Windows doesn't provide such feature).
- Reimplemented ReplaceFileA(), MoveFileWithProgressA() to quit Winisms and use our internal helpers.
- Make MoveFileX() use MoveFileWithProgressX() directly.
- Fixed a few prototypes.
TL;DR:
This (huge) commit implements file and directory renaming in FastFAT driver. This allows getting rid of old implementation in kernel32 where files were force copied.
A feature is still missing, but Jérôme should implement it anytime soon (he prototyped it already): moving directories across volumes. This requires some work in BasepCopyFileExW().
Kudos to all the devs who helped me on this: Christoph, Hervé, Jérôme, Thomas.
This finally allows killing CR-52... It was about time!
svn path=/trunk/; revision=64836
Add required fields to handle file system notifications to device extension/VCB and properly initialize them on volume mount
svn path=/trunk/; revision=62443
Make our FAT driver PNP aware.
On PNP requests it should handle, it will return STATUS_NOT_IMPLEMENTED.
On the others, it will pass them to lower driver.
This is the first step outside the kernel into getting IoGetRelatedTargetDevice (and so notifications) working.
It doesn't work at the moment, as class2 doesn't handle PNP.
[NTOSKRNL]
Some fixes to IRP cancelation process:
- Renamed IopRemoveThreadIrp() to IopDisassociateThreadIrp() to match Windows 2k3
- Made dead IRP global, to make its debug easier.
- IopDisassociateThreadIrp(), Handle dead IRP at dispatch level, using IoCompletionLock.
- IopDisassociateThreadIrp(), Use the proper error code to write the entry to logs.
- IoCancelIrp(), removed non needed ASSERT, which is even not present on Windows, removed corresponding var as well.
- IoCancelIrp(), fixed parameters to KeBugCheckEx() call.
- IoCancelThreadIo() is pageable.
- IoCancelThreadIo() under Windows isn't using given thread, but using current. Do the same here.
All that stuff doesn't fix bug #5550, it comes from outside.
Patch by Pierre Schweitzer, modified by me to make it compile. If it breaks anything, don't blame me!
svn path=/trunk/; revision=48560
- Remove some unused and deprecated macros from the network stack that did this.
- fastfat_new: Use FAT_FILE_SYSTEM instead of magic 0x23.
svn path=/trunk/; revision=43673
modified drivers/filesystems/fastfat/dirwr.c
modified drivers/filesystems/fastfat/ea.c
modified drivers/filesystems/fastfat/finfo.c
Silence "argument unused" warnings
Corrected several accesses to potentially uninitialized variables
modified drivers/filesystems/fastfat/vfat.h
Visual C++ is no longer a guarantee of compilation with the DDK
Patch by Samuel Serapión <samdwise51@gmail.com>
svn path=/trunk/; revision=41457
- Fix memory corruption that happened pretty much everytime you pressed a key or moved the mouse -- reponsible for countless crashes, including the famous ASSERT during 1-stage setup.
- Remove anti-memory-corruption-workaround from VFAT
- Note: If you're going to do use device queues in your driver, please learn how. Kthxbye.
Patch by Alex Ionescu <alex.ionescu@reactos.org>
_____
Alex,
Marry me,
KJK::Hyperion
XOXOXO
See issue #3116 for more details.
svn path=/trunk/; revision=33633
- CDFS should enter a critical region before acquiring a resource.
- "Fix" resource assert during installation by adding some padding at the end of the VFAT FCB header -- corruption happens at pad 51.
- Once we detect corruption at pad 51, skip the FCB instead of attempting to flush it.
- Fix a serious bug in our detection of incorrect resource usage while APCs are not disabled.
- Fix a serious bug which caused shared resources not to wake up waiters when it was released, and which cause it to wake up waiters when there were still active locks held.
New ERESOURCE implementation by Aleksey (thanks to Alex for providing the information required)
- Remove ERESOURCE_XP concept, and fix the three incorrect and different definitions of the ERESOURCE structure.
- Fix the ERESOURCE implementation to use the new Vista ERESOURCE type. Two main changes:
* The count is now a 32-bit count called ActiveEntries. ActiveCount is now simply a flip-flop bit (0/1) for backward compatibility (we set to 0 when active entries is 0, and 1 when active entries is > 0)
* Instead of caching two owners, we only cache one owner, in the OwnerEntry field.
- Optimize some search algorithms slightly (just better code).
- Remove duplicated code for ExReleaseResourceLite and call ExReleaseResourceForThreadLite instead. Alex says this is ok.
svn path=/trunk/; revision=33111