From owner-freebsd-virtualization@FreeBSD.ORG Tue Jan 11 19:53:51 2011 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7ADA1065673 for ; Tue, 11 Jan 2011 19:53:51 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 590CA8FC08 for ; Tue, 11 Jan 2011 19:53:50 +0000 (UTC) Received: by bwz12 with SMTP id 12so13079111bwz.13 for ; Tue, 11 Jan 2011 11:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :message-id:user-agent:mime-version:content-type; bh=96EJifV0mtTSt5pQ5HjHSYW7Iez43HU1z2Ern1Fcw/k=; b=ZeBl6ob/PyXWsDfAAHD8DF3DB1egnBVs3lLNQoev5yLCIK6Pi01t3uu3jBnHbtlN6r zo9dQZBmeb/S5NjEPp29t+HP4k9jZfxdTw+gYMsN5B2sD22dbxJZZGcETsmmG1QSuudo NloPLdg9BQ0vw1uilfOL04pFXWZP/O6021f6E= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; b=t3hl6ulwZ5yf5UMTkQgn1PsPCqiTy4SJGPSj82+BNIMkklgYN4tIyjZ1+eJqc6M2mD BUPOyuEAxV9vEFpjf/p4NwfDhve3kRtJOuRcRU3TagJ1xVi3el4Di4qflUVSBTMkJiZV ipUUUFGTE+T1ip87Dy4j5udREmOVIVK/E8w9s= Received: by 10.204.33.70 with SMTP id g6mr4254535bkd.177.1294774935019; Tue, 11 Jan 2011 11:42:15 -0800 (PST) Received: from localhost ([95.69.174.185]) by mx.google.com with ESMTPS id f20sm14152991bkf.16.2011.01.11.11.42.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 11 Jan 2011 11:42:13 -0800 (PST) From: Mikolaj Golub To: freebsd-virtualization@FreeBSD.org Date: Tue, 11 Jan 2011 21:42:12 +0200 Message-ID: <86ei8j6xd7.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: Subject: smbfs on VIMAGE kernel X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 19:53:51 -0000 --=-=-= Hi, With the attached patch I can mount and use samba fs on current built with VIMAGE option. -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=smb_trantcp.c.VNET.patch Index: sys/netsmb/smb_trantcp.c =================================================================== --- sys/netsmb/smb_trantcp.c (revision 217275) +++ sys/netsmb/smb_trantcp.c (working copy) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -79,13 +80,17 @@ static int nb_setsockopt_int(struct socket *so, int level, int name, int val) { struct sockopt sopt; + int error; bzero(&sopt, sizeof(sopt)); sopt.sopt_level = level; sopt.sopt_name = name; sopt.sopt_val = &val; sopt.sopt_valsize = sizeof(val); - return sosetopt(so, &sopt); + CURVNET_SET(so->so_vnet); + error = sosetopt(so, &sopt); + CURVNET_RESTORE(); + return error; } static int @@ -286,8 +291,10 @@ nbssn_recvhdr(struct nbpcb *nbp, int *lenp, auio.uio_offset = 0; auio.uio_resid = sizeof(len); auio.uio_td = td; + CURVNET_SET(so->so_vnet); error = soreceive(so, (struct sockaddr **)NULL, &auio, (struct mbuf **)NULL, (struct mbuf **)NULL, &flags); + CURVNET_RESTORE(); if (error) return error; if (auio.uio_resid > 0) { @@ -371,8 +378,10 @@ nbssn_recv(struct nbpcb *nbp, struct mbuf **mpp, i */ do { rcvflg = MSG_WAITALL; + CURVNET_SET(so->so_vnet); error = soreceive(so, (struct sockaddr **)NULL, &auio, &tm, (struct mbuf **)NULL, &rcvflg); + CURVNET_RESTORE(); } while (error == EWOULDBLOCK || error == EINTR || error == ERESTART); if (error) --=-=-=--