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