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 C3BD46EC59; Tue, 9 Mar 2021 01:44:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C3BD46EC59 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1615243451; bh=CuiW8DtFxB0lXTwzVl97zO/UWRdWTt82LHFdXKRSLFk=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=iJD+dCPdM2xF96xZh/WGmqYLQte61ylJcPNLLApEvc9CDV3qt2IWXkR2jlgndqI8Q oaHN/RWO0u8/Pa2KUKa+w+feV4OQhPRpVg2gxw9z+P6NprC4WrVf5w6DVzGKgD5/nR Nj1duduPa/lKFBxW5R7GdwTbqPzNSIk4hyrqo3+I= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 BEBA06EC59 for ; Tue, 9 Mar 2021 01:44:09 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org BEBA06EC59 Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lJObh-00036N-63; Tue, 09 Mar 2021 01:44:09 +0300 To: Cyrill Gorcunov , tml References: <20210301212343.422372-1-gorcunov@gmail.com> <20210301212343.422372-3-gorcunov@gmail.com> Message-ID: Date: Mon, 8 Mar 2021 23:44:08 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: <20210301212343.422372-3-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD9D3134714A9BDB69B0BCB3F10535B621E527C8C001B1DBBB100894C459B0CD1B9A96DB978F86E632987DF72240715C81FA4066BDE562F54EE833C91E627C23918 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE75037DDE13FB75316EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637835928C62272F24E8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCEAC852048D9EA2D955288898A1E52EB400C9448DD7BAD08E389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C091DAD9F922AA71188941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6BAA8CD687FCDB2EBCC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FCB07C9E286C61B7F975ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4930A3850AC1BE2E735438480C876D879DDC4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0FECB2555BB02FD5A93B503F486389A921A5CC5B56E945C8DA X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2BBE337FB72E92315FF39D8DB89857825743D937135AA13FF7120598F3739033D109B151A58CD633F834459D11680B505C87839E103577AE760EC998C1C5CD5CE X-C1DE0DAB: 0D63561A33F958A5B83B7A5FA693CD64F99C269A56B9DEE4004A85BD46E09FCFD59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34315359784EE451037932E0AE5C0D33CDFAACDE042027502DDB063E1023830D99FD10AAFDE895DB5D1D7E09C32AA3244CA19CA551BB863FB609DB4ADADBF6DFD96C24832127668422729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojUqxEkzHTt/h07ux12KMIKw== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638225AE3E45E216FFBED9338557AC5E2C7603841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v19 2/6] box/func: prepare for transition to modules subsystem 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" Hi! Thanks for the patch! See 4 comments below. > diff --git a/src/box/call.c b/src/box/call.c > index 7839e1f3e..4b1893f12 100644 > --- a/src/box/call.c > +++ b/src/box/call.c > @@ -116,7 +116,7 @@ static const struct port_vtab port_msgpack_vtab = { > }; > > int > -box_module_reload(const char *name) > +box_process_module_reload(const char *name) 1. The name is ugly. I propose to merge this function into box_module_reload(). The latter is never used from anywhere except this 'process' thing. > { > struct credentials *credentials = effective_user(); > if ((credentials->universal_access & (PRIV_X | PRIV_U)) != > diff --git a/src/box/func.c b/src/box/func.c > index 233696a4f..88903f40e 100644 > --- a/src/box/func.c > +++ b/src/box/func.c > @@ -71,7 +71,7 @@ struct func_c { > * Each stored function keeps a handle to the > * dynamic library for the C callback. > */ > - struct module *module; > + struct box_module *bxmod; 2. What was wrong with the old member name? Especially in the functions. It just significantly increases the diff, ruins the history, and does not change readability anyhow. The old name was even better IMO. > }; > > /*** > @@ -166,61 +166,65 @@ module_find(const char *package, const char *package_end, char *path, > return 0; > } > > -static struct mh_strnptr_t *modules = NULL; > +static struct mh_strnptr_t *box_module_hash = NULL; 3. The same question. 'modules' was just fine. Diff is significantly bigger because most of such renames are not needed at all. You only need to rename the struct. It was module, and stayed module. Just a new prefix is added to the struct name and its methods. > @@ -484,23 +488,23 @@ func_c_new(MAYBE_UNUSED struct func_def *def) > } > func->base.vtab = &func_c_vtab; > func->func = NULL; > - func->module = NULL; > + func->bxmod = NULL; > return &func->base; > } > > static void > func_c_unload(struct func_c *func) > { > - if (func->module) { > + if (func->bxmod) { 4. Since you changed this line, it should be != NULL now. But even better - keep the old variable and struct member names. Then you wouldn't need to change almost anything in this file except struct names. > rlist_del(&func->item); > - if (rlist_empty(&func->module->funcs)) { > + if (rlist_empty(&func->bxmod->funcs)) { > struct func_name name; > func_split_name(func->base.def->name, &name); > - module_cache_del(name.package, name.package_end); > + cache_del(name.package, name.package_end); > } > - module_gc(func->module); > + box_module_gc(func->bxmod); > } > - func->module = NULL; > + func->bxmod = NULL; > func->func = NULL; > }