diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2007-06-16 13:16:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-06-16 16:16:16 -0400 |
commit | 9d66586f7723b73c5925c7c7819c260484627851 (patch) | |
tree | 616c3c01282e0ca82c59b1496c385cf1e2961564 /ipc/shm.c | |
parent | 22741925d268e8479ef66312749bd8d96ed35365 (diff) |
shm: fix the filename of hugetlb sysv shared memory
Some user space tools need to identify SYSV shared memory when examining
/proc/<pid>/maps. To do so they look for a block device with major zero, a
dentry named SYSV<sysv key>, and having the minor of the internal sysv
shared memory kernel mount.
To help these tools and to make it easier for people just browsing
/proc/<pid>/maps this patch modifies hugetlb sysv shared memory to use the
SYSV<key> dentry naming convention.
User space tools will still have to be aware that hugetlb sysv shared
memory lives on a different internal kernel mount and so has a different
block device minor number from the rest of sysv shared memory.
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>
Cc: Albert Cahalan <acahalan@gmail.com>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc/shm.c')
-rw-r--r-- | ipc/shm.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -366,9 +366,10 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) | |||
366 | return error; | 366 | return error; |
367 | } | 367 | } |
368 | 368 | ||
369 | sprintf (name, "SYSV%08x", key); | ||
369 | if (shmflg & SHM_HUGETLB) { | 370 | if (shmflg & SHM_HUGETLB) { |
370 | /* hugetlb_zero_setup takes care of mlock user accounting */ | 371 | /* hugetlb_file_setup takes care of mlock user accounting */ |
371 | file = hugetlb_zero_setup(size); | 372 | file = hugetlb_file_setup(name, size); |
372 | shp->mlock_user = current->user; | 373 | shp->mlock_user = current->user; |
373 | } else { | 374 | } else { |
374 | int acctflag = VM_ACCOUNT; | 375 | int acctflag = VM_ACCOUNT; |
@@ -379,7 +380,6 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) | |||
379 | if ((shmflg & SHM_NORESERVE) && | 380 | if ((shmflg & SHM_NORESERVE) && |
380 | sysctl_overcommit_memory != OVERCOMMIT_NEVER) | 381 | sysctl_overcommit_memory != OVERCOMMIT_NEVER) |
381 | acctflag = 0; | 382 | acctflag = 0; |
382 | sprintf (name, "SYSV%08x", key); | ||
383 | file = shmem_file_setup(name, size, acctflag); | 383 | file = shmem_file_setup(name, size, acctflag); |
384 | } | 384 | } |
385 | error = PTR_ERR(file); | 385 | error = PTR_ERR(file); |