CcCopyWrite() when WriteBehind is disabled

Should a call to CcCopyWrite(), when the wait parameter is set to true,
immediatly call back into my write handler with a pagingIo? It seems like
it should.

I setup the cache on the first write:

CcInitializeCacheMap( IrpSp->FileObject,
(PCC_FILE_SIZES) &Fcb->Header.AllocationSize,
FALSE,
&FsData.CacheManagerCallbacks,
Fcb );

CcSetAdditionalCacheAttributes(IrpSp->FileObject, TRUE, TRUE);

then copy it to CC:

CcCopyWrite( IrpSp->FileObject,
&StartingOffset,
ByteCount,
Wait,
SystemBuffer);

But then, CC takes its sweet time calling back for a physical write. Am I
missing something? I really need delayed write to be disabled.

Disabling write behind does not make the cached writes write through to
disk. In fact, if you disable write behind, you should see paging
writes *less* frequently because the lazy writer and modified page
writer aren’t flushing the file on your behalf as frequently.

Do you want to control when the data in the cache goes to disk, or do
you want all cache writes to be immediately reflected on disk? If yours
is the later case, you want to open the file with the FILE_WRITE_THROUGH
option.

Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: xxxxx@charter.net [mailto:xxxxx@charter.net]
Sent: Friday, March 07, 2003 12:45 PM
To: File Systems Developers

Should a call to CcCopyWrite(), when the wait parameter is set to true,
immediatly call back into my write handler with a pagingIo? It seems
like it should.

I setup the cache on the first write:

CcInitializeCacheMap( IrpSp->FileObject,
(PCC_FILE_SIZES) &Fcb->Header.AllocationSize,
FALSE,
&FsData.CacheManagerCallbacks,
Fcb );

CcSetAdditionalCacheAttributes(IrpSp->FileObject, TRUE, TRUE);

then copy it to CC:

CcCopyWrite( IrpSp->FileObject,
&StartingOffset,
ByteCount,
Wait,
SystemBuffer);

But then, CC takes its sweet time calling back for a physical write. Am
I missing something? I really need delayed write to be disabled.


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I need cache writes to be immediately reflected on disk.

If I perform a physical write at the same time I call CcCopyWrite() then
how would I let Cc know that the data is flushed to disk?

Thanks!

If you can open the file with the option FILE_WRITE_THROUGH, Cc will do
the work for you. Once the cached data is change, Cc will flush the
appropriate sections.

If you need to control the flush yourself, call CcFlushCache(). This
will cause the data to be flushed and Cc will also update its metadata
so as to know that the data has already been flushed to disk. This
option may make sense as well if you know you are going to do a number
of cached writes that can wait to be flushed together with one call to
CcFlushCache.

Remember, writing the data to disk is going to greatly decrease your
performance – we don’t just cache the data for the fun of it :). I
realize that in some cases, having the cache data different than what is
on disk is just not an option, but the more you can minimize your
flushing, the better.

Molly Brown
Microsoft Corporation

This posting is provided “AS IS” with no warranties and confers no
rights.

-----Original Message-----
From: xxxxx@charter.net [mailto:xxxxx@charter.net]
Sent: Friday, March 07, 2003 2:17 PM
To: File Systems Developers

I need cache writes to be immediately reflected on disk.

If I perform a physical write at the same time I call CcCopyWrite() then
how would I let Cc know that the data is flushed to disk?

Thanks!


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Use CcFlushCache to write it. The support you are using is designed to
let a caller implement their own lazy writer equivalent.

-----Original Message-----
From: xxxxx@charter.net [mailto:xxxxx@charter.net]
Sent: Friday, March 07, 2003 2:17 PM
To: File Systems Developers

I need cache writes to be immediately reflected on disk.

If I perform a physical write at the same time I call CcCopyWrite() then
how would I let Cc know that the data is flushed to disk?

Thanks!


You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Why not call just call CcFlushCache after CcCopyWrite?

  • Nicholas Ryan

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@charter.net
Sent: Friday, March 07, 2003 2:17 PM
To: File Systems Developers
Subject: [ntfsd] RE: CcCopyWrite() when WriteBehind is disabled

I need cache writes to be immediately reflected on disk.

If I perform a physical write at the same time I call
CcCopyWrite() then how would I let Cc know that the data is
flushed to disk?

Thanks!


You are currently subscribed to ntfsd as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com