[prev in list] [next in list] [prev in thread] [next in thread] 

List:       illumos-developer
Subject:    Re: [developer] modlinkage usage in nfs_common.c
From:       "Richard PALO" <richard () netbsd ! org>
Date:       2016-06-25 20:26:54
Message-ID: 576EE90E.5010206 () netbsd ! org
[Download RAW message or body]

Le 25/06/16 20:18, Richard PALO a écrit :
> Le 25/06/16 16:50, Garrett D'Amore a écrit :
> > notice the use modlinkage_big rather than modlinkage. I think this is an \
> > alternate approach to kmem_alloc. 
> 
> Thanks, I skimmed over that... 
> 
> The definition (just beforehand) is indeed similar but ignores the difference \
> between _LP64 and not. 
> If this is really okay then, well, guess I'll ignore it.
> Seems a bit contradictory though since it's still a static definition.
> 
> cheers
> 
Am I going to regret this?  
I notice that the usage of modlinkage_big later in this module is simply typecast to \
a normal 'struct modlinkage'...  here:
> 229	status = mod_install((struct modlinkage *)&modlinkage);
and here:
> 
> 261	return (mod_info((struct modlinkage *)&modlinkage, modinfop));

So in the end, I guess my question stands... 

Perhaps, if the restriction for non _LP64 is lifted (as it is clearly ignored here),
then why shouldn't 'struct modlinkage' simply *always* use the 7 element array?
> from modctl.h:
> 215struct modlinkage {
> 216	int		ml_rev;		/* rev of loadable modules system */
> 217#ifdef _LP64
> 218	void		*ml_linkage[7];	/* more space in 64-bit OS */
> 219#else
> 220	void		*ml_linkage[4];	/* NULL terminated list of */
> 221					/* linkage structures */
> 222#endif
> 223};

Thus avoiding creating this new type 'modlinkage_big'.

Or is there something else weirdly special about the nfs module?

-- 
Richard PALO



-------------------------------------------
illumos-developer
Archives: https://www.listbox.com/member/archive/182179/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182179/25758058-4e9228dc
Modify Your Subscription: \
https://www.listbox.com/member/?member_id=25758058&id_secret=25758058-c19b436a \
Powered by Listbox: http://www.listbox.com


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic