From owner-freebsd-fs@freebsd.org Thu Jun 25 19:53:57 2015 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9A3898D67B for ; Thu, 25 Jun 2015 19:53:57 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [IPv6:2a00:1450:400c:c05::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D901185F for ; Thu, 25 Jun 2015 19:53:57 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wiwl6 with SMTP id l6so27630167wiw.0 for ; Thu, 25 Jun 2015 12:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=2xGe5pJY7xYT8p5exM2iKaKua5/XJeO2FIp6KLBwemY=; b=kiIIva1sHh1Cf94KuBnmSP5tNQUohvU25fTPfh4A2CGLpJsN4F7Cr0OQFUuLLjHHyl riyrGaZ/KaKx1flJGOVUqxUsnWRtNVHP8Ni+B0HCesJSZ1tnfjrkjEHt/TQSCgUuRGpT Dn3WWQFSMH2AsJoPw1NDXOsQ7rmmXrO+oanzUg0L6QkHQ+nBkAXwftACytL/95/3DxB7 +R+DTO41gw8O9Q9NlZIX4XqiyvCdMrAK9InGOnhDVFdu1tnKMZiLypH+el/CkKa68D4x Zzn1KbtRJqP1y/8/3yHJc+z+09NxJAlyTF/tTTUe1B1CgkSlNwQ/AjfZQR5P70vgKBc6 +C8w== X-Received: by 10.180.88.8 with SMTP id bc8mr8563493wib.19.1435262035910; Thu, 25 Jun 2015 12:53:55 -0700 (PDT) Received: from brick.home (adje188.neoplus.adsl.tpnet.pl. [79.184.212.188]) by mx.google.com with ESMTPSA id d3sm9080449wic.1.2015.06.25.12.53.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jun 2015 12:53:55 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 25 Jun 2015 21:53:52 +0200 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Bruce Evans Cc: Mateusz Guzik , freebsd-fs@freebsd.org Subject: Re: atomic v_usecount and v_holdcnt Message-ID: <20150625195352.GB1042@brick.home> Mail-Followup-To: Bruce Evans , Mateusz Guzik , freebsd-fs@freebsd.org References: <20141122002812.GA32289@dft-labs.eu> <20141122092527.GT17068@kib.kiev.ua> <20141122211147.GA23623@dft-labs.eu> <20141124095251.GH17068@kib.kiev.ua> <20150314225226.GA15302@dft-labs.eu> <20150316094643.GZ2379@kib.kiev.ua> <20150317014412.GA10819@dft-labs.eu> <20150318104442.GS2379@kib.kiev.ua> <20150625123156.GA29667@dft-labs.eu> <20150626042546.Q2820@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150626042546.Q2820@besplex.bde.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jun 2015 19:53:57 -0000 On 0626T0429, Bruce Evans wrote: > On Thu, 25 Jun 2015, Mateusz Guzik wrote: > > > On Wed, Mar 18, 2015 at 12:44:42PM +0200, Konstantin Belousov wrote: > >> On Tue, Mar 17, 2015 at 02:44:12AM +0100, Mateusz Guzik wrote: > > >>> I replaced them with refcount_acquire_if_not_zero and > >>> refcount_release_if_not_last. > >> I dislike the length of the names. Can you propose something shorter ? > > > > Unfortunately the original API is alreday quite verbose and I don't have > > anything readable which would retain "refcount_acquire" (instead of a > > "ref_get" or "ref_acq"). Adding "_nz" as a suffix does not look good > > ("refcount_acquire_if_nz"). > > refcount -> rc > acquire -> acq > > The "acq" abbreviation is already used a lot for atomic ops. How about refcount_acquire_gt_0() and refcount_release_gt_1()1?