From 9d66586f7723b73c5925c7c7819c260484627851 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sat, 16 Jun 2007 10:16:16 -0700 Subject: shm: fix the filename of hugetlb sysv shared memory Some user space tools need to identify SYSV shared memory when examining /proc//maps. To do so they look for a block device with major zero, a dentry named SYSV, 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//maps this patch modifies hugetlb sysv shared memory to use the SYSV 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 Cc: "Serge E. Hallyn" Cc: Albert Cahalan Cc: Badari Pulavarty Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- ipc/shm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ipc/shm.c') diff --git a/ipc/shm.c b/ipc/shm.c index 047b823e6bf0..0852f206d895 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -366,9 +366,10 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) return error; } + sprintf (name, "SYSV%08x", key); if (shmflg & SHM_HUGETLB) { - /* hugetlb_zero_setup takes care of mlock user accounting */ - file = hugetlb_zero_setup(size); + /* hugetlb_file_setup takes care of mlock user accounting */ + file = hugetlb_file_setup(name, size); shp->mlock_user = current->user; } else { int acctflag = VM_ACCOUNT; @@ -379,7 +380,6 @@ static int newseg (struct ipc_namespace *ns, key_t key, int shmflg, size_t size) if ((shmflg & SHM_NORESERVE) && sysctl_overcommit_memory != OVERCOMMIT_NEVER) acctflag = 0; - sprintf (name, "SYSV%08x", key); file = shmem_file_setup(name, size, acctflag); } error = PTR_ERR(file); -- cgit v1.2.3-59-g8ed1b