From patchwork Mon Mar 21 16:59:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 648351 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2LH2CqN025133 for ; Mon, 21 Mar 2011 17:02:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751287Ab1CURCJ (ORCPT ); Mon, 21 Mar 2011 13:02:09 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:63054 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751249Ab1CURCI (ORCPT ); Mon, 21 Mar 2011 13:02:08 -0400 Received: by fxm17 with SMTP id 17so5651875fxm.19 for ; Mon, 21 Mar 2011 10:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=+mv8ZtgTh5xNDkUs8ERJaqDgRK1SWj/E8BuC0z5pJKc=; b=Tj5kWcSNYpFLH8X/P/WcJMJwl/vbB9n5MMuzrxzkoLZlK7LKDjb8BC0WCKNAOcSvhh x3UyOdgbO8Ej8g6rkSepwec4SPaBVSmFJoKJOQi+zQKm8+QJneIxPbQxgpDITBBUdHXp YEaRKR2Bn4MxPmJKKLGhcgHIHq5NNR+s09yCY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=RoJHKmysC52d5Giq4bqfz2+/rvXXfWwexvKZ2wTzcbN+1nhiCsQNaXpfr9FtwLSmqC GjkYEYiT/7Zm15j6NONb8Lpu2Jiwq/7mteQM9ArMPq+rvovHY/PaMmZyJF+h/p7sBOkc vndBc5pxVLWji93AcYlDGgMV4rFpTmwlstMg0= Received: by 10.223.57.86 with SMTP id b22mr5424870fah.95.1300726798834; Mon, 21 Mar 2011 09:59:58 -0700 (PDT) Received: from htj.dyndns.org ([130.75.117.88]) by mx.google.com with ESMTPS id n7sm41966fam.35.2011.03.21.09.59.57 (version=SSLv3 cipher=OTHER); Mon, 21 Mar 2011 09:59:57 -0700 (PDT) Date: Mon, 21 Mar 2011 17:59:55 +0100 From: Tejun Heo To: Chris Mason Cc: linux-btrfs Subject: Re: [PATCH RFC] btrfs: Simplify locking Message-ID: <20110321165955.GG12003@htj.dyndns.org> References: <20110320174433.GA12003@htj.dyndns.org> <1300665355-sup-1698@think> <20110321082942.GD12003@htj.dyndns.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20110321082942.GD12003@htj.dyndns.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 21 Mar 2011 17:02:13 +0000 (UTC) Index: work/fs/btrfs/locking.h =================================================================== --- work.orig/fs/btrfs/locking.h +++ work/fs/btrfs/locking.h @@ -28,6 +28,8 @@ static inline bool btrfs_try_spin_lock(s static inline void btrfs_tree_lock(struct extent_buffer *eb) { + if (mutex_tryspin(&eb->lock)) + return; mutex_lock(&eb->lock); }