Re: what is the file hashed by a server

From: Andrew Valencia <vandys_at_nospam.org>
Date: Tue Nov 22 1994 - 15:11:45 PST

[joerg.wittenberger@inf.tu-dresden.de (Joerg Wittenberger) writes:]

>As far as I can see for a client which connects to a server a struct
>file is set up which is hashed under the handle of the sender (in fact
>this handle is the reference through which the client accessed the
>port).

A new struct file is created when (1) a client connects to the server, or
(2) when the open file is cloned. Cloning involves the kernel-generated
message M_DUP, which calls dup_client(). Cloning happens during a fork(),
as well as during an open() of a new file. An open() clones the client
connection held in his mount table, and then walks it down the hierarchy to
the desired path using FS_OPEN messages on the cloned file.

>All access with this handle as sender modifies this struct file. So
>the server keeps track with file actions. But what happens on the
>second open? Sure, I can access 2 files at once from one thread. But I
>can't see where the server allocate a second struct file.
>Where I want to look?

Threads share the same open file table. They also look like the same client
from the perspective of the server. Only one thread at a time can have an
I/O active through a particular open file.

See the places in srv/dos/main.c where a "struct file" is malloc()'ed. This
will be new_client() and dup_client().

                                                Andy
Received on Tue Nov 22 14:48:34 1994

This archive was generated by hypermail 2.1.8 : Thu Sep 22 2005 - 15:12:10 PDT