Re: Question regarding vnodes and memory mapped files
Re: Question regarding vnodes and memory mapped files
- Subject: Re: Question regarding vnodes and memory mapped files
- From: mm w <email@hidden>
- Date: Wed, 21 Jan 2009 11:23:40 -0800
I think Narayan means by move "change path" aka for the end user
aka file system representation address
anyway it's a lot of confusion around here Narayan you are assuming
that a file descriptor
depends on the path :) thanks a "FS system" is not stocked by this,
you should have make some tests
before asking your question (open a fd move remove on the file system
representation whatever you want and trace what exactly happens, it's
enough easy to do)
you should start to read some stuff of Kirk (Marshall Kirk McKusick ),
who spent a lot of time to write
interesting stuff, your questions doesn't only fit with macos, the
disease is deeper
Cheers!
On Wed, Jan 21, 2009 at 8:39 AM, Michael Smith <email@hidden> wrote:
>
> On Jan 21, 2009, at 1:21 AM, Narayan Subramanian wrote:
>
> My question here is: Do we not call close() on the executable files
> descriptor after we mmap() them into the process address space (inside
> dyld)? I am assuming that the vnode corresponding to the file descriptor
> should get freed after the file descriptor gets closed (right?).
>
> No.
>
> (I mean isn't that the only way we can move around an (on disk) executable
> file that being run by another process?).
>
> What do you mean by "move around"?
>
> If that is true, how is it that we are still able to trace the vnode that
> represents the file that was mmap()ed, after its descriptor was close()d?
>
> The same way as before.
>
> Who caches this vnode, how and where?
>
> Who do you think? 8)
>
> If this vnode is still 'alive' how is one able to physically move the
> executable file (mapped by the process) on disk?
>
> Again, what do you mean by "move"?
>
> If you would like to point me to some code in the kernel for some
> explanation, that is welcome. I have the sources for 10.4.11 with me.
>
> Start with everything in xnu/bsd/vfs, xnu/bsd/kern and osfmk/vm.
>
> A couple of concepts worth considering:
>
> - What do you mean by "move"?
>
> - Why do you think that an open file handle is fundamentally different from
> an address space map entry when it comes to referring to an open file?
>
> - Why do you (seem to) think that a file can only exist if it has a
> reference in the filesystem namespace?
>
> = Mike
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-kernel mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
--
-mmw
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden