Re: patch for mmap MAP_ANON|MAP_SHARED

From: Kanoj Sarcar (kanoj@google.engr.sgi.com)
Date: Fri Apr 21 2000 - 12:27:27 EST


>
> --=-=-=
>
> Hi Linus and Kanoj,
>
> The following patch makes mmap MAP_ANON|MAP_SHARED possible.
>
> I had to change the i_dev input for /dev/zero shared mappings but I
> think this is at least not worse than before. The inode does
> definitely not belong to the block device /dev/zero is located on.
>
> Greetings
> Christoph
>

The patch looks good. I would just ask you to illustrate with a small
program that mmaps /dev/zero MAP_SHARED and then does a "cat /proc/pid/maps"
on itself. I think instead of reporting the root device numbers for the
/dev/zero mapping, it will report the shmfs device numbers.

Ie,

instead of

08048000-0804e000 r-xp 00000000 08:01 XXXXXXXX /dev/zero

it will say something like

08048000-0804e000 r-xp 00000000 AB:CD XXXXXXXX /dev/zero

I can't think of a problem this would cause, unless you claim an
user might be confused to see /dev/zero, but a different device
for the file.

Btw, even for MAP_ANON|MAP_SHARED, the filename reported via
"cat /proc/pid/maps" will show up as /dev/zero (I _think_), did
you want to change that?

Kanoj

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:19 EST