Linux Kernel
3.7.1
|
#include <client.h>
Data Fields | |
spinlock_t | lock |
unsigned int | msize |
unsigned char | proto_version |
struct p9_trans_module * | trans_mod |
enum p9_trans_status | status |
void * | trans |
struct p9_conn * | conn |
struct p9_idpool * | fidpool |
struct list_head | fidlist |
struct p9_idpool * | tagpool |
struct p9_req_t * | reqs [P9_ROW_MAXTAG] |
int | max_tag |
struct p9_client - per client instance state : protect : maximum data size negotiated by protocol : extension flags negotiated by protocol : 9P protocol version to use : module API instantiated with this client : tranport instance state and API : connection state information used by trans_fd : fid handle accounting for session : List of active fid handles - transaction id accounting for session - 2D array of requests - current maximum tag id allocated
The client structure is used to keep track of various per-client state that has been instantiated. In order to minimize per-transaction overhead we use a simple array to lookup requests instead of a hash table or linked list. In order to support larger number of transactions, we make this a 2D array, allocating new rows when we need to grow the total number of the transactions.
Each row is 256 requests and we'll support up to 256 rows for a total of 64k concurrent requests per session.
Bugs: duplicated data and potentially unnecessary elements.
spinlock_t lock |
struct p9_req_t* reqs[P9_ROW_MAXTAG] |
enum p9_trans_status status |
struct p9_trans_module* trans_mod |