]> bbs.cooldavid.org Git - net-next-2.6.git/blame - include/net/9p/client.h
9p: attach-per-user
[net-next-2.6.git] / include / net / 9p / client.h
CommitLineData
bd238fb4
LI
1/*
2 * include/net/9p/client.h
3 *
4 * 9P Client Definitions
5 *
6 * Copyright (C) 2007 by Latchesar Ionkov <lucho@ionkov.net>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2
10 * as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to:
19 * Free Software Foundation
20 * 51 Franklin Street, Fifth Floor
21 * Boston, MA 02111-1301 USA
22 *
23 */
24
25#ifndef NET_9P_CLIENT_H
26#define NET_9P_CLIENT_H
27
28struct p9_client {
29 spinlock_t lock; /* protect client structure */
30 int msize;
31 unsigned char dotu;
a80d923e 32 struct p9_trans *trans;
bd238fb4
LI
33 struct p9_conn *conn;
34
35 struct p9_idpool *fidpool;
36 struct list_head fidlist;
37};
38
39struct p9_fid {
40 struct p9_client *clnt;
41 u32 fid;
42 int mode;
43 struct p9_qid qid;
44 u32 iounit;
45 uid_t uid;
46 void *aux;
47
48 int rdir_fpos;
49 int rdir_pos;
50 struct p9_fcall *rdir_fcall;
51 struct list_head flist;
52 struct list_head dlist; /* list of all fids attached to a dentry */
53};
54
a80d923e 55struct p9_client *p9_client_create(struct p9_trans *trans, int msize,
bd238fb4
LI
56 int dotu);
57void p9_client_destroy(struct p9_client *clnt);
58void p9_client_disconnect(struct p9_client *clnt);
59struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid,
ba17674f
LI
60 char *uname, u32 n_uname, char *aname);
61struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname,
62 u32 n_uname, char *aname);
bd238fb4
LI
63struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames,
64 int clone);
65int p9_client_open(struct p9_fid *fid, int mode);
66int p9_client_fcreate(struct p9_fid *fid, char *name, u32 perm, int mode,
67 char *extension);
68int p9_client_clunk(struct p9_fid *fid);
69int p9_client_remove(struct p9_fid *fid);
70int p9_client_read(struct p9_fid *fid, char *data, u64 offset, u32 count);
71int p9_client_readn(struct p9_fid *fid, char *data, u64 offset, u32 count);
72int p9_client_write(struct p9_fid *fid, char *data, u64 offset, u32 count);
73int p9_client_uread(struct p9_fid *fid, char __user *data, u64 offset,
74 u32 count);
75int p9_client_uwrite(struct p9_fid *fid, const char __user *data, u64 offset,
76 u32 count);
77struct p9_stat *p9_client_stat(struct p9_fid *fid);
78int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst);
79struct p9_stat *p9_client_dirread(struct p9_fid *fid, u64 offset);
80
81#endif /* NET_9P_CLIENT_H */