From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 387B86F3F2; Fri, 3 Sep 2021 23:50:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 387B86F3F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1630702204; bh=jV8OhBI0HyHb4NgkgkLw1CJe/DnxUBSevxl3GTTZ9b4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=LoUwsd4c4DW/cMYmdL7sXQFO46ucP8Vt1ZELraWEvgKDJy98EshgGQD2J69XcEUaa jhwXslNZN7TwreQtp04mQtXaze2wRA5EIV6RvoLu2jsnioyt5vDUohpQygNPptLO+U u1FvmYqAKiSb3MPEQ6VhfbcmGIrabSLmrgf4YM2c= Received: from smtp29.i.mail.ru (smtp29.i.mail.ru [94.100.177.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D99B96F3FC for ; Fri, 3 Sep 2021 23:49:21 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D99B96F3FC Received: by smtp29.i.mail.ru with esmtpa (envelope-from ) id 1mMG7k-0007LS-US; Fri, 03 Sep 2021 23:49:21 +0300 To: v.shpilevoy@tarantool.org, imun@tarantool.org Date: Fri, 3 Sep 2021 23:49:15 +0300 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-4EC0790: 10 X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D96C1EA41D18F4D58D04F3E644628B13AEFE843B3F5982AA182A05F53808504028391FAC1CB9D47FE99A6803E1EEBC82A45F610AA85696851D09E43A61EBAA91 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE77603ADE015AF816DEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637BC4B0F5721B555078638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D86F1A6B78BF9C54EC51C31515AAA70FA0117882F4460429724CE54428C33FAD305F5C1EE8F4F765FC5FC25ED3FCEC3375A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F446042972877693876707352026055571C92BF10FF04B652EEC242312D2E47CDBA5A96583BA9C0B312567BB2376E601842F6C81A19E625A9149C048EE437C869540D2AB0F8F49F126DDB898E8D8FC6C240DEA7642DBF02ECDB25306B2B78CF848AE20165D0A6AB1C7CE11FEE397AD43380FEE24CA6E0066C2D8992A16C4224003CC836476EA7A3FFF5B025636E2021AF6380DFAD1A18204E546F3947CB11811A4A51E3B096D1867E19FE1407959CC434672EE6371089D37D7C0E48F6C8AA50765F7900637EC3198ECE464ADAEEFF80C71ABB335746BA297DBC24807EABDAD6C7F3747799A X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A213B5FB47DCBC3458F0AFF96BAACF4158235E5A14AD4A4A4625E192CAD1D9E79DB8BF922E402C092CBED5322E09C7E3F9 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CA3881D9F5F3D43CBBEA1FF528EB2EDF56863C68E55136F529C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EFCCE3E035A672CDEE699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3490011A262ADAEDFEE483F0AC64F6DAF853F265088BE4EAAB73B18040AD98FEA915169D0219654CF41D7E09C32AA3244C50A3625F63348F00D5F88603367D952EFE8DA44ABE2443F7927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj0HWrnICxeoqgGizgJtFQTA== X-Mailru-Sender: 583F1D7ACE8F49BD1042885CEC987B6B63ED8848C208AAF1E99A6803E1EEBC82E5E949923882BAAD7019711D9D5B048E1458020726E2BC9FD5ECBA0B92C0A936CDC7563AA7CEBD287402F9BA4338D657ED14614B50AE0675 X-Mras: Ok Subject: [Tarantool-patches] [PATCH v3 1/4] fiber: rename ref to storage_ref X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Oleg Babin via Tarantool-patches Reply-To: olegrok@tarantool.org Cc: tarantool-patches@dev.tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Oleg Babin Ref is a lua reference to fiber storage. This patch just renames storage.lua.ref to storage.lua.storage_ref to underline that it's not a reference to fiber itself and needed only for fiber storage. --- src/lib/core/fiber.h | 2 +- src/lua/fiber.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/core/fiber.h b/src/lib/core/fiber.h index b85625ba7..593847df7 100644 --- a/src/lib/core/fiber.h +++ b/src/lib/core/fiber.h @@ -626,7 +626,7 @@ struct fiber { /** * Optional fiber.storage Lua reference. */ - int ref; + int storage_ref; } lua; /** * Iproto sync. diff --git a/src/lua/fiber.c b/src/lua/fiber.c index 38394666b..83dcbe2fa 100644 --- a/src/lua/fiber.c +++ b/src/lua/fiber.c @@ -670,7 +670,7 @@ lbox_fiber_name(struct lua_State *L) /** * Trigger invoked when the fiber has stopped execution of its - * current request. Only purpose - delete storage.lua.ref keeping + * current request. Only purpose - delete storage.lua.storage_ref keeping * a reference of Lua fiber.storage object. Unlike Lua stack, * Lua fiber storage may be created not only for fibers born from * Lua land. For example, an IProto request may execute a Lua @@ -681,10 +681,10 @@ static int lbox_fiber_on_stop(struct trigger *trigger, void *event) { struct fiber *f = (struct fiber *) event; - int storage_ref = f->storage.lua.ref; + int storage_ref = f->storage.lua.storage_ref; assert(storage_ref > 0); luaL_unref(tarantool_L, LUA_REGISTRYINDEX, storage_ref); - f->storage.lua.ref = LUA_NOREF; + f->storage.lua.storage_ref = LUA_NOREF; trigger_clear(trigger); free(trigger); return 0; @@ -694,7 +694,7 @@ static int lbox_fiber_storage(struct lua_State *L) { struct fiber *f = lbox_checkfiber(L, 1); - int storage_ref = f->storage.lua.ref; + int storage_ref = f->storage.lua.storage_ref; if (storage_ref <= 0) { struct trigger *t = (struct trigger *) malloc(sizeof(*t)); @@ -706,7 +706,7 @@ lbox_fiber_storage(struct lua_State *L) trigger_add(&f->on_stop, t); lua_newtable(L); /* create local storage on demand */ storage_ref = luaL_ref(L, LUA_REGISTRYINDEX); - f->storage.lua.ref = storage_ref; + f->storage.lua.storage_ref = storage_ref; } lua_rawgeti(L, LUA_REGISTRYINDEX, storage_ref); return 1; -- 2.32.0