diff options
| -rw-r--r-- | Documentation/filesystems/9p.txt | 2 | ||||
| -rw-r--r-- | fs/9p/v9fs.c | 33 | ||||
| -rw-r--r-- | fs/9p/vfs_dir.c | 14 | ||||
| -rw-r--r-- | fs/9p/vfs_inode.c | 2 | ||||
| -rw-r--r-- | include/net/9p/9p.h | 14 | ||||
| -rw-r--r-- | include/net/9p/client.h | 8 | ||||
| -rw-r--r-- | include/net/9p/transport.h | 10 | ||||
| -rw-r--r-- | include/trace/events/9p.h | 176 | ||||
| -rw-r--r-- | net/9p/client.c | 469 | ||||
| -rw-r--r-- | net/9p/protocol.c | 99 | ||||
| -rw-r--r-- | net/9p/protocol.h | 4 | ||||
| -rw-r--r-- | net/9p/trans_common.c | 53 | ||||
| -rw-r--r-- | net/9p/trans_common.h | 21 | ||||
| -rw-r--r-- | net/9p/trans_virtio.c | 319 |
14 files changed, 772 insertions, 452 deletions
diff --git a/Documentation/filesystems/9p.txt b/Documentation/filesystems/9p.txt index 13de64c7f0ab..2c0321442845 100644 --- a/Documentation/filesystems/9p.txt +++ b/Documentation/filesystems/9p.txt | |||
| @@ -92,7 +92,7 @@ OPTIONS | |||
| 92 | 92 | ||
| 93 | wfdno=n the file descriptor for writing with trans=fd | 93 | wfdno=n the file descriptor for writing with trans=fd |
| 94 | 94 | ||
| 95 | maxdata=n the number of bytes to use for 9p packet payload (msize) | 95 | msize=n the number of bytes to use for 9p packet payload |
| 96 | 96 | ||
| 97 | port=n port to connect to on the remote server | 97 | port=n port to connect to on the remote server |
| 98 | 98 | ||
diff --git a/fs/9p/v9fs.c b/fs/9p/v9fs.c index ef9661886112..2b78014a124a 100644 --- a/fs/9p/v9fs.c +++ b/fs/9p/v9fs.c | |||
| @@ -132,21 +132,19 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) | |||
| 132 | options = tmp_options; | 132 | options = tmp_options; |
| 133 | 133 | ||
| 134 | while ((p = strsep(&options, ",")) != NULL) { | 134 | while ((p = strsep(&options, ",")) != NULL) { |
| 135 | int token; | 135 | int token, r; |
| 136 | if (!*p) | 136 | if (!*p) |
| 137 | continue; | 137 | continue; |
| 138 | token = match_token(p, tokens, args); | 138 | token = match_token(p, tokens, args); |
| 139 | if (token < Opt_uname) { | 139 | switch (token) { |
| 140 | int r = match_int(&args[0], &option); | 140 | case Opt_debug: |
| 141 | r = match_int(&args[0], &option); | ||
| 141 | if (r < 0) { | 142 | if (r < 0) { |
| 142 | P9_DPRINTK(P9_DEBUG_ERROR, | 143 | P9_DPRINTK(P9_DEBUG_ERROR, |
| 143 | "integer field, but no integer?\n"); | 144 | "integer field, but no integer?\n"); |
| 144 | ret = r; | 145 | ret = r; |
| 145 | continue; | 146 | continue; |
| 146 | } | 147 | } |
| 147 | } | ||
| 148 | switch (token) { | ||
| 149 | case Opt_debug: | ||
| 150 | v9ses->debug = option; | 148 | v9ses->debug = option; |
| 151 | #ifdef CONFIG_NET_9P_DEBUG | 149 | #ifdef CONFIG_NET_9P_DEBUG |
| 152 | p9_debug_level = option; | 150 | p9_debug_level = option; |
| @@ -154,12 +152,33 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts) | |||
| 154 | break; | 152 | break; |
| 155 | 153 | ||
| 156 | case Opt_dfltuid: | 154 | case Opt_dfltuid: |
| 155 | r = match_int(&args[0], &option); | ||
| 156 | if (r < 0) { | ||
| 157 | P9_DPRINTK(P9_DEBUG_ERROR, | ||
| 158 | "integer field, but no integer?\n"); | ||
| 159 | ret = r; | ||
| 160 | continue; | ||
| 161 | } | ||
| 157 | v9ses->dfltuid = option; | 162 | v9ses->dfltuid = option; |
| 158 | break; | 163 | break; |
| 159 | case Opt_dfltgid: | 164 | case Opt_dfltgid: |
| 165 | r = match_int(&args[0], &option); | ||
| 166 | if (r < 0) { | ||
| 167 | P9_DPRINTK(P9_DEBUG_ERROR, | ||
| 168 | "integer field, but no integer?\n"); | ||
| 169 | ret = r; | ||
| 170 | continue; | ||
| 171 | } | ||
| 160 | v9ses->dfltgid = option; | 172 | v9ses->dfltgid = option; |
| 161 | break; | 173 | break; |
| 162 | case Opt_afid: | 174 | case Opt_afid: |
| 175 | r = match_int(&args[0], &option); | ||
| 176 | if (r < 0) { | ||
| 177 | P9_DPRINTK(P9_DEBUG_ERROR, | ||
| 178 | "integer field, but no integer?\n"); | ||
| 179 | ret = r; | ||
| 180 | continue; | ||
| 181 | } | ||
| 163 | v9ses->afid = option; | 182 | v9ses->afid = option; |
| 164 | break; | 183 | break; |
| 165 | case Opt_uname: | 184 | case Opt_uname: |
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index 9c2bdda5cd9d..598fff1a54e5 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c | |||
| @@ -165,9 +165,8 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 165 | } | 165 | } |
| 166 | while (rdir->head < rdir->tail) { | 166 | while (rdir->head < rdir->tail) { |
| 167 | p9stat_init(&st); | 167 | p9stat_init(&st); |
| 168 | err = p9stat_read(rdir->buf + rdir->head, | 168 | err = p9stat_read(fid->clnt, rdir->buf + rdir->head, |
| 169 | rdir->tail - rdir->head, &st, | 169 | rdir->tail - rdir->head, &st); |
| 170 | fid->clnt->proto_version); | ||
| 171 | if (err) { | 170 | if (err) { |
| 172 | P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); | 171 | P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); |
| 173 | err = -EIO; | 172 | err = -EIO; |
| @@ -231,7 +230,7 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent, | |||
| 231 | while (err == 0) { | 230 | while (err == 0) { |
| 232 | if (rdir->tail == rdir->head) { | 231 | if (rdir->tail == rdir->head) { |
| 233 | err = p9_client_readdir(fid, rdir->buf, buflen, | 232 | err = p9_client_readdir(fid, rdir->buf, buflen, |
| 234 | filp->f_pos); | 233 | filp->f_pos); |
| 235 | if (err <= 0) | 234 | if (err <= 0) |
| 236 | goto unlock_and_exit; | 235 | goto unlock_and_exit; |
| 237 | 236 | ||
| @@ -241,10 +240,9 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent, | |||
| 241 | 240 | ||
| 242 | while (rdir->head < rdir->tail) { | 241 | while (rdir->head < rdir->tail) { |
| 243 | 242 | ||
| 244 | err = p9dirent_read(rdir->buf + rdir->head, | 243 | err = p9dirent_read(fid->clnt, rdir->buf + rdir->head, |
| 245 | rdir->tail - rdir->head, | 244 | rdir->tail - rdir->head, |
| 246 | &curdirent, | 245 | &curdirent); |
| 247 | fid->clnt->proto_version); | ||
| 248 | if (err < 0) { | 246 | if (err < 0) { |
| 249 | P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); | 247 | P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); |
| 250 | err = -EIO; | 248 | err = -EIO; |
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index e3c03db3c788..b5a1076aaa6c 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
| @@ -278,10 +278,8 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses, | |||
| 278 | case S_IFSOCK: | 278 | case S_IFSOCK: |
| 279 | if (v9fs_proto_dotl(v9ses)) { | 279 | if (v9fs_proto_dotl(v9ses)) { |
| 280 | inode->i_op = &v9fs_file_inode_operations_dotl; | 280 | inode->i_op = &v9fs_file_inode_operations_dotl; |
| 281 | inode->i_fop = &v9fs_file_operations_dotl; | ||
| 282 | } else if (v9fs_proto_dotu(v9ses)) { | 281 | } else if (v9fs_proto_dotu(v9ses)) { |
| 283 | inode->i_op = &v9fs_file_inode_operations; | 282 | inode->i_op = &v9fs_file_inode_operations; |
| 284 | inode->i_fop = &v9fs_file_operations; | ||
| 285 | } else { | 283 | } else { |
| 286 | P9_DPRINTK(P9_DEBUG_ERROR, | 284 | P9_DPRINTK(P9_DEBUG_ERROR, |
| 287 | "special files without extended mode\n"); | 285 | "special files without extended mode\n"); |
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index a6326ef8ade6..2d70b95b3b55 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h | |||
| @@ -76,11 +76,8 @@ do { \ | |||
| 76 | } \ | 76 | } \ |
| 77 | } while (0) | 77 | } while (0) |
| 78 | 78 | ||
| 79 | #define P9_DUMP_PKT(way, pdu) p9pdu_dump(way, pdu) | ||
| 80 | |||
| 81 | #else | 79 | #else |
| 82 | #define P9_DPRINTK(level, format, arg...) do { } while (0) | 80 | #define P9_DPRINTK(level, format, arg...) do { } while (0) |
| 83 | #define P9_DUMP_PKT(way, pdu) do { } while (0) | ||
| 84 | #endif | 81 | #endif |
| 85 | 82 | ||
| 86 | 83 | ||
| @@ -359,6 +356,9 @@ enum p9_qid_t { | |||
| 359 | /* Room for readdir header */ | 356 | /* Room for readdir header */ |
| 360 | #define P9_READDIRHDRSZ 24 | 357 | #define P9_READDIRHDRSZ 24 |
| 361 | 358 | ||
| 359 | /* size of header for zero copy read/write */ | ||
| 360 | #define P9_ZC_HDR_SZ 4096 | ||
| 361 | |||
| 362 | /** | 362 | /** |
| 363 | * struct p9_qid - file system entity information | 363 | * struct p9_qid - file system entity information |
| 364 | * @type: 8-bit type &p9_qid_t | 364 | * @type: 8-bit type &p9_qid_t |
| @@ -555,10 +555,6 @@ struct p9_rstatfs { | |||
| 555 | * @tag: transaction id of the request | 555 | * @tag: transaction id of the request |
| 556 | * @offset: used by marshalling routines to track current position in buffer | 556 | * @offset: used by marshalling routines to track current position in buffer |
| 557 | * @capacity: used by marshalling routines to track total malloc'd capacity | 557 | * @capacity: used by marshalling routines to track total malloc'd capacity |
| 558 | * @pubuf: Payload user buffer given by the caller | ||
