From: Daniel Vetter Subject: Re: [PATCH 1/2] drm: introduce drm_gem_object_[handle_]unreference_unlocked Date: Tue, 9 Feb 2010 13:13:01 +0100 Message-ID: <20100209121300.GC3562@viiv.ffwll.ch> References: <1265694552-10822-1-git-send-email-luca@luca-barbieri.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1265694552-10822-1-git-send-email-luca@luca-barbieri.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net To: Luca Barbieri Cc: airlied@linux.ie, dri-devel@lists.sourceforge.net List-Id: dri-devel@lists.freedesktop.org On Tue, Feb 09, 2010 at 06:49:11AM +0100, Luca Barbieri wrote: > This patch introduces the drm_gem_object_unreference_unlocked > and drm_gem_object_handle_unreference_unlocked functions that > do not require holding struct_mutex. > > drm_gem_object_unreference_unlocked calls the new > ->gem_free_object_unlocked entry point if available, and > otherwise just takes struct_mutex and just calls ->gem_free_object Why not add a BUG_ON(!mutex_is_locked(&dev->struct_mutex)) to drm_gem_object_unreference to catch wrong api by occasional drm hackers like me? -Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48 ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com --