Is it possible that an FO previously used to represent a directory be used
to represent a File (before deleting it)?
Also, in Filespy code SpyLogIrpCompletion routine, what do these lines mean?
What is the logic behind deleting the name, and why do we assue that we can
get it the next time?
case IRP_MJ_SET_INFORMATION:
//
// If the operation was successful and it was a rename, always
// remove the name. They can re-get it next time.
//
if (NT_SUCCESS(Irp->IoStatus.Status) &&
(FileRenameInformation ==
pIrpStack->Parameters.SetFile.FileInformationClass)) {
SpyNameDelete(pIrpStack->FileObject);
}
break;
–
No. Only after IRP_MJ_CLOSE the file object( actually memory ) can be reused.
“amitr0” wrote in message news:xxxxx@ntfsd…
Is it possible that an FO previously used to represent a directory be used to represent a File (before deleting it)?
Also, in Filespy code SpyLogIrpCompletion routine, what do these lines mean? What is the logic behind deleting the name, and why do we assue that we can get it the next time?
case
IRP_MJ_SET_INFORMATION:
//
// If the operation was successful and it was a rename, always
// remove the name. They can re-get it next time.
//
if (NT_SUCCESS(Irp->IoStatus.Status) &&
(FileRenameInformation ==
pIrpStack->Parameters.SetFile.FileInformationClass)) {
SpyNameDelete(pIrpStack->FileObject);
}
break;
–
- amitr0
SORRY FOR THE REPOST, BUT THE SERVER REJECTED THE LAST MAIL
right…this is what i had thought of, just like IRPS, which might be
allocated only once but reused many times to save time and resources to
allocate and deallocate memory, correct?
What about the second question, can cany one please enlighten me abt it.
I think memory is allocated anytime when object is created. Actually most of the objects( may be all ) are allocated from kernel’s pools, so this is not pure reuse of the objects like in the SLAB allocators. The kernel’s memory allocator contains the lists( one list for each size smaller than the page size ) of free blocks and returns the blocks from this lists, so if you free a block ‘A’ of size ‘N’ and then allocate a block of the same size ‘N’ the returned block may be the same block ‘A’ if another thread do not allocate this block between you free and allocate the block.
“amitr0” wrote in message news:xxxxx@ntfsd…
SORRY FOR THE REPOST, BUT THE SERVER REJECTED THE LAST MAIL
right…this is what i had thought of, just like IRPS, which might be
allocated only once but reused many times to save time and resources to
allocate and deallocate memory, correct?
What about the second question, can cany one please enlighten me abt it.
File objects may be allocated from non-paged pool or from the thread’s
stack. If they are from the thread’s stack, there is a requirement that
they not live beyond the current call sequence (e.g., you can’t
reference it and expect it to be valid once you return.)
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Slava Imameyev
Sent: Wednesday, July 05, 2006 7:53 AM
To: ntfsd redirect
Subject: Re:[ntfsd] FileObjects reuse
I think memory is allocated anytime when object is created. Actually
most of the objects( may be all ) are allocated from kernel’s pools, so
this is not pure reuse of the objects like in the SLAB allocators. The
kernel’s memory allocator contains the lists( one list for each size
smaller than the page size ) of free blocks and returns the blocks from
this lists, so if you free a block ‘A’ of size ‘N’ and then allocate a
block of the same size ‘N’ the returned block may be the same block ‘A’
if another thread do not allocate this block between you free and
allocate the block.
“amitr0” wrote in message
news:xxxxx@ntfsd…
SORRY FOR THE REPOST, BUT THE SERVER REJECTED THE LAST MAIL
right…this is what i had thought of, just like IRPS, which
might be
allocated only once but reused many times to save time and
resources to
allocate and deallocate memory, correct?
What about the second question, can cany one please enlighten me
abt it.
—
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument:
‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com