Commit graph

48 commits

Author SHA1 Message Date
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
Pierre Schweitzer 10a7555f9e [FASTFAT]
Implement statistics counting for create operations.

svn path=/trunk/; revision=75938
2017-09-24 09:50:36 +00:00
Pierre Schweitzer 1fac1ca781 [FASTFAT]
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
2017-09-24 08:56:06 +00:00
Pierre Schweitzer 0706d8cb47 [FASTFAT]
- 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
2017-06-26 18:10:43 +00:00
Thomas Faber e6825b17d8 [FASTFAT]
- Add support for FILE_DELETE_ON_CLOSE
CORE-6931 #resolve

svn path=/trunk/; revision=74450
2017-05-02 19:33:14 +00:00
Pierre Schweitzer 590c4dcc8c [FASTFAT]
Get rid of the ENTRY_DELETED2, ENTRY_VOLUME2 and ENTRY_END2 macros.

svn path=/trunk/; revision=73831
2017-02-18 21:37:56 +00:00
Pierre Schweitzer 1dc27a26be [FASTFAT]
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
2017-02-18 21:24:31 +00:00
Pierre Schweitzer 9c5c0b479a [FASTFAT]
Move ReadVolumeLabel() to fsctl.c close to functions that need it

svn path=/trunk/; revision=73829
2017-02-18 18:35:48 +00:00
Pierre Schweitzer 1f58ae3a5d [FASTFAT]
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
2017-02-17 22:25:03 +00:00
Pierre Schweitzer 41f23cace3 [FASTFAT]
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
2017-02-17 21:24:12 +00:00
Pierre Schweitzer 92922765ac [FASTFAT]
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
2017-02-17 17:58:18 +00:00
Pierre Schweitzer 57ec8a7319 [FASTFAT]
Fix a few ugly things.
Both Thomas & cppcheck should be happier now!

svn path=/trunk/; revision=73807
2017-02-17 11:08:38 +00:00
Pierre Schweitzer 6e89272bef [FASTFAT]
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
2017-02-06 19:43:48 +00:00
Amine Khaldi 5c2f126896 [DRIVERS] Spelling fixes by Josh Soref. CORE-12286
svn path=/trunk/; revision=73226
2016-11-13 15:31:39 +00:00
Pierre Schweitzer 2f3c2c58d2 [FASTFAT]
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
2016-08-07 12:29:48 +00:00
Pierre Schweitzer bf24a57417 [FASTFAT]
Addendum to r72124

svn path=/trunk/; revision=72125
2016-08-06 08:32:17 +00:00
Pierre Schweitzer 4746de9066 [FASTFAT]
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
2016-06-11 09:32:00 +00:00
Pierre Schweitzer 3b58992913 [FASTFAT]
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
2016-05-06 21:06:31 +00:00
Pierre Schweitzer f5eff4b750 [FASTFAT]
Update the FCB cached dir entry in case of a rename.

CORE-11150 #resolve #comment Fixed in r71209

svn path=/trunk/; revision=71209
2016-04-30 08:20:00 +00:00
Thomas Faber 668e97e38d [FASTFAT]
- 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
2015-11-01 08:55:47 +00:00
Stefan Ginsberg 7fc480a7c1 Fix the FSDs to use the INIT_SECTION-style and add the alloc_text-s required for MSVC. Please make sure to add section declarations for both compilers for any new functions!
svn path=/trunk/; revision=69170
2015-09-10 12:00:28 +00:00
Thomas Faber 2231e344a2 [FASTFAT]
- 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
2015-09-04 08:37:01 +00:00
Pierre Schweitzer f3b5c2fe1e [CDFS]
[FASTFAT]
[MUP]
[NTFS]
Mark DriverEntry() and associated functions as INIT

svn path=/trunk/; revision=68965
2015-09-03 20:34:47 +00:00
Pierre Schweitzer 4f7de22ae4 [FASTFAT]
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
2015-05-18 19:51:14 +00:00
Pierre Schweitzer 89eca90722 [FASTFAT]
Fix a fixme in VfatGetUserBuffer():
Only request high priority page when in the paging path. Otherwise, request normal priority

svn path=/trunk/; revision=67808
2015-05-17 12:22:28 +00:00
Pierre Schweitzer 3b6a55716f [FASTFAT]
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
2015-05-15 16:03:29 +00:00
Pierre Schweitzer cc116aa826 [FASTFAT]
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
2014-12-22 23:00:22 +00:00
Pierre Schweitzer e85718fec8 [FASTFAT]
- 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
2014-11-29 20:26:07 +00:00
Pierre Schweitzer 0440330ea6 [FASTFAT]
- 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
2014-11-10 22:11:36 +00:00
Pierre Schweitzer f00ed8906d [FASTFAT]
- Store IO VPB in our VCB for later use
- Prepare a spare VPB in our VCB for dismount swapout

svn path=/trunk/; revision=65361
2014-11-10 17:42:51 +00:00
Pierre Schweitzer ab38eafc21 [FASTFAT]
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
2014-10-30 20:56:40 +00:00
Pierre Schweitzer b70df35327 [FASTFAT]
- 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
2014-10-19 21:38:32 +00:00
Thomas Faber b82e2bf972 [FASTFAT]
- Properly handle errors in CcInitializeCacheMap, CcCopyRead and CcCopyWrite
CORE-8410

svn path=/trunk/; revision=63928
2014-08-24 03:28:01 +00:00
Pierre Schweitzer 0ef03fcf25 [FASTFAT]
Add required fields to handle file system notifications to device extension/VCB and properly initialize them on volume mount

svn path=/trunk/; revision=62443
2014-03-07 19:38:35 +00:00
Amine Khaldi 6ead37dc63 [FASTFAT]
* Add header guards to the main header.
* Improve header inclusions.
CORE-7716

svn path=/trunk/; revision=62008
2014-02-06 12:28:49 +00:00
Amine Khaldi f69a3b2930 [FASTFAT]
* Do not include debug.h into the main header.

svn path=/trunk/; revision=61295
2013-12-19 16:20:28 +00:00
Eric Kohl ad566c4411 [FASTFAT]
Fix coding style and indentation in remaining files. No code changes!

svn path=/trunk/; revision=61261
2013-12-12 13:51:50 +00:00
Rafal Harabien a79949498a [FASTFAT]
- Fix DOSDATE struct declaration. Fixes invalid creation, last modified and accessed times on FAT volumes

svn path=/trunk/; revision=54953
2012-01-14 12:02:39 +00:00
Pierre Schweitzer 18204992ea [FASTFAT]
MagicValue--;
ThanksTo(James, Amine);
/* EOF */

svn path=/trunk/; revision=50167
2010-12-27 18:11:35 +00:00
Timo Kreuzer 1cbf4c4057 [FASTFAT]
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
2010-08-18 23:21:15 +00:00
Stefan Ginsberg 3a16c5a061 - Don't use KeBugCheck(0) -- 0 is an invalid bugcode. Use a proper bugcode, DbgBreakPoint or UNIMPLEMENTED instead depending on how the old call was used.
- 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
2009-10-21 17:52:11 +00:00
Stefan Ginsberg ea23cd10c2 - Start deprecating TAG()
- Fix inverted tags in prntfont.h, stdunk.h and win32k/objects/font.c

svn path=/trunk/; revision=42915
2009-08-24 17:12:25 +00:00
Stefan Ginsberg 00e30f7010 - Get rid of ccros.h, deprecated by revision 42175
svn path=/trunk/; revision=42176
2009-07-24 17:35:28 +00:00
KJK::Hyperion 204b2befbb modified drivers/filesystems/fastfat/blockdev.c
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
2009-06-19 00:21:21 +00:00
Stefan Ginsberg dbd86db31e - Deprecate global helper.h -- define the various 'helpful macros' per module
svn path=/trunk/; revision=39092
2009-01-25 16:13:16 +00:00
KJK::Hyperion b16ac9683a - Remove WINE-isms from KeDeviceQueue code
- 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
2008-05-22 11:46:46 +00:00
Aleksey Bragin e74ec0acfc Bug fixes from Alex:
- 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
2008-04-22 20:44:34 +00:00
Aleksey Bragin 21ab956cf9 - Rename vfatfs.sys to fastfat.sys for compatibility reasons.
svn path=/trunk/; revision=32193
2008-02-07 18:06:11 +00:00
Renamed from reactos/drivers/filesystems/vfat/vfat.h (Browse further)