diff options
Diffstat (limited to 'fs/9p/v9fs.h')
-rw-r--r-- | fs/9p/v9fs.h | 85 |
1 files changed, 60 insertions, 25 deletions
diff --git a/fs/9p/v9fs.h b/fs/9p/v9fs.h index 7d3a1018db5..a7d56719299 100644 --- a/fs/9p/v9fs.h +++ b/fs/9p/v9fs.h | |||
@@ -21,18 +21,69 @@ | |||
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | 23 | ||
24 | /* | 24 | /** |
25 | * Session structure provides information for an opened session | 25 | * enum p9_session_flags - option flags for each 9P session |
26 | * | 26 | * @V9FS_EXTENDED: whether or not to use 9P2000.u extensions |
27 | */ | 27 | * @V9FS_ACCESS_SINGLE: only the mounting user can access the hierarchy |
28 | * @V9FS_ACCESS_USER: a new attach will be issued for every user (default) | ||
29 | * @V9FS_ACCESS_ANY: use a single attach for all users | ||
30 | * @V9FS_ACCESS_MASK: bit mask of different ACCESS options | ||
31 | * | ||
32 | * Session flags reflect options selected by users at mount time | ||
33 | */ | ||
34 | enum p9_session_flags { | ||
35 | V9FS_EXTENDED = 0x01, | ||
36 | V9FS_ACCESS_SINGLE = 0x02, | ||
37 | V9FS_ACCESS_USER = 0x04, | ||
38 | V9FS_ACCESS_ANY = 0x06, | ||
39 | V9FS_ACCESS_MASK = 0x06, | ||
40 | }; | ||
41 | |||
42 | /* possible values of ->cache */ | ||
43 | /** | ||
44 | * enum p9_cache_modes - user specified cache preferences | ||
45 | * @CACHE_NONE: do not cache data, dentries, or directory contents (default) | ||
46 | * @CACHE_LOOSE: cache data, dentries, and directory contents w/no consistency | ||
47 | * | ||
48 | * eventually support loose, tight, time, session, default always none | ||
49 | */ | ||
50 | |||
51 | enum p9_cache_modes { | ||
52 | CACHE_NONE, | ||
53 | CACHE_LOOSE, | ||
54 | }; | ||
55 | |||
56 | /** | ||
57 | * struct v9fs_session_info - per-instance session information | ||
58 | * @flags: session options of type &p9_session_flags | ||
59 | * @nodev: set to 1 to disable device mapping | ||
60 | * @debug: debug level | ||
61 | * @afid: authentication handle | ||
62 | * @cache: cache mode of type &p9_cache_modes | ||
63 | * @options: copy of options string given by user | ||
64 | * @uname: string user name to mount hierarchy as | ||
65 | * @aname: mount specifier for remote hierarchy | ||
66 | * @maxdata: maximum data to be sent/recvd per protocol message | ||
67 | * @dfltuid: default numeric userid to mount hierarchy as | ||
68 | * @dfltgid: default numeric groupid to mount hierarchy as | ||
69 | * @uid: if %V9FS_ACCESS_SINGLE, the numeric uid which mounted the hierarchy | ||
70 | * @clnt: reference to 9P network client instantiated for this session | ||
71 | * @debugfs_dir: reference to debugfs_dir which can be used for add'l debug | ||
72 | * | ||
73 | * This structure holds state for each session instance established during | ||
74 | * a sys_mount() . | ||
75 | * | ||
76 | * Bugs: there seems to be a lot of state which could be condensed and/or | ||
77 | * removed. | ||
78 | */ | ||
28 | 79 | ||
29 | struct v9fs_session_info { | 80 | struct v9fs_session_info { |
30 | /* options */ | 81 | /* options */ |
31 | unsigned char flags; /* session flags */ | 82 | unsigned char flags; |
32 | unsigned char nodev; /* set to 1 if no disable device mapping */ | 83 | unsigned char nodev; |
33 | unsigned short debug; /* debug level */ | 84 | unsigned short debug; |
34 | unsigned int afid; /* authentication fid */ | 85 | unsigned int afid; |
35 | unsigned int cache; /* cache mode */ | 86 | unsigned int cache; |
36 | 87 | ||
37 | char *options; /* copy of mount options */ | 88 | char *options; /* copy of mount options */ |
38 | char *uname; /* user name to mount as */ | 89 | char *uname; /* user name to mount as */ |
@@ -45,22 +96,6 @@ struct v9fs_session_info { | |||
45 | struct dentry *debugfs_dir; | 96 | struct dentry *debugfs_dir; |
46 | }; | 97 | }; |
47 | 98 | ||
48 | /* session flags */ | ||
49 | enum { | ||
50 | V9FS_EXTENDED = 0x01, /* 9P2000.u */ | ||
51 | V9FS_ACCESS_MASK = 0x06, /* access mask */ | ||
52 | V9FS_ACCESS_SINGLE = 0x02, /* only one user can access the files */ | ||
53 | V9FS_ACCESS_USER = 0x04, /* attache per user */ | ||
54 | V9FS_ACCESS_ANY = 0x06, /* use the same attach for all users */ | ||
55 | }; | ||
56 | |||
57 | /* possible values of ->cache */ | ||
58 | /* eventually support loose, tight, time, session, default always none */ | ||
59 | enum { | ||
60 | CACHE_NONE, /* default */ | ||
61 | CACHE_LOOSE, /* no consistency */ | ||
62 | }; | ||
63 | |||
64 | extern struct dentry *v9fs_debugfs_root; | 99 | extern struct dentry *v9fs_debugfs_root; |
65 | 100 | ||
66 | struct p9_fid *v9fs_session_init(struct v9fs_session_info *, const char *, | 101 | struct p9_fid *v9fs_session_init(struct v9fs_session_info *, const char *, |