func: static void v9fs_setattr(void *opaque) int32_t fid ; V9fsFidState * fidp ; size_t offset = 7 ; V9fsIattr v9iattr ; V9fsPDU * pdu = opaque ; V9fsState * s = pdu -> s ; err = pdu_unmarshal ( pdu , offset , "dI" , & fid , & v9iattr ); if ( err < 0 )  fidp = get_fid ( pdu , fid ); 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 ; f -> flags |= FID_REFERENCED; return f ; return NULL ; if ( fidp == NULL )  err = - EINVAL; if ( v9iattr . valid & P9_ATTR_MODE )  err = v9fs_co_chmod ( pdu , & fidp -> path , v9iattr . mode ); if ( err < 0 )  if ( v9iattr . valid & ( P9_ATTR_ATIME | P9_ATTR_MTIME ) )  struct timespec times [ 2 ] ; if ( v9iattr . valid & P9_ATTR_ATIME )  if ( v9iattr . valid & P9_ATTR_ATIME_SET )  times [ 0 ] . tv_sec = v9iattr . atime_sec; times [ 0 ] . tv_nsec = v9iattr . atime_nsec; times [ 0 ] . tv_nsec = UTIME_NOW; times [ 0 ] . tv_nsec = UTIME_OMIT; if ( v9iattr . valid & P9_ATTR_MTIME )  times [ 1 ] . tv_nsec = UTIME_OMIT; err = v9fs_co_utimensat ( pdu , & fidp -> path , times ); if ( err < 0 )  if ( ( v9iattr . valid & ( P9_ATTR_UID | P9_ATTR_GID ) ) || ( ( v9iattr . valid & P9_ATTR_CTIME ) && ! ( ( v9iattr . valid & P9_ATTR_MASK ) & ~P9_ATTR_CTIME ) ) )  if ( ! ( v9iattr . valid & P9_ATTR_UID ) )  v9iattr . uid = - 1; if ( ! ( v9iattr . valid & P9_ATTR_GID ) )  v9iattr . gid = - 1; err = v9fs_co_chown ( pdu , & fidp -> path , v9iattr . uid , v9iattr . gid ); if ( err < 0 )  if ( v9iattr . valid & ( P9_ATTR_SIZE ) )  err = v9fs_co_truncate ( pdu , & fidp -> path , v9iattr . size ); if ( err < 0 )  err = offset; complete_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 ); 