4 * Copyright (C) 2004 by Eric Van Hensbergen <ericvh@gmail.com>
5 * Copyright (C) 2002 by Ron Minnich <rminnich@lanl.gov>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
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.
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
26 * Idpool structure provides lock and id management
31 struct semaphore lock;
36 * Session structure provides information for an opened session
40 struct v9fs_session_info {
43 unsigned char extended; /* set to 1 if we are using UNIX extensions */
44 unsigned char nodev; /* set to 1 if no disable device mapping */
45 unsigned short port; /* port to connect to */
46 unsigned short debug; /* debug level */
47 unsigned short proto; /* protocol to use */
48 unsigned int afid; /* authentication fid */
49 unsigned int rfdno; /* read file descriptor number */
50 unsigned int wfdno; /* write file descriptor number */
53 char *name; /* user name to mount as */
54 char *remotename; /* name of remote hierarchy being mounted */
55 unsigned int uid; /* default uid/muid for legacy support */
56 unsigned int gid; /* default gid for legacy support */
59 struct v9fs_idpool fidpool; /* The FID pool for file descriptors */
60 struct v9fs_idpool tidpool; /* The TID pool for transactions ids */
62 /* transport information */
63 struct v9fs_transport *transport;
65 int inprogress; /* session in progress => true */
66 int shutdown; /* session shutting down. no more attaches. */
67 unsigned char session_hung;
69 /* mux private data */
70 struct v9fs_fcall *curfcall;
71 wait_queue_head_t read_wait;
72 struct completion fcread;
73 struct completion proccmpl;
74 struct task_struct *recvproc;
77 struct list_head mux_fcalls;
80 /* possible values of ->proto */
87 int v9fs_session_init(struct v9fs_session_info *, const char *, char *);
88 struct v9fs_session_info *v9fs_inode2v9ses(struct inode *);
89 void v9fs_session_close(struct v9fs_session_info *v9ses);
90 int v9fs_get_idpool(struct v9fs_idpool *p);
91 void v9fs_put_idpool(int id, struct v9fs_idpool *p);
92 void v9fs_session_cancel(struct v9fs_session_info *v9ses);
94 #define V9FS_MAGIC 0x01021997
96 /* other default globals */
98 #define V9FS_DEFUSER "nobody"
99 #define V9FS_DEFANAME ""
101 /* inital pool sizes for fids and tags */
102 #define V9FS_START_FIDS 8192
103 #define V9FS_START_TIDS 256