aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 19:39:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 19:39:15 -0400
commiteea3a00264cf243a28e4331566ce67b86059339d (patch)
tree487f16389e0dfa32e9caa7604d1274a7dcda8f04 /fs
parente7c82412433a8039616c7314533a0a1c025d99bf (diff)
parente693d73c20ffdb06840c9378f367bad849ac0d5d (diff)
Merge branch 'akpm' (patches from Andrew)
Merge second patchbomb from Andrew Morton: - the rest of MM - various misc bits - add ability to run /sbin/reboot at reboot time - printk/vsprintf changes - fiddle with seq_printf() return value * akpm: (114 commits) parisc: remove use of seq_printf return value lru_cache: remove use of seq_printf return value tracing: remove use of seq_printf return value cgroup: remove use of seq_printf return value proc: remove use of seq_printf return value s390: remove use of seq_printf return value cris fasttimer: remove use of seq_printf return value cris: remove use of seq_printf return value openrisc: remove use of seq_printf return value ARM: plat-pxa: remove use of seq_printf return value nios2: cpuinfo: remove use of seq_printf return value microblaze: mb: remove use of seq_printf return value ipc: remove use of seq_printf return value rtc: remove use of seq_printf return value power: wakeup: remove use of seq_printf return value x86: mtrr: if: remove use of seq_printf return value linux/bitmap.h: improve BITMAP_{LAST,FIRST}_WORD_MASK MAINTAINERS: CREDITS: remove Stefano Brivio from B43 .mailmap: add Ricardo Ribalda CREDITS: add Ricardo Ribalda Delgado ...
Diffstat (limited to 'fs')
-rw-r--r--fs/dax.c17
-rw-r--r--fs/ext2/ext2.h1
-rw-r--r--fs/ext2/file.c17
-rw-r--r--fs/ext2/inode.c5
-rw-r--r--fs/ext2/namei.c10
-rw-r--r--fs/ext4/ext4.h1
-rw-r--r--fs/ext4/file.c19
-rw-r--r--fs/ext4/inode.c5
-rw-r--r--fs/ext4/namei.c10
-rw-r--r--fs/hugetlbfs/inode.c90
-rw-r--r--fs/jfs/jfs_metapage.c31
-rw-r--r--fs/jfs/jfs_metapage.h1
-rw-r--r--fs/nfs/Kconfig2
-rw-r--r--fs/nfsd/Kconfig1
-rw-r--r--fs/proc/array.c26
-rw-r--r--fs/proc/base.c82
-rw-r--r--fs/splice.c3
17 files changed, 183 insertions, 138 deletions
diff --git a/fs/dax.c b/fs/dax.c
index ed1619ec6537..d0bd1f4f81b3 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -464,6 +464,23 @@ int dax_fault(struct vm_area_struct *vma, struct vm_fault *vmf,
464EXPORT_SYMBOL_GPL(dax_fault); 464EXPORT_SYMBOL_GPL(dax_fault);
465 465
466/** 466/**
467 * dax_pfn_mkwrite - handle first write to DAX page
468 * @vma: The virtual memory area where the fault occurred
469 * @vmf: The description of the fault
470 *
471 */
472int dax_pfn_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
473{
474 struct super_block *sb = file_inode(vma->vm_file)->i_sb;
475
476 sb_start_pagefault(sb);
477 file_update_time(vma->vm_file);
478 sb_end_pagefault(sb);
479 return VM_FAULT_NOPAGE;
480}
481EXPORT_SYMBOL_GPL(dax_pfn_mkwrite);
482
483/**
467 * dax_zero_page_range - zero a range within a page of a DAX file 484 * dax_zero_page_range - zero a range within a page of a DAX file
468 * @inode: The file being truncated 485 * @inode: The file being truncated
469 * @from: The file offset that is being truncated to 486 * @from: The file offset that is being truncated to
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
index 678f9ab08c48..8d15febd0aa3 100644
--- a/fs/ext2/ext2.h
+++ b/fs/ext2/ext2.h
@@ -793,7 +793,6 @@ extern int ext2_fsync(struct file *file, loff_t start, loff_t end,
793 int datasync); 793 int datasync);
794extern const struct inode_operations ext2_file_inode_operations; 794extern const struct inode_operations ext2_file_inode_operations;
795extern const struct file_operations ext2_file_operations; 795extern const struct file_operations ext2_file_operations;
796extern const struct file_operations ext2_dax_file_operations;
797 796
798/* inode.c */ 797/* inode.c */
799extern const struct address_space_operations ext2_aops; 798extern const struct address_space_operations ext2_aops;
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index ef04fdb57dbf..3a0a6c6406d0 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -39,6 +39,7 @@ static int ext2_dax_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
39static const struct vm_operations_struct ext2_dax_vm_ops = { 39static const struct vm_operations_struct ext2_dax_vm_ops = {
40 .fault = ext2_dax_fault, 40 .fault = ext2_dax_fault,
41 .page_mkwrite = ext2_dax_mkwrite, 41 .page_mkwrite = ext2_dax_mkwrite,
42 .pfn_mkwrite = dax_pfn_mkwrite,
42}; 43};
43 44
44static int ext2_file_mmap(struct file *file, struct vm_area_struct *vma) 45static int ext2_file_mmap(struct file *file, struct vm_area_struct *vma)
@@ -106,22 +107,6 @@ const struct file_operations ext2_file_operations = {
106 .splice_write = iter_file_splice_write, 107 .splice_write = iter_file_splice_write,
107}; 108};
108 109
109#ifdef CONFIG_FS_DAX
110const struct file_operations ext2_dax_file_operations = {
111 .llseek = generic_file_llseek,
112 .read_iter = generic_file_read_iter,
113 .write_iter = generic_file_write_iter,
114 .unlocked_ioctl = ext2_ioctl,
115#ifdef CONFIG_COMPAT
116 .compat_ioctl = ext2_compat_ioctl,
117#endif
118 .mmap = ext2_file_mmap,
119 .open = dquot_file_open,
120 .release = ext2_release_file,
121 .fsync = ext2_fsync,
122};
123#endif
124
125const struct inode_operations ext2_file_inode_operations = { 110const struct inode_operations ext2_file_inode_operations = {
126#ifdef CONFIG_EXT2_FS_XATTR 111#ifdef CONFIG_EXT2_FS_XATTR
127 .setxattr = generic_setxattr, 112 .setxattr = generic_setxattr,
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index df9d6afbc5d5..b29eb6747116 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1388,10 +1388,7 @@ struct inode *ext2_iget (struct super_block *sb, unsigned long ino)
1388 1388
1389 if (S_ISREG(inode->i_mode)) { 1389 if (S_ISREG(inode->i_mode)) {
1390 inode->i_op = &ext2_file_inode_operations; 1390 inode->i_op = &ext2_file_inode_operations;
1391 if (test_opt(inode->i_sb, DAX)) { 1391 if (test_opt(inode->i_sb, NOBH)) {
1392 inode->i_mapping->a_ops = &ext2_aops;
1393 inode->i_fop = &ext2_dax_file_operations;
1394 } else if (test_opt(inode->i_sb, NOBH)) {
1395 inode->i_mapping->a_ops = &ext2_nobh_aops; 1392 inode->i_mapping->a_ops = &ext2_nobh_aops;
1396 inode->i_fop = &ext2_file_operations; 1393 inode->i_fop = &ext2_file_operations;
1397 } else { 1394 } else {
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index 148f6e3789ea..ce422931f411 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -104,10 +104,7 @@ static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode
104 return PTR_ERR(inode); 104 return PTR_ERR(inode);
105 105
106 inode->i_op = &ext2_file_inode_operations; 106 inode->i_op = &ext2_file_inode_operations;
107 if (test_opt(inode->i_sb, DAX)) { 107 if (test_opt(inode->i_sb, NOBH)) {
108 inode->i_mapping->a_ops = &ext2_aops;
109 inode->i_fop = &ext2_dax_file_operations;
110 } else if (test_opt(inode->i_sb, NOBH)) {
111 inode->i_mapping->a_ops = &ext2_nobh_aops; 108 inode->i_mapping->a_ops = &ext2_nobh_aops;
112 inode->i_fop = &ext2_file_operations; 109 inode->i_fop = &ext2_file_operations;
113 } else { 110 } else {
@@ -125,10 +122,7 @@ static int ext2_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
125 return PTR_ERR(inode); 122 return PTR_ERR(inode);
126 123
127 inode->i_op = &ext2_file_inode_operations; 124 inode->i_op = &ext2_file_inode_operations;
128 if (test_opt(inode->i_sb, DAX)) { 125 if (test_opt(inode->i_sb, NOBH)) {
129 inode->i_mapping->a_ops = &ext2_aops;
130 inode->i_fop = &ext2_dax_file_operations;
131 } else if (test_opt(inode->i_sb, NOBH)) {
132 inode->i_mapping->a_ops = &ext2_nobh_aops; 126 inode->i_mapping->a_ops = &ext2_nobh_aops;
133 inode->i_fop = &ext2_file_operations; 127 inode->i_fop = &ext2_file_operations;
134 } else { 128 } else {
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index f63c3d5805c4..8a3981ea35d8 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2593,7 +2593,6 @@ extern const struct file_operations ext4_dir_operations;
2593/* file.c */ 2593/* file.c */
2594extern const struct inode_operations ext4_file_inode_operations; 2594extern const struct inode_operations ext4_file_inode_operations;
2595extern const struct file_operations ext4_file_operations; 2595extern const struct file_operations ext4_file_operations;
2596extern const struct file_operations ext4_dax_file_operations;
2597extern loff_t ext4_llseek(struct file *file, loff_t offset, int origin); 2596extern loff_t ext4_llseek(struct file *file, loff_t offset, int origin);
2598 2597
2599/* inline.c */ 2598/* inline.c */
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 9ad03036d9f5..7a6defcf3352 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -206,6 +206,7 @@ static int ext4_dax_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
206static const struct vm_operations_struct ext4_dax_vm_ops = { 206static const struct vm_operations_struct ext4_dax_vm_ops = {
207 .fault = ext4_dax_fault, 207 .fault = ext4_dax_fault,
208 .page_mkwrite = ext4_dax_mkwrite, 208 .page_mkwrite = ext4_dax_mkwrite,
209 .pfn_mkwrite = dax_pfn_mkwrite,
209}; 210};
210#else 211#else
211#define ext4_dax_vm_ops ext4_file_vm_ops 212#define ext4_dax_vm_ops ext4_file_vm_ops
@@ -622,24 +623,6 @@ const struct file_operations ext4_file_operations = {
622 .fallocate = ext4_fallocate, 623 .fallocate = ext4_fallocate,
623}; 624};
624 625
625#ifdef CONFIG_FS_DAX
626const struct file_operations ext4_dax_file_operations = {
627 .llseek = ext4_llseek,
628 .read_iter = generic_file_read_iter,
629 .write_iter = ext4_file_write_iter,
630 .unlocked_ioctl = ext4_ioctl,
631#ifdef CONFIG_COMPAT
632 .compat_ioctl = ext4_compat_ioctl,
633#endif
634 .mmap = ext4_file_mmap,
635 .open = ext4_file_open,
636 .release = ext4_release_file,
637 .fsync = ext4_sync_file,
638 /* Splice not yet supported with DAX */
639 .fallocate = ext4_fallocate,
640};
641#endif
642
643const struct inode_operations ext4_file_inode_operations = { 626const struct inode_operations ext4_file_inode_operations = {
644 .setattr = ext4_setattr, 627 .setattr = ext4_setattr,
645 .getattr = ext4_getattr, 628 .getattr = ext4_getattr,
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index a3f451370bef..035b7a06f1c3 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4090,10 +4090,7 @@ struct inode *ext4_iget(struct super_block *sb, unsigned long ino)
4090 4090
4091 if (S_ISREG(inode->i_mode)) { 4091 if (S_ISREG(inode->i_mode)) {
4092 inode->i_op = &ext4_file_inode_operations; 4092 inode->i_op = &ext4_file_inode_operations;
4093 if (test_opt(inode->i_sb, DAX)) 4093 inode->i_fop = &ext4_file_operations;
4094 inode->i_fop = &ext4_dax_file_operations;
4095 else
4096 inode->i_fop = &ext4_file_operations;
4097 ext4_set_aops(inode); 4094 ext4_set_aops(inode);
4098 } else if (S_ISDIR(inode->i_mode)) { 4095 } else if (S_ISDIR(inode->i_mode)) {
4099 inode->i_op = &ext4_dir_inode_operations; 4096 inode->i_op = &ext4_dir_inode_operations;
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 28fe71a2904c..2291923dae4e 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2235,10 +2235,7 @@ retry:
2235 err = PTR_ERR(inode); 2235 err = PTR_ERR(inode);
2236 if (!IS_ERR(inode)) { 2236 if (!IS_ERR(inode)) {
2237 inode->i_op = &ext4_file_inode_operations; 2237 inode->i_op = &ext4_file_inode_operations;
2238 if (test_opt(inode->i_sb, DAX)) 2238 inode->i_fop = &ext4_file_operations;
2239 inode->i_fop = &ext4_dax_file_operations;
2240 else
2241 inode->i_fop = &ext4_file_operations;
2242 ext4_set_aops(inode); 2239 ext4_set_aops(inode);
2243 err = ext4_add_nondir(handle, dentry, inode); 2240 err = ext4_add_nondir(handle, dentry, inode);
2244 if (!err && IS_DIRSYNC(dir)) 2241 if (!err && IS_DIRSYNC(dir))
@@ -2302,10 +2299,7 @@ retry:
2302 err = PTR_ERR(inode); 2299 err = PTR_ERR(inode);
2303 if (!IS_ERR(inode)) { 2300 if (!IS_ERR(inode)) {
2304 inode->i_op = &ext4_file_inode_operations; 2301 inode->i_op = &ext4_file_inode_operations;
2305 if (test_opt(inode->i_sb, DAX)) 2302 inode->i_fop = &ext4_file_operations;
2306 inode->i_fop = &ext4_dax_file_operations;
2307 else
2308 inode->i_fop = &ext4_file_operations;
2309 ext4_set_aops(inode); 2303 ext4_set_aops(inode);
2310 d_tmpfile(dentry, inode); 2304 d_tmpfile(dentry, inode);
2311 err = ext4_orphan_add(handle, inode); 2305 err = ext4_orphan_add(handle, inode);
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 45e34908bdb5..2640d88b0e63 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -48,9 +48,10 @@ struct hugetlbfs_config {
48 kuid_t uid; 48 kuid_t uid;
49 kgid_t gid; 49 kgid_t gid;
50 umode_t mode; 50 umode_t mode;
51 long nr_blocks; 51 long max_hpages;
52 long nr_inodes; 52 long nr_inodes;
53 struct hstate *hstate; 53 struct hstate *hstate;
54 long min_hpages;
54}; 55};
55 56
56struct hugetlbfs_inode_info { 57struct hugetlbfs_inode_info {
@@ -68,7 +69,7 @@ int sysctl_hugetlb_shm_group;
68enum { 69enum {
69 Opt_size, Opt_nr_inodes, 70 Opt_size, Opt_nr_inodes,
70 Opt_mode, Opt_uid, Opt_gid, 71 Opt_mode, Opt_uid, Opt_gid,
71 Opt_pagesize, 72 Opt_pagesize, Opt_min_size,
72 Opt_err, 73 Opt_err,
73}; 74};
74 75
@@ -79,6 +80,7 @@ static const match_table_t tokens = {
79 {Opt_uid, "uid=%u"}, 80 {Opt_uid, "uid=%u"},
80 {Opt_gid, "gid=%u"}, 81 {Opt_gid, "gid=%u"},
81 {Opt_pagesize, "pagesize=%s"}, 82 {Opt_pagesize, "pagesize=%s"},
83 {Opt_min_size, "min_size=%s"},
82 {Opt_err, NULL}, 84 {Opt_err, NULL},
83}; 85};
84 86
@@ -729,14 +731,38 @@ static const struct super_operations hugetlbfs_ops = {
729 .show_options = generic_show_options, 731 .show_options = generic_show_options,
730}; 732};
731 733
734enum { NO_SIZE, SIZE_STD, SIZE_PERCENT };
735
736/*
737 * Convert size option passed from command line to number of huge pages
738 * in the pool specified by hstate. Size option could be in bytes
739 * (val_type == SIZE_STD) or percentage of the pool (val_type == SIZE_PERCENT).
740 */
741static long long
742hugetlbfs_size_to_hpages(struct hstate *h, unsigned long long size_opt,
743 int val_type)
744{
745 if (val_type == NO_SIZE)
746 return -1;
747
748 if (val_type == SIZE_PERCENT) {
749 size_opt <<= huge_page_shift(h);
750 size_opt *= h->max_huge_pages;
751 do_div(size_opt, 100);
752 }
753
754 size_opt >>= huge_page_shift(h);
755 return size_opt;
756}
757
732static int 758static int
733hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig) 759hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
734{ 760{
735 char *p, *rest; 761 char *p, *rest;
736 substring_t args[MAX_OPT_ARGS]; 762 substring_t args[MAX_OPT_ARGS];
737 int option; 763 int option;
738 unsigned long long size = 0; 764 unsigned long long max_size_opt = 0, min_size_opt = 0;
739 enum { NO_SIZE, SIZE_STD, SIZE_PERCENT } setsize = NO_SIZE; 765 int max_val_type = NO_SIZE, min_val_type = NO_SIZE;
740 766
741 if (!options) 767 if (!options)
742 return 0; 768 return 0;
@@ -774,10 +800,10 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
774 /* memparse() will accept a K/M/G without a digit */ 800 /* memparse() will accept a K/M/G without a digit */
775 if (!isdigit(*args[0].from)) 801 if (!isdigit(*args[0].from))
776 goto bad_val; 802 goto bad_val;
777 size = memparse(args[0].from, &rest); 803 max_size_opt = memparse(args[0].from, &rest);
778 setsize = SIZE_STD; 804 max_val_type = SIZE_STD;
779 if (*rest == '%') 805 if (*rest == '%')
780 setsize = SIZE_PERCENT; 806 max_val_type = SIZE_PERCENT;
781 break; 807 break;
782 } 808 }
783 809
@@ -800,6 +826,17 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
800 break; 826 break;
801 } 827 }
802 828
829 case Opt_min_size: {
830 /* memparse() will accept a K/M/G without a digit */
831 if (!isdigit(*args[0].from))
832 goto bad_val;
833 min_size_opt = memparse(args[0].from, &rest);
834 min_val_type = SIZE_STD;
835 if (*rest == '%')
836 min_val_type = SIZE_PERCENT;
837 break;
838 }
839
803 default: 840 default:
804 pr_err("Bad mount option: \"%s\"\n", p); 841 pr_err("Bad mount option: \"%s\"\n", p);
805 return -EINVAL; 842 return -EINVAL;
@@ -807,15 +844,22 @@ hugetlbfs_parse_options(char *options, struct hugetlbfs_config *pconfig)
807 } 844 }
808 } 845 }
809 846
810 /* Do size after hstate is set up */ 847 /*
811 if (setsize > NO_SIZE) { 848 * Use huge page pool size (in hstate) to convert the size
812 struct hstate *h = pconfig->hstate; 849 * options to number of huge pages. If NO_SIZE, -1 is returned.
813 if (setsize == SIZE_PERCENT) { 850 */
814 size <<= huge_page_shift(h); 851 pconfig->max_hpages = hugetlbfs_size_to_hpages(pconfig->hstate,
815 size *= h->max_huge_pages; 852 max_size_opt, max_val_type);
816 do_div(size, 100); 853 pconfig->min_hpages = hugetlbfs_size_to_hpages(pconfig->hstate,
817 } 854 min_size_opt, min_val_type);
818 pconfig->nr_blocks = (size >> huge_page_shift(h)); 855
856 /*
857 * If max_size was specified, then min_size must be smaller
858 */
859 if (max_val_type > NO_SIZE &&
860 pconfig->min_hpages > pconfig->max_hpages) {
861 pr_err("minimum size can not be greater than maximum size\n");
862 return -EINVAL;
819 } 863 }
820 864
821 return 0; 865 return 0;
@@ -834,12 +878,13 @@ hugetlbfs_fill_super(struct super_block *sb, void *data, int silent)
834 878
835 save_mount_options(sb, data); 879 save_mount_options(sb, data);
836 880
837 config.nr_blocks = -1; /* No limit on size by default */ 881 config.max_hpages = -1; /* No limit on size by default */
838 config.nr_inodes = -1; /* No limit on number of inodes by default */ 882 config.nr_inodes = -1; /* No limit on number of inodes by default */
839 config.uid = current_fsuid(); 883 config.uid = current_fsuid();
840 config.gid = current_fsgid(); 884 config.gid = current_fsgid();
841 config.mode = 0755; 885 config.mode = 0755;
842 config.hstate = &default_hstate; 886 config.hstate = &default_hstate;
887 config.min_hpages = -1; /* No default minimum size */
843 ret = hugetlbfs_parse_options(data, &config); 888 ret = hugetlbfs_parse_options(data, &config);
844 if (ret) 889 if (ret)
845 return ret; 890 return ret;
@@ -853,8 +898,15 @@ hugetlbfs_fill_super(struct super_block *sb, void *data, int silent)
853 sbinfo->max_inodes = config.nr_inodes; 898 sbinfo->max_inodes = config.nr_inodes;
854 sbinfo->free_inodes = config.nr_inodes; 899 sbinfo->free_inodes = config.nr_inodes;
855 sbinfo->spool = NULL; 900 sbinfo->spool = NULL;
856 if (config.nr_blocks != -1) { 901 /*
857 sbinfo->spool = hugepage_new_subpool(config.nr_blocks); 902 * Allocate and initialize subpool if maximum or minimum size is
903 * specified. Any needed reservations (for minimim size) are taken
904 * taken when the subpool is created.
905 */
906 if (config.max_hpages != -1 || config.min_hpages != -1) {
907 sbinfo->spool = hugepage_new_subpool(config.hstate,
908 config.max_hpages,
909 config.min_hpages);
858 if (!sbinfo->spool) 910 if (!sbinfo->spool)
859 goto out_free; 911 goto out_free;
860 } 912 }
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 49ba7ff1bbb9..16a0922beb59 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -183,30 +183,23 @@ static inline void remove_metapage(struct page *page, struct metapage *mp)
183 183
184#endif 184#endif
185 185
186static void init_once(void *foo)
187{
188 struct metapage *mp = (struct metapage *)foo;
189
190 mp->lid = 0;
191 mp->lsn = 0;
192 mp->flag = 0;
193 mp->data = NULL;
194 mp->clsn = 0;
195 mp->log = NULL;
196 set_bit(META_free, &mp->flag);
197 init_waitqueue_head(&mp->wait);
198}
199
200static inline struct metapage *alloc_metapage(gfp_t gfp_mask) 186static inline struct metapage *alloc_metapage(gfp_t gfp_mask)
201{ 187{
202 return mempool_alloc(metapage_mempool, gfp_mask); 188 struct metapage *mp = mempool_alloc(metapage_mempool, gfp_mask);
189
190 if (mp) {
191 mp->lid = 0;
192 mp->lsn = 0;
193 mp->data = NULL;
194 mp->clsn = 0;
195 mp->log = NULL;
196 init_waitqueue_head(&mp->wait);
197 }
198 return mp;
203} 199}
204 200
205static inline void free_metapage(struct metapage *mp) 201static inline void free_metapage(struct metapage *mp)
206{ 202{
207 mp->flag = 0;
208 set_bit(META_free, &mp->flag);
209
210 mempool_free(mp, metapage_mempool); 203 mempool_free(mp, metapage_mempool);
211} 204}
212 205
@@ -216,7 +209,7 @@ int __init metapage_init(void)
216 * Allocate the metapage structures 209 * Allocate the metapage structures
217 */ 210 */
218 metapage_cache = kmem_cache_create("jfs_mp", sizeof(struct metapage), 211 metapage_cache = kmem_cache_create("jfs_mp", sizeof(struct metapage),
219 0, 0, init_once); 212 0, 0, NULL);
220 if (metapage_cache == NULL) 213 if (metapage_cache == NULL)
221 return -ENOMEM; 214 return -ENOMEM;
222 215
diff --git a/fs/jfs/jfs_metapage.h b/fs/jfs/jfs_metapage.h
index a78beda85f68..337e9e51ac06 100644
--- a/fs/jfs/jfs_metapage.h
+++ b/fs/jfs/jfs_metapage.h
@@ -48,7 +48,6 @@ struct metapage {
48 48
49/* metapage flag */ 49/* metapage flag */
50#define META_locked 0 50#define META_locked 0
51#define META_free 1
52#define META_dirty 2 51#define META_dirty 2
53#define META_sync 3 52#define META_sync 3
54#define META_discard 4 53#define META_discard 4
diff --git a/fs/nfs/Kconfig b/fs/nfs/Kconfig
index c7abc10279af..f31fd0dd92c6 100644
--- a/fs/nfs/Kconfig
+++ b/fs/nfs/Kconfig
@@ -1,6 +1,6 @@
1config NFS_FS 1config NFS_FS
2 tristate "NFS client support" 2 tristate "NFS client support"
3 depends on INET && FILE_LOCKING 3 depends on INET && FILE_LOCKING && MULTIUSER
4 select LOCKD 4 select LOCKD
5 select SUNRPC 5 select SUNRPC
6 select NFS_ACL_SUPPORT if NFS_V3_ACL 6 select NFS_ACL_SUPPORT if NFS_V3_ACL
diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig
index 683bf718aead..fc2d108f5272 100644
--- a/fs/nfsd/Kconfig
+++ b/fs/nfsd/Kconfig
@@ -6,6 +6,7 @@ config NFSD
6 select SUNRPC 6 select SUNRPC
7 select EXPORTFS 7 select EXPORTFS
8 select NFS_ACL_SUPPORT if NFSD_V2_ACL 8 select NFS_ACL_SUPPORT if NFSD_V2_ACL
9 depends on MULTIUSER
9 help 10 help
10 Choose Y here if you want to allow other computers to access 11 Choose Y here if you want to allow other computers to access
11 files residing on this system using Sun's Network File System 12 files residing on this system using Sun's Network File System
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 1295a00ca316..fd02a9ebfc30 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -99,8 +99,8 @@ static inline void task_name(struct seq_file *m, struct task_struct *p)
99 buf = m->buf + m->count; 99 buf = m->buf + m->count;
100 100
101 /* Ignore error for now */ 101 /* Ignore error for now */
102 string_escape_str(tcomm, &buf, m->size - m->count, 102 buf += string_escape_str(tcomm, buf, m->size - m->count,
103 ESCAPE_SPACE | ESCAPE_SPECIAL, "\n\\"); 103 ESCAPE_SPACE | ESCAPE_SPECIAL, "\n\\");
104 104
105 m->count = buf - m->buf; 105 m->count = buf - m->buf;
106 seq_putc(m, '\n'); 106 seq_putc(m, '\n');
@@ -188,6 +188,24 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
188 from_kgid_munged(user_ns, GROUP_AT(group_info, g))); 188 from_kgid_munged(user_ns, GROUP_AT(group_info, g)));
189 put_cred(cred); 189 put_cred(cred);
190 190
191#ifdef CONFIG_PID_NS
192 seq_puts(m, "\nNStgid:");
193 for (g = ns->level; g <= pid->level; g++)
194 seq_printf(m, "\t%d",
195 task_tgid_nr_ns(p, pid->numbers[g].ns));
196 seq_puts(m, "\nNSpid:");
197 for (g = ns->level; g <= pid->level; g++)
198 seq_printf(m, "\t%d",
199 task_pid_nr_ns(p, pid->numbers[g].ns));
200 seq_puts(m, "\nNSpgid:");
201 for (g = ns->level; g <= pid->level; g++)
202 seq_printf(m, "\t%d",
203 task_pgrp_nr_ns(p, pid->numbers[g].ns));
204 seq_puts(m, "\nNSsid:");
205 for (g = ns->level; g <= pid->level; g++)
206 seq_printf(m, "\t%d",
207 task_session_nr_ns(p, pid->numbers[g].ns));
208#endif
191 seq_putc(m, '\n'); 209 seq_putc(m, '\n');
192} 210}
193 211
@@ -614,7 +632,9 @@ static int children_seq_show(struct seq_file *seq, void *v)
614 pid_t pid; 632 pid_t pid;
615 633
616 pid = pid_nr_ns(v, inode->i_sb->s_fs_info); 634 pid = pid_nr_ns(v, inode->i_sb->s_fs_info);
617 return seq_printf(seq, "%d ", pid); 635 seq_printf(seq, "%d ", pid);
636
637 return 0;
618} 638}
619 639
620static void *children_seq_start(struct seq_file *seq, loff_t *pos) 640static void *children_seq_start(struct seq_file *seq, loff_t *pos)
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 3f3d7aeb0712..7a3b82f986dd 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -238,13 +238,15 @@ static int proc_pid_wchan(struct seq_file *m, struct pid_namespace *ns,
238 238
239 wchan = get_wchan(task); 239 wchan = get_wchan(task);
240 240
241 if (lookup_symbol_name(wchan, symname) < 0) 241 if (lookup_symbol_name(wchan, symname) < 0) {
242 if (!ptrace_may_access(task, PTRACE_MODE_READ)) 242 if (!ptrace_may_access(task, PTRACE_MODE_READ))
243 return 0; 243 return 0;
244 else 244 seq_printf(m, "%lu", wchan);
245 return seq_printf(m, "%lu", wchan); 245 } else {
246 else 246 seq_printf(m, "%s", symname);
247 return seq_printf(m, "%s", symname); 247 }
248
249 return 0;
248} 250}
249#endif /* CONFIG_KALLSYMS */ 251#endif /* CONFIG_KALLSYMS */
250 252
@@ -309,10 +311,12 @@ static int proc_pid_stack(struct seq_file *m, struct pid_namespace *ns,
309static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns, 311static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns,
310 struct pid *pid, struct task_struct *task) 312 struct pid *pid, struct task_struct *task)
311{ 313{
312 return seq_printf(m, "%llu %llu %lu\n", 314 seq_printf(m, "%llu %llu %lu\n",
313 (unsigned long long)task->se.sum_exec_runtime, 315 (unsigned long long)task->se.sum_exec_runtime,
314 (unsigned long long)task->sched_info.run_delay, 316 (unsigned long long)task->sched_info.run_delay,
315 task->sched_info.pcount); 317 task->sched_info.pcount);
318
319 return 0;
316} 320}
317#endif 321#endif
318 322
@@ -387,7 +391,9 @@ static int proc_oom_score(struct seq_file *m, struct pid_namespace *ns,
387 points = oom_badness(task, NULL, NULL, totalpages) * 391 points = oom_badness(task, NULL, NULL, totalpages) *
388 1000 / totalpages; 392 1000 / totalpages;
389 read_unlock(&tasklist_lock); 393 read_unlock(&tasklist_lock);
390 return seq_printf(m, "%lu\n", points); 394 seq_printf(m, "%lu\n", points);
395
396 return 0;
391} 397}
392 398
393struct limit_names { 399struct limit_names {
@@ -432,15 +438,15 @@ static int proc_pid_limits(struct seq_file *m, struct pid_namespace *ns,
432 * print the file header 438 * print the file header
433 */ 439 */
434 seq_printf(m, "%-25s %-20s %-20s %-10s\n", 440 seq_printf(m, "%-25s %-20s %-20s %-10s\n",
435 "Limit", "Soft Limit", "Hard Limit", "Units"); 441 "Limit", "Soft Limit", "Hard Limit", "Units");
436 442
437 for (i = 0; i < RLIM_NLIMITS; i++) { 443 for (i = 0; i < RLIM_NLIMITS; i++) {
438 if (rlim[i].rlim_cur == RLIM_INFINITY) 444 if (rlim[i].rlim_cur == RLIM_INFINITY)
439 seq_printf(m, "%-25s %-20s ", 445 seq_printf(m, "%-25s %-20s ",
440 lnames[i].name, "unlimited"); 446 lnames[i].name, "unlimited");
441 else 447 else
442 seq_printf(m, "%-25s %-20lu ", 448 seq_printf(m, "%-25s %-20lu ",
443 lnames[i].name, rlim[i].rlim_cur); 449 lnames[i].name, rlim[i].rlim_cur);
444 450
445 if (rlim[i].rlim_max == RLIM_INFINITY) 451 if (rlim[i].rlim_max == RLIM_INFINITY)
446 seq_printf(m, "%-20s ", "unlimited"); 452 seq_printf(m, "%-20s ", "unlimited");
@@ -462,7 +468,9 @@ static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns,
462{ 468{
463 long nr; 469 long nr;
464 unsigned long args[6], sp, pc; 470 unsigned long args[6], sp, pc;
465 int res = lock_trace(task); 471 int res;
472
473 res = lock_trace(task);
466 if (res) 474 if (res)
467 return res; 475 return res;
468 476
@@ -477,7 +485,8 @@ static int proc_pid_syscall(struct seq_file *m, struct pid_namespace *ns,
477 args[0], args[1], args[2], args[3], args[4], args[5], 485 args[0], args[1], args[2], args[3], args[4], args[5],
478 sp, pc); 486 sp, pc);
479 unlock_trace(task); 487 unlock_trace(task);
480 return res; 488
489 return 0;
481} 490}
482#endif /* CONFIG_HAVE_ARCH_TRACEHOOK */ 491#endif /* CONFIG_HAVE_ARCH_TRACEHOOK */
483 492
@@ -2002,12 +2011,13 @@ static int show_timer(struct seq_file *m, void *v)
2002 notify = timer->it_sigev_notify; 2011 notify = timer->it_sigev_notify;
2003 2012
2004 seq_printf(m, "ID: %d\n", timer->it_id); 2013 seq_printf(m, "ID: %d\n", timer->it_id);
2005 seq_printf(m, "signal: %d/%p\n", timer->sigq->info.si_signo, 2014 seq_printf(m, "signal: %d/%p\n",
2006 timer->sigq->info.si_value.sival_ptr); 2015 timer->sigq->info.si_signo,
2016 timer->sigq->info.si_value.sival_ptr);
2007 seq_printf(m, "notify: %s/%s.%d\n", 2017 seq_printf(m, "notify: %s/%s.%d\n",
2008 nstr[notify & ~SIGEV_THREAD_ID], 2018 nstr[notify & ~SIGEV_THREAD_ID],
2009 (notify & SIGEV_THREAD_ID) ? "tid" : "pid", 2019 (notify & SIGEV_THREAD_ID) ? "tid" : "pid",
2010 pid_nr_ns(timer->it_pid, tp->ns)); 2020 pid_nr_ns(timer->it_pid, tp->ns));
2011 seq_printf(m, "ClockID: %d\n", timer->it_clock); 2021 seq_printf(m, "ClockID: %d\n", timer->it_clock);
2012 2022
2013 return 0; 2023 return 0;
@@ -2352,21 +2362,23 @@ static int do_io_accounting(struct task_struct *task, struct seq_file *m, int wh
2352 2362
2353 unlock_task_sighand(task, &flags); 2363 unlock_task_sighand(task, &flags);
2354 } 2364 }
2355 result = seq_printf(m, 2365 seq_printf(m,
2356 "rchar: %llu\n" 2366 "rchar: %llu\n"
2357 "wchar: %llu\n" 2367 "wchar: %llu\n"
2358 "syscr: %llu\n" 2368 "syscr: %llu\n"
2359 "syscw: %llu\n" 2369 "syscw: %llu\n"
2360 "read_bytes: %llu\n" 2370 "read_bytes: %llu\n"
2361 "write_bytes: %llu\n" 2371 "write_bytes: %llu\n"
2362 "cancelled_write_bytes: %llu\n", 2372 "cancelled_write_bytes: %llu\n",
2363 (unsigned long long)acct.rchar, 2373 (unsigned long long)acct.rchar,
2364 (unsigned long long)acct.wchar, 2374 (unsigned long long)acct.wchar,
2365 (unsigned long long)acct.syscr, 2375 (unsigned long long)acct.syscr,
2366 (unsigned long long)acct.syscw, 2376 (unsigned long long)acct.syscw,
2367 (unsigned long long)acct.read_bytes, 2377 (unsigned long long)acct.read_bytes,
2368 (unsigned long long)acct.write_bytes, 2378 (unsigned long long)acct.write_bytes,
2369 (unsigned long long)acct.cancelled_write_bytes); 2379 (unsigned long long)acct.cancelled_write_bytes);
2380 result = 0;
2381
2370out_unlock: 2382out_unlock:
2371 mutex_unlock(&task->signal->cred_guard_mutex); 2383 mutex_unlock(&task->signal->cred_guard_mutex);
2372 return result; 2384 return result;
diff --git a/fs/splice.c b/fs/splice.c
index 41cbb16299e0..476024bb6546 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -523,6 +523,9 @@ ssize_t generic_file_splice_read(struct file *in, loff_t *ppos,
523 loff_t isize, left; 523 loff_t isize, left;
524 int ret; 524 int ret;
525 525
526 if (IS_DAX(in->f_mapping->host))
527 return default_file_splice_read(in, ppos, pipe, len, flags);
528
526 isize = i_size_read(in->f_mapping->host); 529 isize = i_size_read(in->f_mapping->host);
527 if (unlikely(*ppos >= isize)) 530 if (unlikely(*ppos >= isize))
528 return 0; 531 return 0;