Hello,
In a win32 application I open a big and badly fragmented file
in non-buffering mode and read a big chunk of data
fh = CreateFile(…, FILE_FLAG_NO_BUFFERING,…);
ReadFile(fh, buf, 1048576, &bytesRead, NULL);
Then in my disk filter driver, the ReadDispatch routine gets an
IRP with
pIrpStack->Parameters.Read.ByteOffset.QuadPart == xxxxxxxx
pIrpStack->Parameters.Read.Length == 1048576
Since the file is fragmented, should the driver get a bunch of IPRs
with disjoint offsets and shorter lengths instead of a big one? what
am I missing here?
TIA,
Chu Bun
The file is obviously not fragmented if the filesystem is requesting all
of the data in one continuous chunk. You’re sure you’re filtering the
correct device?
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of ChuBun
Sent: Thursday, June 26, 2003 1:16 PM
To: File Systems Developers
Subject: [ntfsd] Confused: Read length and file fragmentation
Hello,
In a win32 application I open a big and badly fragmented file
in non-buffering mode and read a big chunk of data
fh = CreateFile(…, FILE_FLAG_NO_BUFFERING,…);
ReadFile(fh, buf, 1048576, &bytesRead, NULL);
Then in my disk filter driver, the ReadDispatch routine gets
an IRP with
pIrpStack->Parameters.Read.ByteOffset.QuadPart == xxxxxxxx
pIrpStack->Parameters.Read.Length == 1048576
Since the file is fragmented, should the driver get a bunch
of IPRs with disjoint offsets and shorter lengths instead of
a big one? what am I missing here?
TIA,
Chu Bun
You are currently subscribed to ntfsd as: xxxxx@nryan.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
And how is the object manager gonna know about it?
Usually you would get paging I/O IRPs, if you used buffered mode, but
since you used non buffering one, all is left to the file system to
handle.
ChuBun wrote:
Hello,
In a win32 application I open a big and badly fragmented file
in non-buffering mode and read a big chunk of data
fh = CreateFile(…, FILE_FLAG_NO_BUFFERING,…);
ReadFile(fh, buf, 1048576, &bytesRead, NULL);
Then in my disk filter driver, the ReadDispatch routine gets an
IRP with
pIrpStack->Parameters.Read.ByteOffset.QuadPart == xxxxxxxx
pIrpStack->Parameters.Read.Length == 1048576
Since the file is fragmented, should the driver get a bunch of IPRs
with disjoint offsets and shorter lengths instead of a big one? what
am I missing here?
TIA,
Chu Bun
You are currently subscribed to ntfsd as: xxxxx@alfasp.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
–
Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32
developers.
Alfa File Monitor - File monitoring library for Win32 developers.
I shouldn’t reply too early in the morning, I see:-) (I didn’t notice
you were talking about disk and not FS filter. Or are you?)
And are you sure the file is fragmented where you suppose it is
fragmented?
ChuBun wrote:
Hello,
In a win32 application I open a big and badly fragmented file
in non-buffering mode and read a big chunk of data
fh = CreateFile(…, FILE_FLAG_NO_BUFFERING,…);
ReadFile(fh, buf, 1048576, &bytesRead, NULL);
Then in my disk filter driver, the ReadDispatch routine gets an
IRP with
pIrpStack->Parameters.Read.ByteOffset.QuadPart == xxxxxxxx
pIrpStack->Parameters.Read.Length == 1048576
Since the file is fragmented, should the driver get a bunch of IPRs
with disjoint offsets and shorter lengths instead of a big one? what
am I missing here?
–
Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32
developers.
Alfa File Monitor - File monitoring library for Win32 developers.
What I have is a mirror disk driver. My concern is the driver will get
only a big IRP and when I pass it down to the lower device, I’ll
get back incorrect data.
Maybe my test file is not fragmented. I’ll try an outlook file pst file
later. I
know outlook files are very fragmented.
Regards,
“ChuBun” wrote in message news:xxxxx@ntfsd…
>
> Hello,
>
> In a win32 application I open a big and badly fragmented file
> in non-buffering mode and read a big chunk of data
>
> fh = CreateFile(…, FILE_FLAG_NO_BUFFERING,…);
> ReadFile(fh, buf, 1048576, &bytesRead, NULL);
>
> Then in my disk filter driver, the ReadDispatch routine gets an
> IRP with
>
> pIrpStack->Parameters.Read.ByteOffset.QuadPart == xxxxxxxx
> pIrpStack->Parameters.Read.Length == 1048576
>
> Since the file is fragmented, should the driver get a bunch of IPRs
> with disjoint offsets and shorter lengths instead of a big one? what
> am I missing here?
>
> TIA,
> Chu Bun
>
>
>
>
>
>
>
>
Don’t ASSUME - test! There are APIs to tell if a file is fragmented and
exactly how fragmented it is - use them.
ChuBun wrote:
What I have is a mirror disk driver. My concern is the driver will get
only a big IRP and when I pass it down to the lower device, I’ll
get back incorrect data.
Maybe my test file is not fragmented. I’ll try an outlook file pst file
later. I know outlook files are very fragmented.
–
Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: xxxxx@alfasp.com
Alfa Transparent File Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32
developers.
Alfa File Monitor - File monitoring library for Win32 developers.
FSCTL_GET_RETRIEVAL_POINTERS returns the disk cluster numbers
underlying a file.
Max
----- Original Message -----
From: “Dejan Maksimovic”
To: “File Systems Developers”
Sent: Friday, June 27, 2003 8:30 PM
Subject: [ntfsd] Re: Confused: Read length and file fragmentation
>
> Don’t ASSUME - test! There are APIs to tell if a file is
fragmented and
> exactly how fragmented it is - use them.
>
> ChuBun wrote:
>
> > What I have is a mirror disk driver. My concern is the driver
will get
> > only a big IRP and when I pass it down to the lower device, I’ll
> > get back incorrect data.
> > Maybe my test file is not fragmented. I’ll try an outlook file
pst file
> > later. I know outlook files are very fragmented.
>
> –
> Kind regards, Dejan M. MVP for DDK
> http://www.alfasp.com E-mail: xxxxx@alfasp.com
> Alfa Transparent File Encryptor - Transparent file encryption
services.
> Alfa File Protector - File protection and hiding library for Win32
> developers.
> Alfa File Monitor - File monitoring library for Win32 developers.
>
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com