Skip to contentSkip to conversation

9p: 9P server low-level 9P messages support

RFC PATCH New Latchesar Ionkov 1 participant 1 message Sep 30, 2007

Subsystems (3)
lore
Share & tools
lore

Latchesar Ionkov

author maintainer
#0 lore raw

RFC PATCH 1/6 9p: 9P server low-level 9P messages support

This patchset provides support for in-kernel 9P2000 servers.

Implement support for the 9P messages required by the server side.

---
 include/net/9p/9p.h |   19 ++
 net/9p/conv.c       |  508 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 net/9p/fcprint.c    |    2 +
 3 files changed, 525 insertions(+), 4 deletions(-)
include/net/9p/9p.h +19 -0
index 686425a..eaa2385 100644
@@ -65,6 +65,7 @@ do { \
 
 /* Message Types */
 enum {
+	P9_FIRST = 100,
 	P9_TVERSION = 100,
 	P9_RVERSION,
 	P9_TAUTH = 102,
@@ -93,6 +94,7 @@ enum {
 	P9_RSTAT,
 	P9_TWSTAT = 126,
 	P9_RWSTAT,
+	P9_LAST,
 };
 
 /* open modes */
@@ -381,6 +383,7 @@ struct p9_idpool;
 int p9_deserialize_stat(void *buf, u32 buflen, struct p9_stat *stat,
 	int dotu);
 int p9_deserialize_fcall(void *buf, u32 buflen, struct p9_fcall *fc, int dotu);
+int p9_serialize_stat(struct p9_wstat *wstat, u8 *buf, int buflen, int dotu);
 void p9_set_tag(struct p9_fcall *fc, u16 tag);
 struct p9_fcall *p9_create_tversion(u32 msize, char *version);
 struct p9_fcall *p9_create_tattach(u32 fid, u32 afid, char *uname,
@@ -403,6 +406,22 @@ struct p9_fcall *p9_create_tremove(u32 fid);
 struct p9_fcall *p9_create_tstat(u32 fid);
 struct p9_fcall *p9_create_twstat(u32 fid, struct p9_wstat *wstat,
 	int dotu);
+struct p9_fcall *p9_create_rversion(u32 msize, char *version);
+struct p9_fcall *p9_create_rattach(struct p9_qid *qid);
+struct p9_fcall *p9_create_rerror(char *ename, u32 ecode, int dotu);
+struct p9_fcall *p9_create_rauth(struct p9_qid *qid);
+struct p9_fcall *p9_create_rflush(void);
+struct p9_fcall *p9_create_rwalk(int nwqid, struct p9_qid *wqids);
+struct p9_fcall *p9_create_ropen(struct p9_qid *qid, u32 iounit);
+struct p9_fcall *p9_create_rcreate(struct p9_qid *qid, u32 iounit);
+struct p9_fcall *p9_create_rread(u32 count, u8 *data);
+struct p9_fcall *p9_create_rwrite(u32 count);
+struct p9_fcall *p9_create_rclunk(void);
+struct p9_fcall *p9_create_rremove(void);
+struct p9_fcall *p9_create_rstat(struct p9_wstat *st, int dotu);
+struct p9_fcall *p9_create_rwstat(void);
+struct p9_fcall *p9_alloc_rread(u32 count);
+void p9_set_rread_count(struct p9_fcall *fc, u32 count);
 
 int p9_printfcall(char *buf, int buflen, struct p9_fcall *fc, int dotu);
 int p9_errstr2errno(char *errstr, int len);
net/9p/conv.c +504 -4

590 lines not on this page · raw message

net/9p/fcprint.c +2 -0
index b1ae8ec..3c5cd83 100644
@@ -347,8 +347,10 @@ p9_printfcall(char *buf, int buflen, struct p9_fcall *fc, int extended)
 
 	return ret;
 }
+EXPORT_SYMBOL(p9_printfcall);
 
 #else
+
 int
 p9_printfcall(char *buf, int buflen, struct p9_fcall *fc, int extended)
 {
Signature · 1 line
1.5.2.4