aboutsummaryrefslogtreecommitdiff
path: root/src/lib9pclient/fsimpl.h
blob: 9c5c555355fd58ca2e3b7d397de11475ee8981fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* Copyright (C) 2003 Russ Cox, Massachusetts Institute of Technology */
/* See COPYRIGHT */

#include <thread.h>

typedef struct Queue Queue;
Queue *_fsqalloc(void);
int _fsqsend(Queue*, void*);
void *_fsqrecv(Queue*);
void _fsqhangup(Queue*);
void *_fsnbqrecv(Queue*);

#include <mux.h>
struct CFsys
{
	char version[20];
	int msize;
	QLock lk;
	int fd;
	int ref;
	Mux mux;
	CFid *root;
	Queue *txq;
	Queue *rxq;
	CFid *freefid;
	int nextfid;
	Ioproc *iorecv;
	Ioproc *iosend;
};

struct CFid
{
	int fid;
	int mode;
	CFid *next;
	QLock lk;
	CFsys *fs;
	Qid qid;
	vlong offset;
};

void _fsdecref(CFsys*);
void _fsputfid(CFid*);
CFid *_fsgetfid(CFsys*);

int	_fsrpc(CFsys*, Fcall*, Fcall*, void**);
CFid *_fswalk(CFid*, char*);