aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hugetlbfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hugetlbfs/inode.c')
-rw-r--r--fs/hugetlbfs/inode.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index e19d4c0cacae..1e2872b25343 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -6,6 +6,8 @@
6 * Copyright (C) 2002 Linus Torvalds. 6 * Copyright (C) 2002 Linus Torvalds.
7 */ 7 */
8 8
9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10
9#include <linux/module.h> 11#include <linux/module.h>
10#include <linux/thread_info.h> 12#include <linux/thread_info.h>
11#include <asm/current.h> 13#include <asm/current.h>
@@ -475,7 +477,7 @@ static struct inode *hugetlbfs_get_root(struct super_block *sb,
475 * annotation because huge_pmd_share() does an allocation under 477 * annotation because huge_pmd_share() does an allocation under
476 * i_mmap_mutex. 478 * i_mmap_mutex.
477 */ 479 */
478struct lock_class_key hugetlbfs_i_mmap_mutex_key; 480static struct lock_class_key hugetlbfs_i_mmap_mutex_key;
479 481
480static struct inode *hugetlbfs_get_inode(struct super_block *sb, 482static struct inode *hugetlbfs_get_inode(struct super_block *sb,
481 struct inode *dir, 483 struct inode *dir,
@@ -823,8 +825,7 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
823 ps = memparse(args[0].from, &rest); 825 ps = memparse(args[0].from, &rest);
824 pconfig->hstate = size_to_hstate(ps); 826 pconfig->hstate = size_to_hstate(ps);
825 if (!pconfig->hstate) { 827 if (!pconfig->hstate) {
826 printk(KERN_ERR 828 pr_err("Unsupported page size %lu MB\n",
827 "hugetlbfs: Unsupported page size %lu MB\n",
828 ps >> 20); 829 ps >> 20);
829 return -EINVAL; 830 return -EINVAL;
830 } 831 }
@@ -832,8 +833,7 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
832 } 833 }
833 834
834 default: 835 default:
835 printk(KERN_ERR "hugetlbfs: Bad mount option: \"%s\"\n", 836 pr_err("Bad mount option: \"%s\"\n", p);
836 p);
837 return -EINVAL; 837 return -EINVAL;
838 break; 838 break;
839 } 839 }
@@ -853,8 +853,7 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
853 return 0; 853 return 0;
854 854
855bad_val: 855bad_val:
856 printk(KERN_ERR "hugetlbfs: Bad value '%s' for mount option '%s'\n", 856 pr_err("Bad value '%s' for mount option '%s'\n", args[0].from, p);
857 args[0].from, p);
858 return -EINVAL; 857 return -EINVAL;
859} 858}
860 859
@@ -902,8 +901,7 @@ hugetlbfs_fill_super(struct super_block *sb, void *data, int silent)
902 goto out_free; 901 goto out_free;
903 return 0; 902 return 0;
904out_free: 903out_free:
905 if (sbinfo->spool) 904 kfree(sbinfo->spool);
906 kfree(sbinfo->spool);
907 kfree(sbinfo); 905 kfree(sbinfo);
908 return -ENOMEM; 906 return -ENOMEM;
909} 907}
@@ -939,7 +937,7 @@ static int get_hstate_idx(int page_size_log)
939 return h - hstates; 937 return h - hstates;
940} 938}
941 939
942static struct dentry_operations anon_ops = { 940static const struct dentry_operations anon_ops = {
943 .d_dname = simple_dname 941 .d_dname = simple_dname
944}; 942};
945 943
@@ -970,8 +968,7 @@ struct file *hugetlb_file_setup(const char *name, size_t size,
970 *user = current_user(); 968 *user = current_user();
971 if (user_shm_lock(size, *user)) { 969 if (user_shm_lock(size, *user)) {
972 task_lock(current); 970 task_lock(current);
973 printk_once(KERN_WARNING 971 pr_warn_once("%s (%d): Using mlock ulimits for SHM_HUGETLB is deprecated\n",
974 "%s (%d): Using mlock ulimits for SHM_HUGETLB is deprecated\n",
975 current->comm, current->pid); 972 current->comm, current->pid);
976 task_unlock(current); 973 task_unlock(current);
977 } else { 974 } else {
@@ -1031,7 +1028,7 @@ static int __init init_hugetlbfs_fs(void)
1031 int i; 1028 int i;
1032 1029
1033 if (!hugepages_supported()) { 1030 if (!hugepages_supported()) {
1034 pr_info("hugetlbfs: disabling because there are no supported hugepage sizes\n"); 1031 pr_info("disabling because there are no supported hugepage sizes\n");
1035 return -ENOTSUPP; 1032 return -ENOTSUPP;
1036 } 1033 }
1037 1034
@@ -1060,7 +1057,7 @@ static int __init init_hugetlbfs_fs(void)
1060 buf); 1057 buf);
1061 1058
1062 if (IS_ERR(hugetlbfs_vfsmount[i])) { 1059 if (IS_ERR(hugetlbfs_vfsmount[i])) {
1063 pr_err("hugetlb: Cannot mount internal hugetlbfs for " 1060 pr_err("Cannot mount internal hugetlbfs for "
1064 "page size %uK", ps_kb); 1061 "page size %uK", ps_kb);
1065 error = PTR_ERR(hugetlbfs_vfsmount[i]); 1062 error = PTR_ERR(hugetlbfs_vfsmount[i]);
1066 hugetlbfs_vfsmount[i] = NULL; 1063 hugetlbfs_vfsmount[i] = NULL;