aboutsummaryrefslogtreecommitdiffstats
path: root/net/9p/protocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/9p/protocol.c')
-rw-r--r--net/9p/protocol.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/9p/protocol.c b/net/9p/protocol.c
index 5936c50d0c93..7bca2421bfc8 100644
--- a/net/9p/protocol.c
+++ b/net/9p/protocol.c
@@ -114,6 +114,17 @@ pdu_write_u(struct p9_fcall *pdu, const char __user *udata, size_t size)
114 return size - len; 114 return size - len;
115} 115}
116 116
117static size_t
118pdu_write_urw(struct p9_fcall *pdu, const char *kdata, const char __user *udata,
119 size_t size)
120{
121 BUG_ON(pdu->size > P9_IOHDRSZ);
122 pdu->pubuf = (char __user *)udata;
123 pdu->pkbuf = (char *)kdata;
124 pdu->pbuf_size = size;
125 return 0;
126}
127
117/* 128/*
118 b - int8_t 129 b - int8_t
119 w - int16_t 130 w - int16_t
@@ -445,6 +456,16 @@ p9pdu_vwritef(struct p9_fcall *pdu, int proto_version, const char *fmt,
445 errcode = -EFAULT; 456 errcode = -EFAULT;
446 } 457 }
447 break; 458 break;
459 case 'E':{
460 int32_t cnt = va_arg(ap, int32_t);
461 const char *k = va_arg(ap, const void *);
462 const char *u = va_arg(ap, const void *);
463 errcode = p9pdu_writef(pdu, proto_version, "d",
464 cnt);
465 if (!errcode && pdu_write_urw(pdu, k, u, cnt))
466 errcode = -EFAULT;
467 }
468 break;
448 case 'U':{ 469 case 'U':{
449 int32_t count = va_arg(ap, int32_t); 470 int32_t count = va_arg(ap, int32_t);
450 const char __user *udata = 471 const char __user *udata =