diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/hugetlbfs/inode.c | 7 |
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 | ||
739 | struct file *hugetlb_zero_setup(size_t size) | 739 | struct 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); |