func: static void v9fs_lcreate(void *opaque) int32_t dfid , flags , mode ; gid_t gid ; ssize_t offset = 7 ; V9fsFidState * fidp ; int32_t iounit ; V9fsPDU * pdu = opaque ; err = pdu_unmarshal ( pdu , offset , "dsddd" , & dfid , & name , & flags , & mode , & gid ); if ( err < 0 )  fidp = get_fid ( pdu , dfid ); static V9fsFidState *get_fid(V9fsPDU *pdu, int32_t fid) int err ; V9fsFidState * f ; V9fsState * s = pdu -> s ; for (f = s->fid_list; f; f = f->next) if ( f -> fid == fid )  f -> ref ++; err = v9fs_reopen_fid ( pdu , f ); if ( err < 0 )  return NULL ; return f ; return NULL ; if ( fidp == NULL )  err = - ENOENT; flags = get_dotl_openflags ( pdu -> s , flags ); static int get_dotl_openflags(V9fsState *s, int oflags) int flags ; flags = dotl_to_open_flags ( oflags ); flags &= ~ ( O_NOCTTY | O_ASYNC | O_CREAT ); flags &= ~O_DIRECT; return flags ; err = v9fs_co_open2 ( pdu , fidp , & name , gid , flags | O_CREAT , mode , & stbuf ); if ( err < 0 )  fidp -> fid_type = P9_FID_FILE; fidp -> open_flags = flags; if ( flags & O_EXCL )  fidp -> flags |= FID_NON_RECLAIMABLE; iounit = get_iounit ( pdu , & fidp -> path ); static int32_t get_iounit(V9fsPDU *pdu, V9fsPath *path) struct statfs stbuf ; int32_t iounit = 0 ; V9fsState * s = pdu -> s ; if ( ! v9fs_co_statfs ( pdu , path , & stbuf ) )  iounit = stbuf . f_bsize; iounit *= ( s -> msize - P9_IOHDRSZ ) / stbuf . f_bsize; if ( ! iounit )  iounit = s -> msize - P9_IOHDRSZ; return iounit ; err = pdu_marshal ( pdu , offset , "Qd" , & qid , iounit ); if ( err < 0 )  err += offset; complete_pdu ( pdu -> s , pdu , err ); static void complete_pdu(V9fsState *s, V9fsPDU *pdu, ssize_t len) if ( len < 0 )  int err = - len ; if ( s -> proto_version != V9FS_PROTO_2000L )  V9fsString str ; str . data = strerror ( err ); str . size = strlen ( str . data ); len += pdu_marshal ( pdu , len , "s" , & str ); len += pdu_marshal ( pdu , len , "d" , err ); pdu_marshal ( pdu , 0 , "dbw" , ( int32_t ) len , id , pdu -> tag ); pdu -> size = len; pdu -> id = id; virtqueue_push ( s -> vq , & pdu -> elem , len ); qemu_co_queue_next ( & pdu -> complete ); free_pdu ( s , pdu ); 