Lines Matching refs:msg

73 l9p_iov_io(struct l9p_message *msg, void *buffer, size_t len)  in l9p_iov_io()  argument
78 assert(msg != NULL); in l9p_iov_io()
83 if (msg->lm_cursor_iov >= msg->lm_niov) in l9p_iov_io()
89 size_t idx = msg->lm_cursor_iov; in l9p_iov_io()
90 size_t space = msg->lm_iov[idx].iov_len - msg->lm_cursor_offset; in l9p_iov_io()
93 if (msg->lm_mode == L9P_PACK) { in l9p_iov_io()
94 memcpy((char *)msg->lm_iov[idx].iov_base + in l9p_iov_io()
95 msg->lm_cursor_offset, (char *)buffer + done, in l9p_iov_io()
99 if (msg->lm_mode == L9P_UNPACK) { in l9p_iov_io()
101 (char *)msg->lm_iov[idx].iov_base + in l9p_iov_io()
102 msg->lm_cursor_offset, towrite); in l9p_iov_io()
105 msg->lm_cursor_offset += towrite; in l9p_iov_io()
112 msg->lm_cursor_iov++; in l9p_iov_io()
113 msg->lm_cursor_offset = 0; in l9p_iov_io()
115 if (msg->lm_cursor_iov >= msg->lm_niov && left > 0) in l9p_iov_io()
120 msg->lm_size += done; in l9p_iov_io()
130 l9p_pu8(struct l9p_message *msg, uint8_t *val) in l9p_pu8() argument
133 return (l9p_iov_io(msg, val, sizeof (uint8_t))); in l9p_pu8()
142 l9p_pu16(struct l9p_message *msg, uint16_t *val) in l9p_pu16() argument
154 if (msg->lm_mode == L9P_PACK) { in l9p_pu16()
156 return (l9p_iov_io(msg, &copy, sizeof (uint16_t))); in l9p_pu16()
158 ret = l9p_iov_io(msg, val, sizeof (uint16_t)); in l9p_pu16()
162 return (l9p_iov_io(msg, val, sizeof (uint16_t))); in l9p_pu16()
172 l9p_pu32(struct l9p_message *msg, uint32_t *val) in l9p_pu32() argument
178 if (msg->lm_mode == L9P_PACK) { in l9p_pu32()
180 return (l9p_iov_io(msg, &copy, sizeof (uint32_t))); in l9p_pu32()
182 ret = l9p_iov_io(msg, val, sizeof (uint32_t)); in l9p_pu32()
186 return (l9p_iov_io(msg, val, sizeof (uint32_t))); in l9p_pu32()
196 l9p_pu64(struct l9p_message *msg, uint64_t *val) in l9p_pu64() argument
202 if (msg->lm_mode == L9P_PACK) { in l9p_pu64()
204 return (l9p_iov_io(msg, &copy, sizeof (uint64_t))); in l9p_pu64()
206 ret = l9p_iov_io(msg, val, sizeof (uint32_t)); in l9p_pu64()
210 return (l9p_iov_io(msg, val, sizeof (uint64_t))); in l9p_pu64()
228 l9p_pustring(struct l9p_message *msg, char **s) in l9p_pustring() argument
232 if (msg->lm_mode == L9P_PACK) in l9p_pustring()
235 if (l9p_pu16(msg, &len) < 0) in l9p_pustring()
238 if (msg->lm_mode == L9P_UNPACK) { in l9p_pustring()
244 if (l9p_iov_io(msg, *s, len) < 0) in l9p_pustring()
247 if (msg->lm_mode == L9P_UNPACK) { in l9p_pustring()
275 l9p_pustrings(struct l9p_message *msg, uint16_t *num, char **strings, in l9p_pustrings() argument
282 if (msg->lm_mode == L9P_PACK) { in l9p_pustrings()
287 r = l9p_pu16(msg, &adjusted); in l9p_pustrings()
289 r = l9p_pu16(msg, num); in l9p_pustrings()
298 ret = l9p_pustring(msg, &strings[i]); in l9p_pustrings()
314 l9p_puqid(struct l9p_message *msg, struct l9p_qid *qid) in l9p_puqid() argument
319 if (msg->lm_mode == L9P_PACK) { in l9p_puqid()
321 r = l9p_pu8(msg, &type); in l9p_puqid()
323 r = l9p_pu8(msg, &type); in l9p_puqid()
327 r = l9p_pu32(msg, &qid->version); in l9p_puqid()
329 r = l9p_pu64(msg, &qid->path); in l9p_puqid()
340 l9p_puqids(struct l9p_message *msg, uint16_t *num, struct l9p_qid *qids) in l9p_puqids() argument
345 r = l9p_pu16(msg, num); in l9p_puqids()
353 ret = l9p_puqid(msg, &qids[i]); in l9p_puqids()
370 l9p_pustat(struct l9p_message *msg, struct l9p_stat *stat, in l9p_pustat() argument
377 if (msg->lm_mode == L9P_PACK) in l9p_pustat()
380 r += l9p_pu16(msg, &size); in l9p_pustat()
381 r += l9p_pu16(msg, &stat->type); in l9p_pustat()
382 r += l9p_pu32(msg, &stat->dev); in l9p_pustat()
383 r += l9p_puqid(msg, &stat->qid); in l9p_pustat()
384 r += l9p_pu32(msg, &stat->mode); in l9p_pustat()
385 r += l9p_pu32(msg, &stat->atime); in l9p_pustat()
386 r += l9p_pu32(msg, &stat->mtime); in l9p_pustat()
387 r += l9p_pu64(msg, &stat->length); in l9p_pustat()
388 r += l9p_pustring(msg, &stat->name); in l9p_pustat()
389 r += l9p_pustring(msg, &stat->uid); in l9p_pustat()
390 r += l9p_pustring(msg, &stat->gid); in l9p_pustat()
391 r += l9p_pustring(msg, &stat->muid); in l9p_pustat()
394 r += l9p_pustring(msg, &stat->extension); in l9p_pustat()
395 r += l9p_pu32(msg, &stat->n_uid); in l9p_pustat()
396 r += l9p_pu32(msg, &stat->n_gid); in l9p_pustat()
397 r += l9p_pu32(msg, &stat->n_muid); in l9p_pustat()
415 l9p_pudirent(struct l9p_message *msg, struct l9p_dirent *de) in l9p_pudirent() argument
419 r = l9p_puqid(msg, &de->qid); in l9p_pudirent()
420 r += l9p_pu64(msg, &de->offset); in l9p_pudirent()
421 r += l9p_pu8(msg, &de->type); in l9p_pudirent()
422 s = l9p_pustring(msg, &de->name); in l9p_pudirent()
435 l9p_pufcall(struct l9p_message *msg, union l9p_fcall *fcall, in l9p_pufcall() argument
445 l9p_pu32(msg, &length); in l9p_pufcall()
446 l9p_pu8(msg, &fcall->hdr.type); in l9p_pufcall()
447 r = l9p_pu16(msg, &fcall->hdr.tag); in l9p_pufcall()
462 l9p_pu32(msg, &fcall->version.msize); in l9p_pufcall()
463 r = l9p_pustring(msg, &fcall->version.version); in l9p_pufcall()
467 l9p_pu32(msg, &fcall->tauth.afid); in l9p_pufcall()
468 r = l9p_pustring(msg, &fcall->tauth.uname); in l9p_pufcall()
471 r = l9p_pustring(msg, &fcall->tauth.aname); in l9p_pufcall()
475 r = l9p_pu32(msg, &fcall->tauth.n_uname); in l9p_pufcall()
479 r = l9p_puqid(msg, &fcall->rauth.aqid); in l9p_pufcall()
483 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
484 l9p_pu32(msg, &fcall->tattach.afid); in l9p_pufcall()
485 r = l9p_pustring(msg, &fcall->tattach.uname); in l9p_pufcall()
488 r = l9p_pustring(msg, &fcall->tattach.aname); in l9p_pufcall()
492 r = l9p_pu32(msg, &fcall->tattach.n_uname); in l9p_pufcall()
496 r = l9p_puqid(msg, &fcall->rattach.qid); in l9p_pufcall()
500 r = l9p_pustring(msg, &fcall->error.ename); in l9p_pufcall()
504 r = l9p_pu32(msg, &fcall->error.errnum); in l9p_pufcall()
508 r = l9p_pu32(msg, &fcall->error.errnum); in l9p_pufcall()
512 r = l9p_pu16(msg, &fcall->tflush.oldtag); in l9p_pufcall()
519 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
520 l9p_pu32(msg, &fcall->twalk.newfid); in l9p_pufcall()
521 r = l9p_pustrings(msg, &fcall->twalk.nwname, in l9p_pufcall()
526 r = l9p_puqids(msg, &fcall->rwalk.nwqid, fcall->rwalk.wqid); in l9p_pufcall()
530 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
531 r = l9p_pu8(msg, &fcall->topen.mode); in l9p_pufcall()
535 l9p_puqid(msg, &fcall->ropen.qid); in l9p_pufcall()
536 r = l9p_pu32(msg, &fcall->ropen.iounit); in l9p_pufcall()
540 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
541 r = l9p_pustring(msg, &fcall->tcreate.name); in l9p_pufcall()
544 l9p_pu32(msg, &fcall->tcreate.perm); in l9p_pufcall()
545 r = l9p_pu8(msg, &fcall->tcreate.mode); in l9p_pufcall()
547 r = l9p_pustring(msg, &fcall->tcreate.extension); in l9p_pufcall()
551 l9p_puqid(msg, &fcall->rcreate.qid); in l9p_pufcall()
552 r = l9p_pu32(msg, &fcall->rcreate.iounit); in l9p_pufcall()
557 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
558 l9p_pu64(msg, &fcall->io.offset); in l9p_pufcall()
559 r = l9p_pu32(msg, &fcall->io.count); in l9p_pufcall()
564 r = l9p_pu32(msg, &fcall->io.count); in l9p_pufcall()
568 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
569 l9p_pu64(msg, &fcall->io.offset); in l9p_pufcall()
570 r = l9p_pu32(msg, &fcall->io.count); in l9p_pufcall()
574 r = l9p_pu32(msg, &fcall->io.count); in l9p_pufcall()
581 r = l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
592 l9p_pu16(msg, &size); in l9p_pufcall()
593 r = l9p_pustat(msg, &fcall->rstat.stat, version); in l9p_pufcall()
600 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
601 l9p_pu16(msg, &size); in l9p_pufcall()
602 r = l9p_pustat(msg, &fcall->twstat.stat, version); in l9p_pufcall()
610 l9p_pu32(msg, &fcall->rstatfs.statfs.type); in l9p_pufcall()
611 l9p_pu32(msg, &fcall->rstatfs.statfs.bsize); in l9p_pufcall()
612 l9p_pu64(msg, &fcall->rstatfs.statfs.blocks); in l9p_pufcall()
613 l9p_pu64(msg, &fcall->rstatfs.statfs.bfree); in l9p_pufcall()
614 l9p_pu64(msg, &fcall->rstatfs.statfs.bavail); in l9p_pufcall()
615 l9p_pu64(msg, &fcall->rstatfs.statfs.files); in l9p_pufcall()
616 l9p_pu64(msg, &fcall->rstatfs.statfs.ffree); in l9p_pufcall()
617 l9p_pu64(msg, &fcall->rstatfs.statfs.fsid); in l9p_pufcall()
618 r = l9p_pu32(msg, &fcall->rstatfs.statfs.namelen); in l9p_pufcall()
622 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
623 r = l9p_pu32(msg, &fcall->tlopen.flags); in l9p_pufcall()
627 l9p_puqid(msg, &fcall->rlopen.qid); in l9p_pufcall()
628 r = l9p_pu32(msg, &fcall->rlopen.iounit); in l9p_pufcall()
632 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
633 r = l9p_pustring(msg, &fcall->tlcreate.name); in l9p_pufcall()
636 l9p_pu32(msg, &fcall->tlcreate.flags); in l9p_pufcall()
637 l9p_pu32(msg, &fcall->tlcreate.mode); in l9p_pufcall()
638 r = l9p_pu32(msg, &fcall->tlcreate.gid); in l9p_pufcall()
642 l9p_puqid(msg, &fcall->rlcreate.qid); in l9p_pufcall()
643 r = l9p_pu32(msg, &fcall->rlcreate.iounit); in l9p_pufcall()
647 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
648 r = l9p_pustring(msg, &fcall->tsymlink.name); in l9p_pufcall()
651 r = l9p_pustring(msg, &fcall->tsymlink.symtgt); in l9p_pufcall()
654 r = l9p_pu32(msg, &fcall->tlcreate.gid); in l9p_pufcall()
658 r = l9p_puqid(msg, &fcall->rsymlink.qid); in l9p_pufcall()
662 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
663 r = l9p_pustring(msg, &fcall->tmknod.name); in l9p_pufcall()
666 l9p_pu32(msg, &fcall->tmknod.mode); in l9p_pufcall()
667 l9p_pu32(msg, &fcall->tmknod.major); in l9p_pufcall()
668 l9p_pu32(msg, &fcall->tmknod.minor); in l9p_pufcall()
669 r = l9p_pu32(msg, &fcall->tmknod.gid); in l9p_pufcall()
673 r = l9p_puqid(msg, &fcall->rmknod.qid); in l9p_pufcall()
677 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
678 l9p_pu32(msg, &fcall->trename.dfid); in l9p_pufcall()
679 r = l9p_pustring(msg, &fcall->trename.name); in l9p_pufcall()
686 r = l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
690 r = l9p_pustring(msg, &fcall->rreadlink.target); in l9p_pufcall()
694 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
695 r = l9p_pu64(msg, &fcall->tgetattr.request_mask); in l9p_pufcall()
699 l9p_pu64(msg, &fcall->rgetattr.valid); in l9p_pufcall()
700 l9p_puqid(msg, &fcall->rgetattr.qid); in l9p_pufcall()
701 l9p_pu32(msg, &fcall->rgetattr.mode); in l9p_pufcall()
702 l9p_pu32(msg, &fcall->rgetattr.uid); in l9p_pufcall()
703 l9p_pu32(msg, &fcall->rgetattr.gid); in l9p_pufcall()
704 l9p_pu64(msg, &fcall->rgetattr.nlink); in l9p_pufcall()
705 l9p_pu64(msg, &fcall->rgetattr.rdev); in l9p_pufcall()
706 l9p_pu64(msg, &fcall->rgetattr.size); in l9p_pufcall()
707 l9p_pu64(msg, &fcall->rgetattr.blksize); in l9p_pufcall()
708 l9p_pu64(msg, &fcall->rgetattr.blocks); in l9p_pufcall()
709 l9p_pu64(msg, &fcall->rgetattr.atime_sec); in l9p_pufcall()
710 l9p_pu64(msg, &fcall->rgetattr.atime_nsec); in l9p_pufcall()
711 l9p_pu64(msg, &fcall->rgetattr.mtime_sec); in l9p_pufcall()
712 l9p_pu64(msg, &fcall->rgetattr.mtime_nsec); in l9p_pufcall()
713 l9p_pu64(msg, &fcall->rgetattr.ctime_sec); in l9p_pufcall()
714 l9p_pu64(msg, &fcall->rgetattr.ctime_nsec); in l9p_pufcall()
715 l9p_pu64(msg, &fcall->rgetattr.btime_sec); in l9p_pufcall()
716 l9p_pu64(msg, &fcall->rgetattr.btime_nsec); in l9p_pufcall()
717 l9p_pu64(msg, &fcall->rgetattr.gen); in l9p_pufcall()
718 r = l9p_pu64(msg, &fcall->rgetattr.data_version); in l9p_pufcall()
722 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
723 l9p_pu32(msg, &fcall->tsetattr.valid); in l9p_pufcall()
724 l9p_pu32(msg, &fcall->tsetattr.mode); in l9p_pufcall()
725 l9p_pu32(msg, &fcall->tsetattr.uid); in l9p_pufcall()
726 l9p_pu32(msg, &fcall->tsetattr.gid); in l9p_pufcall()
727 l9p_pu64(msg, &fcall->tsetattr.size); in l9p_pufcall()
728 l9p_pu64(msg, &fcall->tsetattr.atime_sec); in l9p_pufcall()
729 l9p_pu64(msg, &fcall->tsetattr.atime_nsec); in l9p_pufcall()
730 l9p_pu64(msg, &fcall->tsetattr.mtime_sec); in l9p_pufcall()
731 r = l9p_pu64(msg, &fcall->tsetattr.mtime_nsec); in l9p_pufcall()
738 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
739 l9p_pu32(msg, &fcall->txattrwalk.newfid); in l9p_pufcall()
740 r = l9p_pustring(msg, &fcall->txattrwalk.name); in l9p_pufcall()
744 r = l9p_pu64(msg, &fcall->rxattrwalk.size); in l9p_pufcall()
748 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
749 r = l9p_pustring(msg, &fcall->txattrcreate.name); in l9p_pufcall()
752 l9p_pu64(msg, &fcall->txattrcreate.attr_size); in l9p_pufcall()
753 r = l9p_pu32(msg, &fcall->txattrcreate.flags); in l9p_pufcall()
760 r = l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
767 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
768 l9p_pu8(msg, &fcall->tlock.type); in l9p_pufcall()
769 l9p_pu32(msg, &fcall->tlock.flags); in l9p_pufcall()
770 l9p_pu64(msg, &fcall->tlock.start); in l9p_pufcall()
771 l9p_pu64(msg, &fcall->tlock.length); in l9p_pufcall()
772 l9p_pu32(msg, &fcall->tlock.proc_id); in l9p_pufcall()
773 r = l9p_pustring(msg, &fcall->tlock.client_id); in l9p_pufcall()
777 r = l9p_pu8(msg, &fcall->rlock.status); in l9p_pufcall()
781 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
785 l9p_pu8(msg, &fcall->getlock.type); in l9p_pufcall()
786 l9p_pu64(msg, &fcall->getlock.start); in l9p_pufcall()
787 l9p_pu64(msg, &fcall->getlock.length); in l9p_pufcall()
788 l9p_pu32(msg, &fcall->getlock.proc_id); in l9p_pufcall()
789 r = l9p_pustring(msg, &fcall->getlock.client_id); in l9p_pufcall()
793 l9p_pu32(msg, &fcall->tlink.dfid); in l9p_pufcall()
794 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
795 r = l9p_pustring(msg, &fcall->tlink.name); in l9p_pufcall()
802 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
803 r = l9p_pustring(msg, &fcall->tmkdir.name); in l9p_pufcall()
806 l9p_pu32(msg, &fcall->tmkdir.mode); in l9p_pufcall()
807 r = l9p_pu32(msg, &fcall->tmkdir.gid); in l9p_pufcall()
811 r = l9p_puqid(msg, &fcall->rmkdir.qid); in l9p_pufcall()
815 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
816 r = l9p_pustring(msg, &fcall->trenameat.oldname); in l9p_pufcall()
819 l9p_pu32(msg, &fcall->trenameat.newdirfid); in l9p_pufcall()
820 r = l9p_pustring(msg, &fcall->trenameat.newname); in l9p_pufcall()
827 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
828 r = l9p_pustring(msg, &fcall->tunlinkat.name); in l9p_pufcall()
831 r = l9p_pu32(msg, &fcall->tunlinkat.flags); in l9p_pufcall()
847 if (msg->lm_mode == L9P_PACK) { in l9p_pufcall()
849 uint32_t len = (uint32_t)msg->lm_size; in l9p_pufcall()
850 msg->lm_cursor_offset = 0; in l9p_pufcall()
851 msg->lm_cursor_iov = 0; in l9p_pufcall()
858 msg->lm_size -= sizeof(uint32_t); in l9p_pufcall()
864 l9p_pu32(msg, &len); in l9p_pufcall()