Lines Matching defs:v9ses
81 * @v9ses: existing v9fs session information
86 static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)
96 v9ses->afid = ~0;
97 v9ses->debug = 0;
98 v9ses->cache = 0;
100 v9ses->cachetag = NULL;
129 v9ses->debug = option;
136 v9ses->dfltuid = option;
139 v9ses->dfltgid = option;
142 v9ses->afid = option;
145 match_strlcpy(v9ses->uname, &args[0], PATH_MAX);
148 match_strlcpy(v9ses->aname, &args[0], PATH_MAX);
151 v9ses->nodev = 1;
154 v9ses->cache = CACHE_LOOSE;
157 v9ses->cache = CACHE_FSCACHE;
161 v9ses->cachetag = match_strdup(&args[0]);
174 v9ses->cache = CACHE_LOOSE;
176 v9ses->cache = CACHE_FSCACHE;
178 v9ses->cache = CACHE_NONE;
191 v9ses->flags &= ~V9FS_ACCESS_MASK;
193 v9ses->flags |= V9FS_ACCESS_USER;
195 v9ses->flags |= V9FS_ACCESS_ANY;
197 v9ses->flags |= V9FS_ACCESS_SINGLE;
198 v9ses->uid = simple_strtoul(s, &e, 10);
200 v9ses->uid = ~0;
218 * @v9ses: session information structure
224 struct p9_fid *v9fs_session_init(struct v9fs_session_info *v9ses,
231 v9ses->uname = __getname();
232 if (!v9ses->uname)
235 v9ses->aname = __getname();
236 if (!v9ses->aname) {
237 __putname(v9ses->uname);
240 init_rwsem(&v9ses->rename_sem);
242 rc = bdi_setup_and_register(&v9ses->bdi, "9p", BDI_CAP_MAP_COPY);
244 __putname(v9ses->aname);
245 __putname(v9ses->uname);
250 list_add(&v9ses->slist, &v9fs_sessionlist);
253 v9ses->flags = V9FS_ACCESS_USER;
254 strcpy(v9ses->uname, V9FS_DEFUSER);
255 strcpy(v9ses->aname, V9FS_DEFANAME);
256 v9ses->uid = ~0;
257 v9ses->dfltuid = V9FS_DEFUID;
258 v9ses->dfltgid = V9FS_DEFGID;
260 rc = v9fs_parse_options(v9ses, data);
266 v9ses->clnt = p9_client_create(dev_name, data);
267 if (IS_ERR(v9ses->clnt)) {
268 retval = PTR_ERR(v9ses->clnt);
269 v9ses->clnt = NULL;
274 if (p9_is_proto_dotl(v9ses->clnt))
275 v9ses->flags |= V9FS_PROTO_2000L;
276 else if (p9_is_proto_dotu(v9ses->clnt))
277 v9ses->flags |= V9FS_PROTO_2000U;
279 v9ses->maxdata = v9ses->clnt->msize - P9_IOHDRSZ;
282 if (!(v9fs_proto_dotu(v9ses) || v9fs_proto_dotl(v9ses)) &&
283 ((v9ses->flags&V9FS_ACCESS_MASK) == V9FS_ACCESS_USER)) {
285 v9ses->flags &= ~V9FS_ACCESS_MASK;
286 v9ses->flags |= V9FS_ACCESS_ANY;
287 v9ses->uid = ~0;
290 fid = p9_client_attach(v9ses->clnt, NULL, v9ses->uname, ~0,
291 v9ses->aname);
299 if ((v9ses->flags & V9FS_ACCESS_MASK) == V9FS_ACCESS_SINGLE)
300 fid->uid = v9ses->uid;
306 v9fs_cache_session_get_cookie(v9ses);
312 bdi_destroy(&v9ses->bdi);
318 * @v9ses: session information structure
322 void v9fs_session_close(struct v9fs_session_info *v9ses)
324 if (v9ses->clnt) {
325 p9_client_destroy(v9ses->clnt);
326 v9ses->clnt = NULL;
330 if (v9ses->fscache) {
331 v9fs_cache_session_put_cookie(v9ses);
332 kfree(v9ses->cachetag);
335 __putname(v9ses->uname);
336 __putname(v9ses->aname);
338 bdi_destroy(&v9ses->bdi);
341 list_del(&v9ses->slist);
347 * @v9ses: session to terminate
352 void v9fs_session_cancel(struct v9fs_session_info *v9ses) {
353 P9_DPRINTK(P9_DEBUG_ERROR, "cancel session %p\n", v9ses);
354 p9_client_disconnect(v9ses->clnt);
359 * @v9ses: session to terminate
364 void v9fs_session_begin_cancel(struct v9fs_session_info *v9ses)
366 P9_DPRINTK(P9_DEBUG_ERROR, "begin cancel session %p\n", v9ses);
367 p9_client_begin_disconnect(v9ses->clnt);
386 struct v9fs_session_info *v9ses;
389 list_for_each_entry(v9ses, &v9fs_sessionlist, slist) {
390 if (v9ses->cachetag) {
391 n = snprintf(buf, limit, "%s\n", v9ses->cachetag);