Commit f0243fe
committed
Streamline mount/unmount for dehydrating folders
In microsoft#1890 I demonstrated that it's possible to dehydrate folders
without unmounting at all. Unfortunately that requires deleting all the
placeholders and hydrated files which is too slow for dehydrating
anything substantial. The current implementation avoids this by moving
instead of deleting (which has the additional benefit of providing a
backup) but ProjFS doesn't support moving or renaming folders, so we
can't do that while mounted.
This pull request takes a different approach to reducing the overhead
of unmounting for dehydration. Instead of unmounting, moving, and
remounting from the dehydrate verb, those steps are moved into the
mount process under its dehydrate message handler. The mount process
only disposes and recreates the components required for virtualization,
avoiding several costly steps (eg authentication with Azure DevOps,
verification of the cache server, verification of ProjFS installation).
For the repo I work in, dehydrating a top-level directory is reduced
from 33 seconds to 11 seconds with this change.
Specific changes:
* Backup of non-src folders (.git, .gvfs) is added to dehydrate folders.
Previously it was only done for full dehydrate.
* Unmount, move/backup of folders, and mount are moved from
DehydrateVerb to InProcessMount. To support this, the DehydrateFolders
message has the backup folder added to its fields.
* The core methods of Mount and Unmount have a parameter added to skip
disposing (on unmount) and initialization (on mount) of certain
components which are ok to leave alive during the temporary unmount.
* Ownership of GVFSContext disposal fixed - FileSystemCallbacks was
disposing it despite not owning it.
* Missing disposal of a file stream in BackgroundFileSystemTaskRunner
is fixed.
* WindowsFileSystemVirtualizer.DehydrateFolder will now delete a
tombstone file for the directory if present. This allows us to support
fixing a directory that the user manually deleted while mounted (perhaps
in a misguided attempt to dehydrate it), though that would typically
require running 'gvfs dehydrate --no-status' to skip verifying that the
working directory matches the index.
* '--no-status' is now supported with '--folders'1 parent 0ddb3fa commit f0243fe
File tree
6 files changed
+306
-144
lines changed- GVFS
- GVFS.Common
- FileSystem
- NamedPipes
- GVFS.Mount
- GVFS.Virtualization
- Background
- GVFS/CommandLine
6 files changed
+306
-144
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | | - | |
| 212 | + | |
212 | 213 | | |
213 | | - | |
| 214 | + | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| 219 | + | |
| 220 | + | |
218 | 221 | | |
219 | 222 | | |
220 | | - | |
| 223 | + | |
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
308 | 308 | | |
309 | 309 | | |
310 | 310 | | |
311 | | - | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
312 | 314 | | |
313 | 315 | | |
314 | 316 | | |
| |||
357 | 359 | | |
358 | 360 | | |
359 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
360 | 406 | | |
361 | 407 | | |
362 | 408 | | |
| |||
551 | 597 | | |
552 | 598 | | |
553 | 599 | | |
554 | | - | |
| 600 | + | |
555 | 601 | | |
556 | | - | |
| 602 | + | |
557 | 603 | | |
558 | 604 | | |
559 | 605 | | |
| |||
596 | 642 | | |
597 | 643 | | |
598 | 644 | | |
599 | | - | |
| 645 | + | |
600 | 646 | | |
601 | 647 | | |
602 | 648 | | |
| |||
723 | 769 | | |
724 | 770 | | |
725 | 771 | | |
726 | | - | |
| 772 | + | |
727 | 773 | | |
728 | 774 | | |
729 | | - | |
| 775 | + | |
730 | 776 | | |
731 | | - | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
732 | 781 | | |
733 | 782 | | |
734 | 783 | | |
| |||
763 | 812 | | |
764 | 813 | | |
765 | 814 | | |
766 | | - | |
767 | | - | |
768 | | - | |
| 815 | + | |
769 | 816 | | |
770 | | - | |
771 | | - | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
772 | 823 | | |
773 | | - | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
779 | 831 | | |
780 | 832 | | |
781 | 833 | | |
| |||
794 | 846 | | |
795 | 847 | | |
796 | 848 | | |
797 | | - | |
| 849 | + | |
798 | 850 | | |
799 | 851 | | |
800 | 852 | | |
| |||
817 | 869 | | |
818 | 870 | | |
819 | 871 | | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
820 | 878 | | |
821 | 879 | | |
822 | 880 | | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | 230 | | |
237 | 231 | | |
238 | 232 | | |
| |||
0 commit comments