Lines Matching refs:msg

76 l9p_iov_io(struct l9p_message *msg, void *buffer, size_t len)  in l9p_iov_io()  argument
81 assert(msg != NULL); in l9p_iov_io()
86 if (msg->lm_cursor_iov >= msg->lm_niov) in l9p_iov_io()
92 size_t idx = msg->lm_cursor_iov; in l9p_iov_io()
93 size_t space = msg->lm_iov[idx].iov_len - msg->lm_cursor_offset; in l9p_iov_io()
96 if (msg->lm_mode == L9P_PACK) { in l9p_iov_io()
97 memcpy((char *)msg->lm_iov[idx].iov_base + in l9p_iov_io()
98 msg->lm_cursor_offset, (char *)buffer + done, in l9p_iov_io()
102 if (msg->lm_mode == L9P_UNPACK) { in l9p_iov_io()
104 (char *)msg->lm_iov[idx].iov_base + in l9p_iov_io()
105 msg->lm_cursor_offset, towrite); in l9p_iov_io()
108 msg->lm_cursor_offset += towrite; in l9p_iov_io()
115 msg->lm_cursor_iov++; in l9p_iov_io()
116 msg->lm_cursor_offset = 0; in l9p_iov_io()
118 if (msg->lm_cursor_iov >= msg->lm_niov && left > 0) in l9p_iov_io()
123 msg->lm_size += done; in l9p_iov_io()
133 l9p_pu8(struct l9p_message *msg, uint8_t *val) in l9p_pu8() argument
136 return (l9p_iov_io(msg, val, sizeof (uint8_t))); in l9p_pu8()
145 l9p_pu16(struct l9p_message *msg, uint16_t *val) in l9p_pu16() argument
157 if (msg->lm_mode == L9P_PACK) { in l9p_pu16()
159 return (l9p_iov_io(msg, &copy, sizeof (uint16_t))); in l9p_pu16()
161 ret = l9p_iov_io(msg, val, sizeof (uint16_t)); in l9p_pu16()
165 return (l9p_iov_io(msg, val, sizeof (uint16_t))); in l9p_pu16()
175 l9p_pu32(struct l9p_message *msg, uint32_t *val) in l9p_pu32() argument
181 if (msg->lm_mode == L9P_PACK) { in l9p_pu32()
183 return (l9p_iov_io(msg, &copy, sizeof (uint32_t))); in l9p_pu32()
185 ret = l9p_iov_io(msg, val, sizeof (uint32_t)); in l9p_pu32()
189 return (l9p_iov_io(msg, val, sizeof (uint32_t))); in l9p_pu32()
199 l9p_pu64(struct l9p_message *msg, uint64_t *val) in l9p_pu64() argument
205 if (msg->lm_mode == L9P_PACK) { in l9p_pu64()
207 return (l9p_iov_io(msg, &copy, sizeof (uint64_t))); in l9p_pu64()
209 ret = l9p_iov_io(msg, val, sizeof (uint32_t)); in l9p_pu64()
213 return (l9p_iov_io(msg, val, sizeof (uint64_t))); in l9p_pu64()
231 l9p_pustring(struct l9p_message *msg, char **s) in l9p_pustring() argument
235 if (msg->lm_mode == L9P_PACK) in l9p_pustring()
238 if (l9p_pu16(msg, &len) < 0) in l9p_pustring()
241 if (msg->lm_mode == L9P_UNPACK) { in l9p_pustring()
247 if (l9p_iov_io(msg, *s, len) < 0) in l9p_pustring()
250 if (msg->lm_mode == L9P_UNPACK) { in l9p_pustring()
278 l9p_pustrings(struct l9p_message *msg, uint16_t *num, char **strings, in l9p_pustrings() argument
285 if (msg->lm_mode == L9P_PACK) { in l9p_pustrings()
290 r = l9p_pu16(msg, &adjusted); in l9p_pustrings()
292 r = l9p_pu16(msg, num); in l9p_pustrings()
301 ret = l9p_pustring(msg, &strings[i]); in l9p_pustrings()
317 l9p_puqid(struct l9p_message *msg, struct l9p_qid *qid) in l9p_puqid() argument
322 if (msg->lm_mode == L9P_PACK) { in l9p_puqid()
324 r = l9p_pu8(msg, &type); in l9p_puqid()
326 r = l9p_pu8(msg, &type); in l9p_puqid()
330 r = l9p_pu32(msg, &qid->version); in l9p_puqid()
332 r = l9p_pu64(msg, &qid->path); in l9p_puqid()
343 l9p_puqids(struct l9p_message *msg, uint16_t *num, struct l9p_qid *qids) in l9p_puqids() argument
348 r = l9p_pu16(msg, num); in l9p_puqids()
351 ret = l9p_puqid(msg, &qids[i]); in l9p_puqids()
369 l9p_pustat(struct l9p_message *msg, struct l9p_stat *stat, in l9p_pustat() argument
376 if (msg->lm_mode == L9P_PACK) in l9p_pustat()
379 r += l9p_pu16(msg, &size); in l9p_pustat()
380 r += l9p_pu16(msg, &stat->type); in l9p_pustat()
381 r += l9p_pu32(msg, &stat->dev); in l9p_pustat()
382 r += l9p_puqid(msg, &stat->qid); in l9p_pustat()
383 r += l9p_pu32(msg, &stat->mode); in l9p_pustat()
384 r += l9p_pu32(msg, &stat->atime); in l9p_pustat()
385 r += l9p_pu32(msg, &stat->mtime); in l9p_pustat()
386 r += l9p_pu64(msg, &stat->length); in l9p_pustat()
387 r += l9p_pustring(msg, &stat->name); in l9p_pustat()
388 r += l9p_pustring(msg, &stat->uid); in l9p_pustat()
389 r += l9p_pustring(msg, &stat->gid); in l9p_pustat()
390 r += l9p_pustring(msg, &stat->muid); in l9p_pustat()
393 r += l9p_pustring(msg, &stat->extension); in l9p_pustat()
394 r += l9p_pu32(msg, &stat->n_uid); in l9p_pustat()
395 r += l9p_pu32(msg, &stat->n_gid); in l9p_pustat()
396 r += l9p_pu32(msg, &stat->n_muid); in l9p_pustat()
414 l9p_pudirent(struct l9p_message *msg, struct l9p_dirent *de) in l9p_pudirent() argument
418 r = l9p_puqid(msg, &de->qid); in l9p_pudirent()
419 r += l9p_pu64(msg, &de->offset); in l9p_pudirent()
420 r += l9p_pu8(msg, &de->type); in l9p_pudirent()
421 s = l9p_pustring(msg, &de->name); in l9p_pudirent()
434 l9p_pufcall(struct l9p_message *msg, union l9p_fcall *fcall, in l9p_pufcall() argument
444 l9p_pu32(msg, &length); in l9p_pufcall()
445 l9p_pu8(msg, &fcall->hdr.type); in l9p_pufcall()
446 r = l9p_pu16(msg, &fcall->hdr.tag); in l9p_pufcall()
461 l9p_pu32(msg, &fcall->version.msize); in l9p_pufcall()
462 r = l9p_pustring(msg, &fcall->version.version); in l9p_pufcall()
466 l9p_pu32(msg, &fcall->tauth.afid); in l9p_pufcall()
467 r = l9p_pustring(msg, &fcall->tauth.uname); in l9p_pufcall()
470 r = l9p_pustring(msg, &fcall->tauth.aname); in l9p_pufcall()
474 r = l9p_pu32(msg, &fcall->tauth.n_uname); in l9p_pufcall()
478 r = l9p_puqid(msg, &fcall->rauth.aqid); in l9p_pufcall()
482 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
483 l9p_pu32(msg, &fcall->tattach.afid); in l9p_pufcall()
484 r = l9p_pustring(msg, &fcall->tattach.uname); in l9p_pufcall()
487 r = l9p_pustring(msg, &fcall->tattach.aname); in l9p_pufcall()
491 r = l9p_pu32(msg, &fcall->tattach.n_uname); in l9p_pufcall()
495 r = l9p_puqid(msg, &fcall->rattach.qid); in l9p_pufcall()
499 r = l9p_pustring(msg, &fcall->error.ename); in l9p_pufcall()
503 r = l9p_pu32(msg, &fcall->error.errnum); in l9p_pufcall()
507 r = l9p_pu32(msg, &fcall->error.errnum); in l9p_pufcall()
511 r = l9p_pu16(msg, &fcall->tflush.oldtag); in l9p_pufcall()
518 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
519 l9p_pu32(msg, &fcall->twalk.newfid); in l9p_pufcall()
520 r = l9p_pustrings(msg, &fcall->twalk.nwname, in l9p_pufcall()
525 r = l9p_puqids(msg, &fcall->rwalk.nwqid, fcall->rwalk.wqid); in l9p_pufcall()
529 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
530 r = l9p_pu8(msg, &fcall->topen.mode); in l9p_pufcall()
534 l9p_puqid(msg, &fcall->ropen.qid); in l9p_pufcall()
535 r = l9p_pu32(msg, &fcall->ropen.iounit); in l9p_pufcall()
539 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
540 r = l9p_pustring(msg, &fcall->tcreate.name); in l9p_pufcall()
543 l9p_pu32(msg, &fcall->tcreate.perm); in l9p_pufcall()
544 r = l9p_pu8(msg, &fcall->tcreate.mode); in l9p_pufcall()
546 r = l9p_pustring(msg, &fcall->tcreate.extension); in l9p_pufcall()
550 l9p_puqid(msg, &fcall->rcreate.qid); in l9p_pufcall()
551 r = l9p_pu32(msg, &fcall->rcreate.iounit); in l9p_pufcall()
556 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
557 l9p_pu64(msg, &fcall->io.offset); in l9p_pufcall()
558 r = l9p_pu32(msg, &fcall->io.count); in l9p_pufcall()
563 r = l9p_pu32(msg, &fcall->io.count); in l9p_pufcall()
567 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
568 l9p_pu64(msg, &fcall->io.offset); in l9p_pufcall()
569 r = l9p_pu32(msg, &fcall->io.count); in l9p_pufcall()
573 r = l9p_pu32(msg, &fcall->io.count); in l9p_pufcall()
580 r = l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
591 l9p_pu16(msg, &size); in l9p_pufcall()
592 r = l9p_pustat(msg, &fcall->rstat.stat, version); in l9p_pufcall()
599 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
600 l9p_pu16(msg, &size); in l9p_pufcall()
601 r = l9p_pustat(msg, &fcall->twstat.stat, version); in l9p_pufcall()
609 l9p_pu32(msg, &fcall->rstatfs.statfs.type); in l9p_pufcall()
610 l9p_pu32(msg, &fcall->rstatfs.statfs.bsize); in l9p_pufcall()
611 l9p_pu64(msg, &fcall->rstatfs.statfs.blocks); in l9p_pufcall()
612 l9p_pu64(msg, &fcall->rstatfs.statfs.bfree); in l9p_pufcall()
613 l9p_pu64(msg, &fcall->rstatfs.statfs.bavail); in l9p_pufcall()
614 l9p_pu64(msg, &fcall->rstatfs.statfs.files); in l9p_pufcall()
615 l9p_pu64(msg, &fcall->rstatfs.statfs.ffree); in l9p_pufcall()
616 l9p_pu64(msg, &fcall->rstatfs.statfs.fsid); in l9p_pufcall()
617 r = l9p_pu32(msg, &fcall->rstatfs.statfs.namelen); in l9p_pufcall()
621 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
622 r = l9p_pu32(msg, &fcall->tlopen.flags); in l9p_pufcall()
626 l9p_puqid(msg, &fcall->rlopen.qid); in l9p_pufcall()
627 r = l9p_pu32(msg, &fcall->rlopen.iounit); in l9p_pufcall()
631 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
632 r = l9p_pustring(msg, &fcall->tlcreate.name); in l9p_pufcall()
635 l9p_pu32(msg, &fcall->tlcreate.flags); in l9p_pufcall()
636 l9p_pu32(msg, &fcall->tlcreate.mode); in l9p_pufcall()
637 r = l9p_pu32(msg, &fcall->tlcreate.gid); in l9p_pufcall()
641 l9p_puqid(msg, &fcall->rlcreate.qid); in l9p_pufcall()
642 r = l9p_pu32(msg, &fcall->rlcreate.iounit); in l9p_pufcall()
646 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
647 r = l9p_pustring(msg, &fcall->tsymlink.name); in l9p_pufcall()
650 r = l9p_pustring(msg, &fcall->tsymlink.symtgt); in l9p_pufcall()
653 r = l9p_pu32(msg, &fcall->tlcreate.gid); in l9p_pufcall()
657 r = l9p_puqid(msg, &fcall->rsymlink.qid); in l9p_pufcall()
661 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
662 r = l9p_pustring(msg, &fcall->tmknod.name); in l9p_pufcall()
665 l9p_pu32(msg, &fcall->tmknod.mode); in l9p_pufcall()
666 l9p_pu32(msg, &fcall->tmknod.major); in l9p_pufcall()
667 l9p_pu32(msg, &fcall->tmknod.minor); in l9p_pufcall()
668 r = l9p_pu32(msg, &fcall->tmknod.gid); in l9p_pufcall()
672 r = l9p_puqid(msg, &fcall->rmknod.qid); in l9p_pufcall()
676 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
677 l9p_pu32(msg, &fcall->trename.dfid); in l9p_pufcall()
678 r = l9p_pustring(msg, &fcall->trename.name); in l9p_pufcall()
685 r = l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
689 r = l9p_pustring(msg, &fcall->rreadlink.target); in l9p_pufcall()
693 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
694 r = l9p_pu64(msg, &fcall->tgetattr.request_mask); in l9p_pufcall()
698 l9p_pu64(msg, &fcall->rgetattr.valid); in l9p_pufcall()
699 l9p_puqid(msg, &fcall->rgetattr.qid); in l9p_pufcall()
700 l9p_pu32(msg, &fcall->rgetattr.mode); in l9p_pufcall()
701 l9p_pu32(msg, &fcall->rgetattr.uid); in l9p_pufcall()
702 l9p_pu32(msg, &fcall->rgetattr.gid); in l9p_pufcall()
703 l9p_pu64(msg, &fcall->rgetattr.nlink); in l9p_pufcall()
704 l9p_pu64(msg, &fcall->rgetattr.rdev); in l9p_pufcall()
705 l9p_pu64(msg, &fcall->rgetattr.size); in l9p_pufcall()
706 l9p_pu64(msg, &fcall->rgetattr.blksize); in l9p_pufcall()
707 l9p_pu64(msg, &fcall->rgetattr.blocks); in l9p_pufcall()
708 l9p_pu64(msg, &fcall->rgetattr.atime_sec); in l9p_pufcall()
709 l9p_pu64(msg, &fcall->rgetattr.atime_nsec); in l9p_pufcall()
710 l9p_pu64(msg, &fcall->rgetattr.mtime_sec); in l9p_pufcall()
711 l9p_pu64(msg, &fcall->rgetattr.mtime_nsec); in l9p_pufcall()
712 l9p_pu64(msg, &fcall->rgetattr.ctime_sec); in l9p_pufcall()
713 l9p_pu64(msg, &fcall->rgetattr.ctime_nsec); in l9p_pufcall()
714 l9p_pu64(msg, &fcall->rgetattr.btime_sec); in l9p_pufcall()
715 l9p_pu64(msg, &fcall->rgetattr.btime_nsec); in l9p_pufcall()
716 l9p_pu64(msg, &fcall->rgetattr.gen); in l9p_pufcall()
717 r = l9p_pu64(msg, &fcall->rgetattr.data_version); in l9p_pufcall()
721 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
722 l9p_pu32(msg, &fcall->tsetattr.valid); in l9p_pufcall()
723 l9p_pu32(msg, &fcall->tsetattr.mode); in l9p_pufcall()
724 l9p_pu32(msg, &fcall->tsetattr.uid); in l9p_pufcall()
725 l9p_pu32(msg, &fcall->tsetattr.gid); in l9p_pufcall()
726 l9p_pu64(msg, &fcall->tsetattr.size); in l9p_pufcall()
727 l9p_pu64(msg, &fcall->tsetattr.atime_sec); in l9p_pufcall()
728 l9p_pu64(msg, &fcall->tsetattr.atime_nsec); in l9p_pufcall()
729 l9p_pu64(msg, &fcall->tsetattr.mtime_sec); in l9p_pufcall()
730 r = l9p_pu64(msg, &fcall->tsetattr.mtime_nsec); in l9p_pufcall()
737 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
738 l9p_pu32(msg, &fcall->txattrwalk.newfid); in l9p_pufcall()
739 r = l9p_pustring(msg, &fcall->txattrwalk.name); in l9p_pufcall()
743 r = l9p_pu64(msg, &fcall->rxattrwalk.size); in l9p_pufcall()
747 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
748 r = l9p_pustring(msg, &fcall->txattrcreate.name); in l9p_pufcall()
751 l9p_pu64(msg, &fcall->txattrcreate.attr_size); in l9p_pufcall()
752 r = l9p_pu32(msg, &fcall->txattrcreate.flags); in l9p_pufcall()
759 r = l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
766 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
767 l9p_pu8(msg, &fcall->tlock.type); in l9p_pufcall()
768 l9p_pu32(msg, &fcall->tlock.flags); in l9p_pufcall()
769 l9p_pu64(msg, &fcall->tlock.start); in l9p_pufcall()
770 l9p_pu64(msg, &fcall->tlock.length); in l9p_pufcall()
771 l9p_pu32(msg, &fcall->tlock.proc_id); in l9p_pufcall()
772 r = l9p_pustring(msg, &fcall->tlock.client_id); in l9p_pufcall()
776 r = l9p_pu8(msg, &fcall->rlock.status); in l9p_pufcall()
780 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
784 l9p_pu8(msg, &fcall->getlock.type); in l9p_pufcall()
785 l9p_pu64(msg, &fcall->getlock.start); in l9p_pufcall()
786 l9p_pu64(msg, &fcall->getlock.length); in l9p_pufcall()
787 l9p_pu32(msg, &fcall->getlock.proc_id); in l9p_pufcall()
788 r = l9p_pustring(msg, &fcall->getlock.client_id); in l9p_pufcall()
792 l9p_pu32(msg, &fcall->tlink.dfid); in l9p_pufcall()
793 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
794 r = l9p_pustring(msg, &fcall->tlink.name); in l9p_pufcall()
801 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
802 r = l9p_pustring(msg, &fcall->tmkdir.name); in l9p_pufcall()
805 l9p_pu32(msg, &fcall->tmkdir.mode); in l9p_pufcall()
806 r = l9p_pu32(msg, &fcall->tmkdir.gid); in l9p_pufcall()
810 r = l9p_puqid(msg, &fcall->rmkdir.qid); in l9p_pufcall()
814 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
815 r = l9p_pustring(msg, &fcall->trenameat.oldname); in l9p_pufcall()
818 l9p_pu32(msg, &fcall->trenameat.newdirfid); in l9p_pufcall()
819 r = l9p_pustring(msg, &fcall->trenameat.newname); in l9p_pufcall()
826 l9p_pu32(msg, &fcall->hdr.fid); in l9p_pufcall()
827 r = l9p_pustring(msg, &fcall->tunlinkat.name); in l9p_pufcall()
830 r = l9p_pu32(msg, &fcall->tunlinkat.flags); in l9p_pufcall()
846 if (msg->lm_mode == L9P_PACK) { in l9p_pufcall()
848 uint32_t len = (uint32_t)msg->lm_size; in l9p_pufcall()
849 msg->lm_cursor_offset = 0; in l9p_pufcall()
850 msg->lm_cursor_iov = 0; in l9p_pufcall()
857 msg->lm_size -= sizeof(uint32_t); in l9p_pufcall()
863 l9p_pu32(msg, &len); in l9p_pufcall()