Andrew Morton <[email protected]> wrote:
> Perhaps one could make mem_bdi==NULL if !CONFIG_MMU, for a minor space
> saving.
The problem is that takes the #ifdef-avoidance scheme a step too far. If we
do that, the kernel will crash. Observe the following:
Breakpoint 1, memory_open (inode=0xc0f7da04, filp=0xc09d8ba0) at fs.h:635
635 return MINOR(inode->i_rdev);
(gdb) n
634 {
(gdb)
904 filp->f_mapping->backing_dev_info = &mem_bdi;
(gdb) i sym filp->f_mapping->backing_dev_info
default_backing_dev_info in section .data
Note how the BDI pointer is already set to the default which we then override.
We either need to fill in mem_bdi correctly for MMU or only override the BDI
pointer if !MMU.
Of course, that doesn't touch on the matter of the compiler not letting you do
&NULL, though I assume you meant make &mem_bdi == NULL.
Also, the default BDI is incorrect for /dev/mem and /dev/kmem since it does
not permit shared mappings, so I think we need mem_bdi anyway, though I should
perhaps make it more general, so that it can apply to all mappable chardevs.
David
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]