From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 27 00:18:01 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 467C8106564A for ; Wed, 27 Apr 2011 00:18:01 +0000 (UTC) (envelope-from freebsd@chillt.de) Received: from dd16434.kasserver.com (dd16434.kasserver.com [85.13.137.111]) by mx1.freebsd.org (Postfix) with ESMTP id 07F108FC0A for ; Wed, 27 Apr 2011 00:18:00 +0000 (UTC) Received: from taiko.lan (ppp-197-43.21-151.libero.it [151.21.43.197]) by dd16434.kasserver.com (Postfix) with ESMTPSA id 087251886072; Wed, 27 Apr 2011 02:17:58 +0200 (CEST) Message-ID: <4DB76085.4000402@chillt.de> Date: Wed, 27 Apr 2011 02:17:09 +0200 From: Bartosz Fabianowski User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.15) Gecko/20110309 Thunderbird/3.1.9 MIME-Version: 1.0 To: Kostik Belousov References: <4DB695DB.1080505@chillt.de> <201104261217.23858.hselasky@c2i.net> <4DB6BCC6.5050001@chillt.de> <20110426124403.GQ48734@deviant.kiev.zoral.com.ua> In-Reply-To: <20110426124403.GQ48734@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Hans Petter Selasky Subject: Re: Is there some implicit locking of device methods? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2011 00:18:01 -0000 > If you needs per-file private data for cdev, you would be better served > by cdevpriv(9) KPI. Cloning is too hard to use correctly for such task. Thanks, I just got that working. To help those going down a similar path in the future, I would like to note quickly that the following must be added to the cdevsw structure to ensure proper clean-up: .d_flags = D_TRACKCLOSE I just spent hours debugging panics until I realized only the last close() was triggering a call to my .d_close method. - Bartosz