From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 13/16] xfs: implement demand load of utf8norm.ko Date: Sat, 4 Oct 2014 00:16:51 -0700 Message-ID: <20141004071651.GB5168@infradead.org> References: <20141003214758.GY1865@sgi.com> <20141003220357.GM1865@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com, olaf@sgi.com To: Ben Myers Return-path: Received: from bombadil.infradead.org ([198.137.202.9]:47644 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751022AbaJDHQv (ORCPT ); Sat, 4 Oct 2014 03:16:51 -0400 Content-Disposition: inline In-Reply-To: <20141003220357.GM1865@sgi.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > +int > +xfs_init_utf8_module(struct xfs_mount *mp) > +{ > + request_module("utf8norm"); > + > + spin_lock(&utf8norm_lock); > + if (utf8norm_initialized) { > + spin_unlock(&utf8norm_lock); > + return 0; > + } > + > + utf8version_is_supported_func = symbol_get(utf8version_is_supported); > + if (!utf8version_is_supported_func) > + goto error; > + > + utf8nfkdi_func = symbol_get(utf8nfkdi); > + if (!utf8nfkdi_func) > + goto error; Please export a structure with a function pointes so that we just need a single symbol_get call. I'd have to look up how symbol_get works, but unless there's something that speaks against this it might be simpler to than just do a symbol_get per mounst structure that uses utf8 and can point to that structure so that we don't have to add additional reference counting infrastructure around it.