* a couple more oddities(?) in mm code
@ 2010-04-05 11:39 Robert P. J. Day
0 siblings, 0 replies; only message in thread
From: Robert P. J. Day @ 2010-04-05 11:39 UTC (permalink / raw)
To: linux-mm
(aside: i am not trying to be an annoying pedant, i am merely
succeeding. seriously, i'm currently working my way thru the MM code,
in a (possibly vain) attempt to finally understand it, and i
occasionally run across things that just look a bit, well, odd. but
maybe it's just me. let me know if any of this is inappropriate.)
from filemap.c:
if (!isblk) {
/* FIXME: this is for backwards compatibility with 2.4 */
is there any compelling reason why any MM code still wants to be 2.4
backwards compatible? aren't we past that point by now?
also, from mmu_notifier.c, i find this *really* weird:
=============
int mmu_notifier_register(struct mmu_notifier *mn, struct mm_struct *mm)
{
return do_mmu_notifier_register(mn, mm, 1);
}
EXPORT_SYMBOL_GPL(mmu_notifier_register);
/*
* Same as mmu_notifier_register but here the caller must hold the
* mmap_sem in write mode.
*/
int __mmu_notifier_register(struct mmu_notifier *mn, struct mm_struct *mm)
{
return do_mmu_notifier_register(mn, mm, 0);
}
EXPORT_SYMBOL_GPL(__mmu_notifier_register);
=============
as a general rule, i normally expect the difference between two
kernel routines, say, func() and __func(), to be that func() would be
the generally callable one, while __func() would be a lower-level one,
perhaps using func() as a more convenient wrapper. but the above
shows that those two routines represent *different* invocations of
do_mmu_notifier_register(). that's just not a pattern i'm used to
seeing. doesn't it kind of fly in the face of kernel coding
standards?
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Linux Consulting, Training and Kernel Pedantry.
Web page: http://crashcourse.ca
Twitter: http://twitter.com/rpjday
========================================================================
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-04-05 11:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-05 11:39 a couple more oddities(?) in mm code Robert P. J. Day
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).