aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hugetlbfs
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2007-06-16 13:16:16 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-06-16 16:16:16 -0400
commit9d66586f7723b73c5925c7c7819c260484627851 (patch)
tree616c3c01282e0ca82c59b1496c385cf1e2961564 /fs/hugetlbfs
parent22741925d268e8479ef66312749bd8d96ed35365 (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 'fs/hugetlbfs')
-rw-r--r--fs/hugetlbfs/inode.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index aa083dd34e92..e6b46b3ac2fe 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -736,15 +736,13 @@ static int can_do_hugetlb_shm(void)
736 can_do_mlock()); 736 can_do_mlock());
737} 737}
738 738
739struct file *hugetlb_zero_setup(size_t size) 739struct file *hugetlb_file_setup(const char *name, size_t size)
740{ 740{
741 int error = -ENOMEM; 741 int error = -ENOMEM;
742 struct file *file; 742 struct file *file;
743 struct inode *inode; 743 struct inode *inode;
744 struct dentry *dentry, *root; 744 struct dentry *dentry, *root;
745 struct qstr quick_string; 745 struct qstr quick_string;
746 char buf[16];
747 static atomic_t counter;
748 746
749 if (!hugetlbfs_vfsmount) 747 if (!hugetlbfs_vfsmount)
750 return ERR_PTR(-ENOENT); 748 return ERR_PTR(-ENOENT);
@@ -756,8 +754,7 @@ struct file *hugetlb_zero_setup(size_t size)
756 return ERR_PTR(-ENOMEM); 754 return ERR_PTR(-ENOMEM);
757 755
758 root = hugetlbfs_vfsmount->mnt_root; 756 root = hugetlbfs_vfsmount->mnt_root;
759 snprintf(buf, 16, "%u", atomic_inc_return(&counter)); 757 quick_string.name = name;
760 quick_string.name = buf;
761 quick_string.len = strlen(quick_string.name); 758 quick_string.len = strlen(quick_string.name);
762 quick_string.hash = 0; 759 quick_string.hash = 0;
763 dentry = d_alloc(root, &quick_string); 760 dentry = d_alloc(root, &quick_string);