Opened 13 years ago

Closed 13 years ago

#282 closed defect (fixed)

VFS should associate the table of open files with the client task rather than with one of its phones

Reported by: Jakub Jermář Owned by: Jakub Jermář
Priority: major Milestone: 0.4.3
Component: helenos/srv/vfs Version:
Keywords: Cc:
Blocker for: Depends on: #283
See also:


Currently, each VFS client is expected to use just one phone for talking to VFS. VFS associates that client's phone with the table of open files belonging to that client. When the phone is hung up, VFS knows it can close all remaining open files and destroy the table.

The problem occurs when the client wants to use multiple phones to talk to VFS. This may be a legitimate requirement on the client side meant to enable the possibility of recursion and parallelism in some IPC protocols.

We should therefore modify VFS's approach to open files so that all phones used by that client to talk to VFS are equal and can manipulate the same set of open files from one table of open files.

The server, i.e. VFS, will have to be able to:

  • tell that two connections come from the same client so that it can find the respective table of open files
  • count the number of connections from one client to detect when the client hangs up its last phone

Change History (4)

comment:1 by Jakub Jermář, 13 years ago

Blocker for: #283

comment:2 by Jakub Jermář, 13 years ago

Blocker for: #283
Depends on: #283

comment:3 by Jiri Svoboda, 13 years ago

Since this problem applies to all servers wanting to maintain per-client state, it might be worth considering implementing this as a generic mechanism in the async framework. For example, the framework could allocate some client structure for each new client and free it when the last connection from that client closes. The server could register callback functions to be called when a client connects and disconnects. Also, the connection-handling function would be passed a pointer to the client structure.

comment:4 by Jakub Jermář, 13 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.