From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Fri, 24 Aug 2018 11:32:11 +0300 From: Vladimir Davydov Subject: Re: [PATCH 01/18] vinyl: rework internal quota API Message-ID: <20180824083211.ocuzu3tntit2mcbe@esperanza> References: <20180820110721.GD8716@chai> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180820110721.GD8716@chai> To: Konstantin Osipov Cc: tarantool-patches@freelists.org List-ID: On Mon, Aug 20, 2018 at 02:07:21PM +0300, Konstantin Osipov wrote: > * Vladimir Davydov [18/08/16 23:03]: > > + * > > + * Usage pattern: > > + * > > + * size_t reserved = ; > > + * if (vy_quota_try_use(q, reserved, timeout) != 0) > > + * return -1; > > + * > > + * size_t used = ; > > + * vy_quota_commit_use(q, reserved, used); > > How is this different from vy_quota_use(); followed by > vy_quota_release( - )? > > If vy_quota_commit_use() is actually release *or* force-use, > depending on the sign of the result ( - allocated>) then the new api is actually less clear than the old > one. > > If you would like to introduce a new call which would either > release quota or force-use it, then this call should be called > vy_quota_adjust() or something like that, and the old call > (vy_quota_use()) should be left intact. The new names are imho > less clear. NP, I'll rename vy_quota_try_use() back to vy_quota_use() and vy_quota_commit_use() to vy_quota_adjust().