FAT vs. NTFS

I have one question about different behaviour on Fat and NTFS
partitions.
By simple file copy to directory on Fat partition, the sequence of IO
requests targeted to destination file object is:

IRP_MJ_CREATE
IRP_MJ_WRITE - no paging IO, probably initialization of caching
IRP_MJ_CLEANUP
and after some time
IRP_MJ_WRITE - paging IO (may be lazy write)
IRP_MJ_CLOSE

But on NTFS partition:

IRP_MJ_CREATE
IRP_MJ_WRITE - no paging IO, probably initialization of caching
IRP_MJ_CLEANUP
IRP_MJ_CLOSE

and paging IO never occurs. File is not opened with
NO_ITERMEDIATE_BUFFERING flag set and write request has not set
IRP_NOCACHE. Can be cached write done directly to disk without paging?

Sigh. This question seems to come up (in one form or another) repeatedly.

NTFS uses “stream file objects”. The I/O IS occuring, but you are missing
the I/O because it occurs against a DIFFERENT file object - one that NTFS
has internally created. Since, no matter how many file objects exist for
the file, the VM system maintains a reference to ONE file object, all of the
paging I/O is done against that ONE file object. Thus, all paging I/O is
done against some specific file object. In the FAT case you get lucky and
it is the same file object that was used to perform the user level I/O. In
the NTFS case you don’t get lucky and the I/O is against a different file
object.

Had you copied the file TWICE on FAT, the second time you should have
observed a pattern similar to NTFS (because it would use the file object
created the first time.)

Thus, the point: File Objects represent open instances of the file. There
can be MANY file objects. File systems are allowed to create them
internally and use them instead of using the user’s file object.

Instead of looking at file objects, I’d suggest that you try to observe the
I/O to the file (and you can do that, for NTFS and FAT, at least, using the
FsContext pointer in the file object. Two files that have the same
FsContext structure are the same file.)

I hope this helps.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: AlfaVS - Veishab Milan [mailto:xxxxx@sofos.sk]
Sent: Thursday, May 25, 2000 2:54 PM
To: File Systems Developers
Subject: [ntfsd] FAT vs. NTFS

I have one question about different behaviour on Fat and NTFS
partitions.
By simple file copy to directory on Fat partition, the sequence of IO
requests targeted to destination file object is:

IRP_MJ_CREATE
IRP_MJ_WRITE - no paging IO, probably initialization of caching
IRP_MJ_CLEANUP
and after some time
IRP_MJ_WRITE - paging IO (may be lazy write)
IRP_MJ_CLOSE

But on NTFS partition:

IRP_MJ_CREATE
IRP_MJ_WRITE - no paging IO, probably initialization of caching
IRP_MJ_CLEANUP
IRP_MJ_CLOSE

and paging IO never occurs. File is not opened with
NO_ITERMEDIATE_BUFFERING flag set and write request has not set
IRP_NOCACHE. Can be cached write done directly to disk without paging?


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Tony,

How would you keep track of NTFS compressed files (different FsContext)?

Vladimir

-----Original Message-----
From: Tony Mason
To: File Systems Developers
Date: 25 ìàÿ 2000 ã. 23:11
Subject: [ntfsd] RE: FAT vs. NTFS

>Sigh. This question seems to come up (in one form or another) repeatedly.
>
>NTFS uses “stream file objects”. The I/O IS occuring, but you are missing
>the I/O because it occurs against a DIFFERENT file object - one that NTFS
>has internally created. Since, no matter how many file objects exist for
>the file, the VM system maintains a reference to ONE file object, all of
the
>paging I/O is done against that ONE file object. Thus, all paging I/O is
>done against some specific file object. In the FAT case you get lucky and
>it is the same file object that was used to perform the user level I/O. In
>the NTFS case you don’t get lucky and the I/O is against a different file
>object.
>
>Had you copied the file TWICE on FAT, the second time you should have
>observed a pattern similar to NTFS (because it would use the file object
>created the first time.)
>
>Thus, the point: File Objects represent open instances of the file. There
>can be MANY file objects. File systems are allowed to create them
>internally and use them instead of using the user’s file object.
>
>Instead of looking at file objects, I’d suggest that you try to observe the
>I/O to the file (and you can do that, for NTFS and FAT, at least, using the
>FsContext pointer in the file object. Two files that have the same
>FsContext structure are the same file.)
>
>I hope this helps.
>
>Regards,
>
>Tony
>
>Tony Mason
>Consulting Partner
>OSR Open Systems Resources, Inc.
>http://www.osr.com
>
>
>-----Original Message-----
>From: AlfaVS - Veishab Milan [mailto:xxxxx@sofos.sk]
>Sent: Thursday, May 25, 2000 2:54 PM
>To: File Systems Developers
>Subject: [ntfsd] FAT vs. NTFS
>
>
>I have one question about different behaviour on Fat and NTFS
>partitions.
>By simple file copy to directory on Fat partition, the sequence of IO
>requests targeted to destination file object is:
>
> IRP_MJ_CREATE
> IRP_MJ_WRITE - no paging IO, probably initialization of caching
> IRP_MJ_CLEANUP
> and after some time
> IRP_MJ_WRITE - paging IO (may be lazy write)
> IRP_MJ_CLOSE
>
>But on NTFS partition:
>
> IRP_MJ_CREATE
> IRP_MJ_WRITE - no paging IO, probably initialization of caching
> IRP_MJ_CLEANUP
> IRP_MJ_CLOSE
>
>and paging IO never occurs. File is not opened with
>NO_ITERMEDIATE_BUFFERING flag set and write request has not set
>IRP_NOCACHE. Can be cached write done directly to disk without paging?
>
>
>—
>You are currently subscribed to ntfsd as: xxxxx@osr.com
>To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
>—
>You are currently subscribed to ntfsd as: xxxxx@aha.ru
>To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
>