diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-05 11:50:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-05 11:50:26 -0400 |
commit | 45d9a2220f6004b47c362cc7fc7cf9a73cb6353a (patch) | |
tree | 4e2217464c5cd71674a6ffff1f3dddaeb52556b7 /arch/s390 | |
parent | 2386a3b0fbb0c2dcf29694c7df9a72cb268458f0 (diff) | |
parent | 02afc27faec94c9e068517a22acf55400976c698 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile 1 from Al Viro:
"Unfortunately, this merge window it'll have a be a lot of small piles -
my fault, actually, for not keeping #for-next in anything that would
resemble a sane shape ;-/
This pile: assorted fixes (the first 3 are -stable fodder, IMO) and
cleanups + %pd/%pD formats (dentry/file pathname, up to 4 last
components) + several long-standing patches from various folks.
There definitely will be a lot more (starting with Miklos'
check_submount_and_drop() series)"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
direct-io: Handle O_(D)SYNC AIO
direct-io: Implement generic deferred AIO completions
add formats for dentry/file pathnames
kvm eventfd: switch to fdget
powerpc kvm: use fdget
switch fchmod() to fdget
switch epoll_ctl() to fdget
switch copy_module_from_fd() to fdget
git simplify nilfs check for busy subtree
ibmasmfs: don't bother passing superblock when not needed
don't pass superblock to hypfs_{mkdir,create*}
don't pass superblock to hypfs_diag_create_files
don't pass superblock to hypfs_vm_create_files()
oprofile: get rid of pointless forward declarations of struct super_block
oprofilefs_create_...() do not need superblock argument
oprofilefs_mkdir() doesn't need superblock argument
don't bother with passing superblock to oprofile_create_stats_files()
oprofile: don't bother with passing superblock to ->create_files()
don't bother passing sb to oprofile_create_files()
coh901318: don't open-code simple_read_from_buffer()
...
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/hypfs/hypfs.h | 13 | ||||
-rw-r--r-- | arch/s390/hypfs/hypfs_diag.c | 50 | ||||
-rw-r--r-- | arch/s390/hypfs/hypfs_vm.c | 65 | ||||
-rw-r--r-- | arch/s390/hypfs/inode.c | 36 | ||||
-rw-r--r-- | arch/s390/oprofile/init.c | 35 |
5 files changed, 93 insertions, 106 deletions
diff --git a/arch/s390/hypfs/hypfs.h b/arch/s390/hypfs/hypfs.h index f41e0ef7fdf9..79f2ac55253f 100644 --- a/arch/s390/hypfs/hypfs.h +++ b/arch/s390/hypfs/hypfs.h | |||
@@ -18,26 +18,23 @@ | |||
18 | #define UPDATE_FILE_MODE 0220 | 18 | #define UPDATE_FILE_MODE 0220 |
19 | #define DIR_MODE 0550 | 19 | #define DIR_MODE 0550 |
20 | 20 | ||
21 | extern struct dentry *hypfs_mkdir(struct super_block *sb, struct dentry *parent, | 21 | extern struct dentry *hypfs_mkdir(struct dentry *parent, const char *name); |
22 | const char *name); | ||
23 | 22 | ||
24 | extern struct dentry *hypfs_create_u64(struct super_block *sb, | 23 | extern struct dentry *hypfs_create_u64(struct dentry *dir, const char *name, |
25 | struct dentry *dir, const char *name, | ||
26 | __u64 value); | 24 | __u64 value); |
27 | 25 | ||
28 | extern struct dentry *hypfs_create_str(struct super_block *sb, | 26 | extern struct dentry *hypfs_create_str(struct dentry *dir, const char *name, |
29 | struct dentry *dir, const char *name, | ||
30 | char *string); | 27 | char *string); |
31 | 28 | ||
32 | /* LPAR Hypervisor */ | 29 | /* LPAR Hypervisor */ |
33 | extern int hypfs_diag_init(void); | 30 | extern int hypfs_diag_init(void); |
34 | extern void hypfs_diag_exit(void); | 31 | extern void hypfs_diag_exit(void); |
35 | extern int hypfs_diag_create_files(struct super_block *sb, struct dentry *root); | 32 | extern int hypfs_diag_create_files(struct dentry *root); |
36 | 33 | ||
37 | /* VM Hypervisor */ | 34 | /* VM Hypervisor */ |
38 | extern int hypfs_vm_init(void); | 35 | extern int hypfs_vm_init(void); |
39 | extern void hypfs_vm_exit(void); | 36 | extern void hypfs_vm_exit(void); |
40 | extern int hypfs_vm_create_files(struct super_block *sb, struct dentry *root); | 37 | extern int hypfs_vm_create_files(struct dentry *root); |
41 | 38 | ||
42 | /* debugfs interface */ | 39 | /* debugfs interface */ |
43 | struct hypfs_dbfs_file; | 40 | struct hypfs_dbfs_file; |
diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c index 138893e5f736..5eeffeefae06 100644 --- a/arch/s390/hypfs/hypfs_diag.c +++ b/arch/s390/hypfs/hypfs_diag.c | |||
@@ -623,8 +623,7 @@ void hypfs_diag_exit(void) | |||
623 | * ******************************************* | 623 | * ******************************************* |
624 | */ | 624 | */ |
625 | 625 | ||
626 | static int hypfs_create_cpu_files(struct super_block *sb, | 626 | static int hypfs_create_cpu_files(struct dentry *cpus_dir, void *cpu_info) |
627 | struct dentry *cpus_dir, void *cpu_info) | ||
628 | { | 627 | { |
629 | struct dentry *cpu_dir; | 628 | struct dentry *cpu_dir; |
630 | char buffer[TMP_SIZE]; | 629 | char buffer[TMP_SIZE]; |
@@ -632,30 +631,29 @@ static int hypfs_create_cpu_files(struct super_block *sb, | |||
632 | 631 | ||
633 | snprintf(buffer, TMP_SIZE, "%d", cpu_info__cpu_addr(diag204_info_type, | 632 | snprintf(buffer, TMP_SIZE, "%d", cpu_info__cpu_addr(diag204_info_type, |
634 | cpu_info)); | 633 | cpu_info)); |
635 | cpu_dir = hypfs_mkdir(sb, cpus_dir, buffer); | 634 | cpu_dir = hypfs_mkdir(cpus_dir, buffer); |
636 | rc = hypfs_create_u64(sb, cpu_dir, "mgmtime", | 635 | rc = hypfs_create_u64(cpu_dir, "mgmtime", |
637 | cpu_info__acc_time(diag204_info_type, cpu_info) - | 636 | cpu_info__acc_time(diag204_info_type, cpu_info) - |
638 | cpu_info__lp_time(diag204_info_type, cpu_info)); | 637 | cpu_info__lp_time(diag204_info_type, cpu_info)); |
639 | if (IS_ERR(rc)) | 638 | if (IS_ERR(rc)) |
640 | return PTR_ERR(rc); | 639 | return PTR_ERR(rc); |
641 | rc = hypfs_create_u64(sb, cpu_dir, "cputime", | 640 | rc = hypfs_create_u64(cpu_dir, "cputime", |
642 | cpu_info__lp_time(diag204_info_type, cpu_info)); | 641 | cpu_info__lp_time(diag204_info_type, cpu_info)); |
643 | if (IS_ERR(rc)) | 642 | if (IS_ERR(rc)) |
644 | return PTR_ERR(rc); | 643 | return PTR_ERR(rc); |
645 | if (diag204_info_type == INFO_EXT) { | 644 | if (diag204_info_type == INFO_EXT) { |
646 | rc = hypfs_create_u64(sb, cpu_dir, "onlinetime", | 645 | rc = hypfs_create_u64(cpu_dir, "onlinetime", |
647 | cpu_info__online_time(diag204_info_type, | 646 | cpu_info__online_time(diag204_info_type, |
648 | cpu_info)); | 647 | cpu_info)); |
649 | if (IS_ERR(rc)) | 648 | if (IS_ERR(rc)) |
650 | return PTR_ERR(rc); | 649 | return PTR_ERR(rc); |
651 | } | 650 | } |
652 | diag224_idx2name(cpu_info__ctidx(diag204_info_type, cpu_info), buffer); | 651 | diag224_idx2name(cpu_info__ctidx(diag204_info_type, cpu_info), buffer); |
653 | rc = hypfs_create_str(sb, cpu_dir, "type", buffer); | 652 | rc = hypfs_create_str(cpu_dir, "type", buffer); |
654 | return PTR_RET(rc); | 653 | return PTR_RET(rc); |
655 | } | 654 | } |
656 | 655 | ||
657 | static void *hypfs_create_lpar_files(struct super_block *sb, | 656 | static void *hypfs_create_lpar_files(struct dentry *systems_dir, void *part_hdr) |
658 | struct dentry *systems_dir, void *part_hdr) | ||
659 | { | 657 | { |
660 | struct dentry *cpus_dir; | 658 | struct dentry *cpus_dir; |
661 | struct dentry *lpar_dir; | 659 | struct dentry *lpar_dir; |
@@ -665,16 +663,16 @@ static void *hypfs_create_lpar_files(struct super_block *sb, | |||
665 | 663 | ||
666 | part_hdr__part_name(diag204_info_type, part_hdr, lpar_name); | 664 | part_hdr__part_name(diag204_info_type, part_hdr, lpar_name); |
667 | lpar_name[LPAR_NAME_LEN] = 0; | 665 | lpar_name[LPAR_NAME_LEN] = 0; |
668 | lpar_dir = hypfs_mkdir(sb, systems_dir, lpar_name); | 666 | lpar_dir = hypfs_mkdir(systems_dir, lpar_name); |
669 | if (IS_ERR(lpar_dir)) | 667 | if (IS_ERR(lpar_dir)) |
670 | return lpar_dir; | 668 | return lpar_dir; |
671 | cpus_dir = hypfs_mkdir(sb, lpar_dir, "cpus"); | 669 | cpus_dir = hypfs_mkdir(lpar_dir, "cpus"); |
672 | if (IS_ERR(cpus_dir)) | 670 | if (IS_ERR(cpus_dir)) |
673 | return cpus_dir; | 671 | return cpus_dir; |
674 | cpu_info = part_hdr + part_hdr__size(diag204_info_type); | 672 | cpu_info = part_hdr + part_hdr__size(diag204_info_type); |
675 | for (i = 0; i < part_hdr__rcpus(diag204_info_type, part_hdr); i++) { | 673 | for (i = 0; i < part_hdr__rcpus(diag204_info_type, part_hdr); i++) { |
676 | int rc; | 674 | int rc; |
677 | rc = hypfs_create_cpu_files(sb, cpus_dir, cpu_info); | 675 | rc = hypfs_create_cpu_files(cpus_dir, cpu_info); |
678 | if (rc) | 676 | if (rc) |
679 | return ERR_PTR(rc); | 677 | return ERR_PTR(rc); |
680 | cpu_info += cpu_info__size(diag204_info_type); | 678 | cpu_info += cpu_info__size(diag204_info_type); |
@@ -682,8 +680,7 @@ static void *hypfs_create_lpar_files(struct super_block *sb, | |||
682 | return cpu_info; | 680 | return cpu_info; |
683 | } | 681 | } |
684 | 682 | ||
685 | static int hypfs_create_phys_cpu_files(struct super_block *sb, | 683 | static int hypfs_create_phys_cpu_files(struct dentry *cpus_dir, void *cpu_info) |
686 | struct dentry *cpus_dir, void *cpu_info) | ||
687 | { | 684 | { |
688 | struct dentry *cpu_dir; | 685 | struct dentry *cpu_dir; |
689 | char buffer[TMP_SIZE]; | 686 | char buffer[TMP_SIZE]; |
@@ -691,32 +688,31 @@ static int hypfs_create_phys_cpu_files(struct super_block *sb, | |||
691 | 688 | ||
692 | snprintf(buffer, TMP_SIZE, "%i", phys_cpu__cpu_addr(diag204_info_type, | 689 | snprintf(buffer, TMP_SIZE, "%i", phys_cpu__cpu_addr(diag204_info_type, |
693 | cpu_info)); | 690 | cpu_info)); |
694 | cpu_dir = hypfs_mkdir(sb, cpus_dir, buffer); | 691 | cpu_dir = hypfs_mkdir(cpus_dir, buffer); |
695 | if (IS_ERR(cpu_dir)) | 692 | if (IS_ERR(cpu_dir)) |
696 | return PTR_ERR(cpu_dir); | 693 | return PTR_ERR(cpu_dir); |
697 | rc = hypfs_create_u64(sb, cpu_dir, "mgmtime", | 694 | rc = hypfs_create_u64(cpu_dir, "mgmtime", |
698 | phys_cpu__mgm_time(diag204_info_type, cpu_info)); | 695 | phys_cpu__mgm_time(diag204_info_type, cpu_info)); |
699 | if (IS_ERR(rc)) | 696 | if (IS_ERR(rc)) |
700 | return PTR_ERR(rc); | 697 | return PTR_ERR(rc); |
701 | diag224_idx2name(phys_cpu__ctidx(diag204_info_type, cpu_info), buffer); | 698 | diag224_idx2name(phys_cpu__ctidx(diag204_info_type, cpu_info), buffer); |
702 | rc = hypfs_create_str(sb, cpu_dir, "type", buffer); | 699 | rc = hypfs_create_str(cpu_dir, "type", buffer); |
703 | return PTR_RET(rc); | 700 | return PTR_RET(rc); |
704 | } | 701 | } |
705 | 702 | ||
706 | static void *hypfs_create_phys_files(struct super_block *sb, | 703 | static void *hypfs_create_phys_files(struct dentry *parent_dir, void *phys_hdr) |
707 | struct dentry *parent_dir, void *phys_hdr) | ||
708 | { | 704 | { |
709 | int i; | 705 | int i; |
710 | void *cpu_info; | 706 | void *cpu_info; |
711 | struct dentry *cpus_dir; | 707 | struct dentry *cpus_dir; |
712 | 708 | ||
713 | cpus_dir = hypfs_mkdir(sb, parent_dir, "cpus"); | 709 | cpus_dir = hypfs_mkdir(parent_dir, "cpus"); |
714 | if (IS_ERR(cpus_dir)) | 710 | if (IS_ERR(cpus_dir)) |
715 | return cpus_dir; | 711 | return cpus_dir; |
716 | cpu_info = phys_hdr + phys_hdr__size(diag204_info_type); | 712 | cpu_info = phys_hdr + phys_hdr__size(diag204_info_type); |
717 | for (i = 0; i < phys_hdr__cpus(diag204_info_type, phys_hdr); i++) { | 713 | for (i = 0; i < phys_hdr__cpus(diag204_info_type, phys_hdr); i++) { |
718 | int rc; | 714 | int rc; |
719 | rc = hypfs_create_phys_cpu_files(sb, cpus_dir, cpu_info); | 715 | rc = hypfs_create_phys_cpu_files(cpus_dir, cpu_info); |
720 | if (rc) | 716 | if (rc) |
721 | return ERR_PTR(rc); | 717 | return ERR_PTR(rc); |
722 | cpu_info += phys_cpu__size(diag204_info_type); | 718 | cpu_info += phys_cpu__size(diag204_info_type); |
@@ -724,7 +720,7 @@ static void *hypfs_create_phys_files(struct super_block *sb, | |||
724 | return cpu_info; | 720 | return cpu_info; |
725 | } | 721 | } |
726 | 722 | ||
727 | int hypfs_diag_create_files(struct super_block *sb, struct dentry *root) | 723 | int hypfs_diag_create_files(struct dentry *root) |
728 | { | 724 | { |
729 | struct dentry *systems_dir, *hyp_dir; | 725 | struct dentry *systems_dir, *hyp_dir; |
730 | void *time_hdr, *part_hdr; | 726 | void *time_hdr, *part_hdr; |
@@ -735,7 +731,7 @@ int hypfs_diag_create_files(struct super_block *sb, struct dentry *root) | |||
735 | if (IS_ERR(buffer)) | 731 | if (IS_ERR(buffer)) |
736 | return PTR_ERR(buffer); | 732 | return PTR_ERR(buffer); |
737 | 733 | ||
738 | systems_dir = hypfs_mkdir(sb, root, "systems"); | 734 | systems_dir = hypfs_mkdir(root, "systems"); |
739 | if (IS_ERR(systems_dir)) { | 735 | if (IS_ERR(systems_dir)) { |
740 | rc = PTR_ERR(systems_dir); | 736 | rc = PTR_ERR(systems_dir); |
741 | goto err_out; | 737 | goto err_out; |
@@ -743,25 +739,25 @@ int hypfs_diag_create_files(struct super_block *sb, struct dentry *root) | |||
743 | time_hdr = (struct x_info_blk_hdr *)buffer; | 739 | time_hdr = (struct x_info_blk_hdr *)buffer; |
744 | part_hdr = time_hdr + info_blk_hdr__size(diag204_info_type); | 740 | part_hdr = time_hdr + info_blk_hdr__size(diag204_info_type); |
745 | for (i = 0; i < info_blk_hdr__npar(diag204_info_type, time_hdr); i++) { | 741 | for (i = 0; i < info_blk_hdr__npar(diag204_info_type, time_hdr); i++) { |
746 | part_hdr = hypfs_create_lpar_files(sb, systems_dir, part_hdr); | 742 | part_hdr = hypfs_create_lpar_files(systems_dir, part_hdr); |
747 | if (IS_ERR(part_hdr)) { | 743 | if (IS_ERR(part_hdr)) { |
748 | rc = PTR_ERR(part_hdr); | 744 | rc = PTR_ERR(part_hdr); |
749 | goto err_out; | 745 | goto err_out; |
750 | } | 746 | } |
751 | } | 747 | } |
752 | if (info_blk_hdr__flags(diag204_info_type, time_hdr) & LPAR_PHYS_FLG) { | 748 | if (info_blk_hdr__flags(diag204_info_type, time_hdr) & LPAR_PHYS_FLG) { |
753 | ptr = hypfs_create_phys_files(sb, root, part_hdr); | 749 | ptr = hypfs_create_phys_files(root, part_hdr); |
754 | if (IS_ERR(ptr)) { | 750 | if (IS_ERR(ptr)) { |
755 | rc = PTR_ERR(ptr); | 751 | rc = PTR_ERR(ptr); |
756 | goto err_out; | 752 | goto err_out; |
757 | } | 753 | } |
758 | } | 754 | } |
759 | hyp_dir = hypfs_mkdir(sb, root, "hyp"); | 755 | hyp_dir = hypfs_mkdir(root, "hyp"); |
760 | if (IS_ERR(hyp_dir)) { | 756 | if (IS_ERR(hyp_dir)) { |
761 | rc = PTR_ERR(hyp_dir); | 757 | rc = PTR_ERR(hyp_dir); |
762 | goto err_out; | 758 | goto err_out; |
763 | } | 759 | } |
764 | ptr = hypfs_create_str(sb, hyp_dir, "type", "LPAR Hypervisor"); | 760 | ptr = hypfs_create_str(hyp_dir, "type", "LPAR Hypervisor"); |
765 | if (IS_ERR(ptr)) { | 761 | if (IS_ERR(ptr)) { |
766 | rc = PTR_ERR(ptr); | 762 | rc = PTR_ERR(ptr); |
767 | goto err_out; | 763 | goto err_out; |
diff --git a/arch/s390/hypfs/hypfs_vm.c b/arch/s390/hypfs/hypfs_vm.c index f364dcf77e8e..24908ce149f1 100644 --- a/arch/s390/hypfs/hypfs_vm.c +++ b/arch/s390/hypfs/hypfs_vm.c | |||
@@ -107,16 +107,15 @@ static void diag2fc_free(const void *data) | |||
107 | vfree(data); | 107 | vfree(data); |
108 | } | 108 | } |
109 | 109 | ||
110 | #define ATTRIBUTE(sb, dir, name, member) \ | 110 | #define ATTRIBUTE(dir, name, member) \ |
111 | do { \ | 111 | do { \ |
112 | void *rc; \ | 112 | void *rc; \ |
113 | rc = hypfs_create_u64(sb, dir, name, member); \ | 113 | rc = hypfs_create_u64(dir, name, member); \ |
114 | if (IS_ERR(rc)) \ | 114 | if (IS_ERR(rc)) \ |
115 | return PTR_ERR(rc); \ | 115 | return PTR_ERR(rc); \ |
116 | } while(0) | 116 | } while(0) |
117 | 117 | ||
118 | static int hpyfs_vm_create_guest(struct super_block *sb, | 118 | static int hpyfs_vm_create_guest(struct dentry *systems_dir, |
119 | struct dentry *systems_dir, | ||
120 | struct diag2fc_data *data) | 119 | struct diag2fc_data *data) |
121 | { | 120 | { |
122 | char guest_name[NAME_LEN + 1] = {}; | 121 | char guest_name[NAME_LEN + 1] = {}; |
@@ -130,46 +129,46 @@ static int hpyfs_vm_create_guest(struct super_block *sb, | |||
130 | memcpy(guest_name, data->guest_name, NAME_LEN); | 129 | memcpy(guest_name, data->guest_name, NAME_LEN); |
131 | EBCASC(guest_name, NAME_LEN); | 130 | EBCASC(guest_name, NAME_LEN); |
132 | strim(guest_name); | 131 | strim(guest_name); |
133 | guest_dir = hypfs_mkdir(sb, systems_dir, guest_name); | 132 | guest_dir = hypfs_mkdir(systems_dir, guest_name); |
134 | if (IS_ERR(guest_dir)) | 133 | if (IS_ERR(guest_dir)) |
135 | return PTR_ERR(guest_dir); | 134 | return PTR_ERR(guest_dir); |
136 | ATTRIBUTE(sb, guest_dir, "onlinetime_us", data->el_time); | 135 | ATTRIBUTE(guest_dir, "onlinetime_us", data->el_time); |
137 | 136 | ||
138 | /* logical cpu information */ | 137 | /* logical cpu information */ |
139 | cpus_dir = hypfs_mkdir(sb, guest_dir, "cpus"); | 138 | cpus_dir = hypfs_mkdir(guest_dir, "cpus"); |
140 | if (IS_ERR(cpus_dir)) | 139 | if (IS_ERR(cpus_dir)) |
141 | return PTR_ERR(cpus_dir); | 140 | return PTR_ERR(cpus_dir); |
142 | ATTRIBUTE(sb, cpus_dir, "cputime_us", data->used_cpu); | 141 | ATTRIBUTE(cpus_dir, "cputime_us", data->used_cpu); |
143 | ATTRIBUTE(sb, cpus_dir, "capped", capped_value); | 142 | ATTRIBUTE(cpus_dir, "capped", capped_value); |
144 | ATTRIBUTE(sb, cpus_dir, "dedicated", dedicated_flag); | 143 | ATTRIBUTE(cpus_dir, "dedicated", dedicated_flag); |
145 | ATTRIBUTE(sb, cpus_dir, "count", data->vcpus); | 144 | ATTRIBUTE(cpus_dir, "count", data->vcpus); |
146 | ATTRIBUTE(sb, cpus_dir, "weight_min", data->cpu_min); | 145 | ATTRIBUTE(cpus_dir, "weight_min", data->cpu_min); |
147 | ATTRIBUTE(sb, cpus_dir, "weight_max", data->cpu_max); | 146 | ATTRIBUTE(cpus_dir, "weight_max", data->cpu_max); |
148 | ATTRIBUTE(sb, cpus_dir, "weight_cur", data->cpu_shares); | 147 | ATTRIBUTE(cpus_dir, "weight_cur", data->cpu_shares); |
149 | 148 | ||
150 | /* memory information */ | 149 | /* memory information */ |
151 | mem_dir = hypfs_mkdir(sb, guest_dir, "mem"); | 150 | mem_dir = hypfs_mkdir(guest_dir, "mem"); |
152 | if (IS_ERR(mem_dir)) | 151 | if (IS_ERR(mem_dir)) |
153 | return PTR_ERR(mem_dir); | 152 | return PTR_ERR(mem_dir); |
154 | ATTRIBUTE(sb, mem_dir, "min_KiB", data->mem_min_kb); | 153 | ATTRIBUTE(mem_dir, "min_KiB", data->mem_min_kb); |
155 | ATTRIBUTE(sb, mem_dir, "max_KiB", data->mem_max_kb); | 154 | ATTRIBUTE(mem_dir, "max_KiB", data->mem_max_kb); |
156 | ATTRIBUTE(sb, mem_dir, "used_KiB", data->mem_used_kb); | 155 | ATTRIBUTE(mem_dir, "used_KiB", data->mem_used_kb); |
157 | ATTRIBUTE(sb, mem_dir, "share_KiB", data->mem_share_kb); | 156 | ATTRIBUTE(mem_dir, "share_KiB", data->mem_share_kb); |
158 | 157 | ||
159 | /* samples */ | 158 | /* samples */ |
160 | samples_dir = hypfs_mkdir(sb, guest_dir, "samples"); | 159 | samples_dir = hypfs_mkdir(guest_dir, "samples"); |
161 | if (IS_ERR(samples_dir)) | 160 | if (IS_ERR(samples_dir)) |
162 | return PTR_ERR(samples_dir); | 161 | return PTR_ERR(samples_dir); |
163 | ATTRIBUTE(sb, samples_dir, "cpu_using", data->cpu_use_samp); | 162 | ATTRIBUTE(samples_dir, "cpu_using", data->cpu_use_samp); |
164 | ATTRIBUTE(sb, samples_dir, "cpu_delay", data->cpu_delay_samp); | 163 | ATTRIBUTE(samples_dir, "cpu_delay", data->cpu_delay_samp); |
165 | ATTRIBUTE(sb, samples_dir, "mem_delay", data->page_wait_samp); | 164 | ATTRIBUTE(samples_dir, "mem_delay", data->page_wait_samp); |
166 | ATTRIBUTE(sb, samples_dir, "idle", data->idle_samp); | 165 | ATTRIBUTE(samples_dir, "idle", data->idle_samp); |
167 | ATTRIBUTE(sb, samples_dir, "other", data->other_samp); | 166 | ATTRIBUTE(samples_dir, "other", data->other_samp); |
168 | ATTRIBUTE(sb, samples_dir, "total", data->total_samp); | 167 | ATTRIBUTE(samples_dir, "total", data->total_samp); |
169 | return 0; | 168 | return 0; |
170 | } | 169 | } |
171 | 170 | ||
172 | int hypfs_vm_create_files(struct super_block *sb, struct dentry *root) | 171 | int hypfs_vm_create_files(struct dentry *root) |
173 | { | 172 | { |
174 | struct dentry *dir, *file; | 173 | struct dentry *dir, *file; |
175 | struct diag2fc_data *data; | 174 | struct diag2fc_data *data; |
@@ -181,38 +180,38 @@ int hypfs_vm_create_files(struct super_block *sb, struct dentry *root) | |||
181 | return PTR_ERR(data); | 180 | return PTR_ERR(data); |
182 | 181 | ||
183 | /* Hpervisor Info */ | 182 | /* Hpervisor Info */ |
184 | dir = hypfs_mkdir(sb, root, "hyp"); | 183 | dir = hypfs_mkdir(root, "hyp"); |
185 | if (IS_ERR(dir)) { | 184 | if (IS_ERR(dir)) { |
186 | rc = PTR_ERR(dir); | 185 | rc = PTR_ERR(dir); |
187 | goto failed; | 186 | goto failed; |
188 | } | 187 | } |
189 | file = hypfs_create_str(sb, dir, "type", "z/VM Hypervisor"); | 188 | file = hypfs_create_str(dir, "type", "z/VM Hypervisor"); |
190 | if (IS_ERR(file)) { | 189 | if (IS_ERR(file)) { |
191 | rc = PTR_ERR(file); | 190 | rc = PTR_ERR(file); |
192 | goto failed; | 191 | goto failed; |
193 | } | 192 | } |
194 | 193 | ||
195 | /* physical cpus */ | 194 | /* physical cpus */ |
196 | dir = hypfs_mkdir(sb, root, "cpus"); | 195 | dir = hypfs_mkdir(root, "cpus"); |
197 | if (IS_ERR(dir)) { | 196 | if (IS_ERR(dir)) { |
198 | rc = PTR_ERR(dir); | 197 | rc = PTR_ERR(dir); |
199 | goto failed; | 198 | goto failed; |
200 | } | 199 | } |
201 | file = hypfs_create_u64(sb, dir, "count", data->lcpus); | 200 | file = hypfs_create_u64(dir, "count", data->lcpus); |
202 | if (IS_ERR(file)) { | 201 | if (IS_ERR(file)) { |
203 | rc = PTR_ERR(file); | 202 | rc = PTR_ERR(file); |
204 | goto failed; | 203 | goto failed; |
205 | } | 204 | } |
206 | 205 | ||
207 | /* guests */ | 206 | /* guests */ |
208 | dir = hypfs_mkdir(sb, root, "systems"); | 207 | dir = hypfs_mkdir(root, "systems"); |
209 | if (IS_ERR(dir)) { | 208 | if (IS_ERR(dir)) { |
210 | rc = PTR_ERR(dir); | 209 | rc = PTR_ERR(dir); |
211 | goto failed; | 210 | goto failed; |
212 | } | 211 | } |
213 | 212 | ||
214 | for (i = 0; i < count; i++) { | 213 | for (i = 0; i < count; i++) { |
215 | rc = hpyfs_vm_create_guest(sb, dir, &(data[i])); | 214 | rc = hpyfs_vm_create_guest(dir, &(data[i])); |
216 | if (rc) | 215 | if (rc) |
217 | goto failed; | 216 | goto failed; |
218 | } | 217 | } |
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c index 7a539f4f5e30..ddfe09b45134 100644 --- a/arch/s390/hypfs/inode.c +++ b/arch/s390/hypfs/inode.c | |||
@@ -28,8 +28,7 @@ | |||
28 | #define HYPFS_MAGIC 0x687970 /* ASCII 'hyp' */ | 28 | #define HYPFS_MAGIC 0x687970 /* ASCII 'hyp' */ |
29 | #define TMP_SIZE 64 /* size of temporary buffers */ | 29 | #define TMP_SIZE 64 /* size of temporary buffers */ |
30 | 30 | ||
31 | static struct dentry *hypfs_create_update_file(struct super_block *sb, | 31 | static struct dentry *hypfs_create_update_file(struct dentry *dir); |
32 | struct dentry *dir); | ||
33 | 32 | ||
34 | struct hypfs_sb_info { | 33 | struct hypfs_sb_info { |
35 | kuid_t uid; /* uid used for files and dirs */ | 34 | kuid_t uid; /* uid used for files and dirs */ |
@@ -193,9 +192,9 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
193 | } | 192 | } |
194 | hypfs_delete_tree(sb->s_root); | 193 | hypfs_delete_tree(sb->s_root); |
195 | if (MACHINE_IS_VM) | 194 | if (MACHINE_IS_VM) |
196 | rc = hypfs_vm_create_files(sb, sb->s_root); | 195 | rc = hypfs_vm_create_files(sb->s_root); |
197 | else | 196 | else |
198 | rc = hypfs_diag_create_files(sb, sb->s_root); | 197 | rc = hypfs_diag_create_files(sb->s_root); |
199 | if (rc) { | 198 | if (rc) { |
200 | pr_err("Updating the hypfs tree failed\n"); | 199 | pr_err("Updating the hypfs tree failed\n"); |
201 | hypfs_delete_tree(sb->s_root); | 200 | hypfs_delete_tree(sb->s_root); |
@@ -302,12 +301,12 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent) | |||
302 | if (!root_dentry) | 301 | if (!root_dentry) |
303 | return -ENOMEM; | 302 | return -ENOMEM; |
304 | if (MACHINE_IS_VM) | 303 | if (MACHINE_IS_VM) |
305 | rc = hypfs_vm_create_files(sb, root_dentry); | 304 | rc = hypfs_vm_create_files(root_dentry); |
306 | else | 305 | else |
307 | rc = hypfs_diag_create_files(sb, root_dentry); | 306 | rc = hypfs_diag_create_files(root_dentry); |
308 | if (rc) | 307 | if (rc) |
309 | return rc; | 308 | return rc; |
310 | sbi->update_file = hypfs_create_update_file(sb, root_dentry); | 309 | sbi->update_file = hypfs_create_update_file(root_dentry); |
311 | if (IS_ERR(sbi->update_file)) | 310 | if (IS_ERR(sbi->update_file)) |
312 | return PTR_ERR(sbi->update_file); | 311 | return PTR_ERR(sbi->update_file); |
313 | hypfs_update_update(sb); | 312 | hypfs_update_update(sb); |
@@ -334,8 +333,7 @@ static void hypfs_kill_super(struct super_block *sb) | |||
334 | kill_litter_super(sb); | 333 | kill_litter_super(sb); |
335 | } | 334 | } |
336 | 335 | ||
337 | static struct dentry *hypfs_create_file(struct super_block *sb, | 336 | static struct dentry *hypfs_create_file(struct dentry *parent, const char *name, |
338 | struct dentry *parent, const char *name, | ||
339 | char *data, umode_t mode) | 337 | char *data, umode_t mode) |
340 | { | 338 | { |
341 | struct dentry *dentry; | 339 | struct dentry *dentry; |
@@ -347,7 +345,7 @@ static struct dentry *hypfs_create_file(struct super_block *sb, | |||
347 | dentry = ERR_PTR(-ENOMEM); | 345 | dentry = ERR_PTR(-ENOMEM); |
348 | goto fail; | 346 | goto fail; |
349 | } | 347 | } |
350 | inode = hypfs_make_inode(sb, mode); | 348 | inode = hypfs_make_inode(parent->d_sb, mode); |
351 | if (!inode) { | 349 | if (!inode) { |
352 | dput(dentry); | 350 | dput(dentry); |
353 | dentry = ERR_PTR(-ENOMEM); | 351 | dentry = ERR_PTR(-ENOMEM); |
@@ -373,24 +371,22 @@ fail: | |||
373 | return dentry; | 371 | return dentry; |
374 | } | 372 | } |
375 | 373 | ||
376 | struct dentry *hypfs_mkdir(struct super_block *sb, struct dentry *parent, | 374 | struct dentry *hypfs_mkdir(struct dentry *parent, const char *name) |
377 | const char *name) | ||
378 | { | 375 | { |
379 | struct dentry *dentry; | 376 | struct dentry *dentry; |
380 | 377 | ||
381 | dentry = hypfs_create_file(sb, parent, name, NULL, S_IFDIR | DIR_MODE); | 378 | dentry = hypfs_create_file(parent, name, NULL, S_IFDIR | DIR_MODE); |
382 | if (IS_ERR(dentry)) | 379 | if (IS_ERR(dentry)) |
383 | return dentry; | 380 | return dentry; |
384 | hypfs_add_dentry(dentry); | 381 | hypfs_add_dentry(dentry); |
385 | return dentry; | 382 | return dentry; |
386 | } | 383 | } |
387 | 384 | ||
388 | static struct dentry *hypfs_create_update_file(struct super_block *sb, | 385 | static struct dentry *hypfs_create_update_file(struct dentry *dir) |
389 | struct dentry *dir) | ||
390 | { | 386 | { |
391 | struct dentry *dentry; | 387 | struct dentry *dentry; |
392 | 388 | ||
393 | dentry = hypfs_create_file(sb, dir, "update", NULL, | 389 | dentry = hypfs_create_file(dir, "update", NULL, |
394 | S_IFREG | UPDATE_FILE_MODE); | 390 | S_IFREG | UPDATE_FILE_MODE); |
395 | /* | 391 | /* |
396 | * We do not put the update file on the 'delete' list with | 392 | * We do not put the update file on the 'delete' list with |
@@ -400,7 +396,7 @@ static struct dentry *hypfs_create_update_file(struct super_block *sb, | |||
400 | return dentry; | 396 | return dentry; |
401 | } | 397 | } |
402 | 398 | ||
403 | struct dentry *hypfs_create_u64(struct super_block *sb, struct dentry *dir, | 399 | struct dentry *hypfs_create_u64(struct dentry *dir, |
404 | const char *name, __u64 value) | 400 | const char *name, __u64 value) |
405 | { | 401 | { |
406 | char *buffer; | 402 | char *buffer; |
@@ -412,7 +408,7 @@ struct dentry *hypfs_create_u64(struct super_block *sb, struct dentry *dir, | |||
412 | if (!buffer) | 408 | if (!buffer) |
413 | return ERR_PTR(-ENOMEM); | 409 | return ERR_PTR(-ENOMEM); |
414 | dentry = | 410 | dentry = |
415 | hypfs_create_file(sb, dir, name, buffer, S_IFREG | REG_FILE_MODE); | 411 | hypfs_create_file(dir, name, buffer, S_IFREG | REG_FILE_MODE); |
416 | if (IS_ERR(dentry)) { | 412 | if (IS_ERR(dentry)) { |
417 | kfree(buffer); | 413 | kfree(buffer); |
418 | return ERR_PTR(-ENOMEM); | 414 | return ERR_PTR(-ENOMEM); |
@@ -421,7 +417,7 @@ struct dentry *hypfs_create_u64(struct super_block *sb, struct dentry *dir, | |||
421 | return dentry; | 417 | return dentry; |
422 | } | 418 | } |
423 | 419 | ||
424 | struct dentry *hypfs_create_str(struct super_block *sb, struct dentry *dir, | 420 | struct dentry *hypfs_create_str(struct dentry *dir, |
425 | const char *name, char *string) | 421 | const char *name, char *string) |
426 | { | 422 | { |
427 | char *buffer; | 423 | char *buffer; |
@@ -432,7 +428,7 @@ struct dentry *hypfs_create_str(struct super_block *sb, struct dentry *dir, | |||
432 | return ERR_PTR(-ENOMEM); | 428 | return ERR_PTR(-ENOMEM); |
433 | sprintf(buffer, "%s\n", string); | 429 | sprintf(buffer, "%s\n", string); |
434 | dentry = | 430 | dentry = |
435 | hypfs_create_file(sb, dir, name, buffer, S_IFREG | REG_FILE_MODE); | 431 | hypfs_create_file(dir, name, buffer, S_IFREG | REG_FILE_MODE); |
436 | if (IS_ERR(dentry)) { | 432 | if (IS_ERR(dentry)) { |
437 | kfree(buffer); | 433 | kfree(buffer); |
438 | return ERR_PTR(-ENOMEM); | 434 | return ERR_PTR(-ENOMEM); |
diff --git a/arch/s390/oprofile/init.c b/arch/s390/oprofile/init.c index 930783d2c99b..04e1b6a85362 100644 --- a/arch/s390/oprofile/init.c +++ b/arch/s390/oprofile/init.c | |||
@@ -346,16 +346,15 @@ static const struct file_operations timer_enabled_fops = { | |||
346 | }; | 346 | }; |
347 | 347 | ||
348 | 348 | ||
349 | static int oprofile_create_hwsampling_files(struct super_block *sb, | 349 | static int oprofile_create_hwsampling_files(struct dentry *root) |
350 | struct dentry *root) | ||
351 | { | 350 | { |
352 | struct dentry *dir; | 351 | struct dentry *dir; |
353 | 352 | ||
354 | dir = oprofilefs_mkdir(sb, root, "timer"); | 353 | dir = oprofilefs_mkdir(root, "timer"); |
355 | if (!dir) | 354 | if (!dir) |
356 | return -EINVAL; | 355 | return -EINVAL; |
357 | 356 | ||
358 | oprofilefs_create_file(sb, dir, "enabled", &timer_enabled_fops); | 357 | oprofilefs_create_file(dir, "enabled", &timer_enabled_fops); |
359 | 358 | ||
360 | if (!hwsampler_available) | 359 | if (!hwsampler_available) |
361 | return 0; | 360 | return 0; |
@@ -376,17 +375,17 @@ static int oprofile_create_hwsampling_files(struct super_block *sb, | |||
376 | * and can only be set to 0. | 375 | * and can only be set to 0. |
377 | */ | 376 | */ |
378 | 377 | ||
379 | dir = oprofilefs_mkdir(sb, root, "0"); | 378 | dir = oprofilefs_mkdir(root, "0"); |
380 | if (!dir) | 379 | if (!dir) |
381 | return -EINVAL; | 380 | return -EINVAL; |
382 | 381 | ||
383 | oprofilefs_create_file(sb, dir, "enabled", &hwsampler_fops); | 382 | oprofilefs_create_file(dir, "enabled", &hwsampler_fops); |
384 | oprofilefs_create_file(sb, dir, "event", &zero_fops); | 383 | oprofilefs_create_file(dir, "event", &zero_fops); |
385 | oprofilefs_create_file(sb, dir, "count", &hw_interval_fops); | 384 | oprofilefs_create_file(dir, "count", &hw_interval_fops); |
386 | oprofilefs_create_file(sb, dir, "unit_mask", &zero_fops); | 385 | oprofilefs_create_file(dir, "unit_mask", &zero_fops); |
387 | oprofilefs_create_file(sb, dir, "kernel", &kernel_fops); | 386 | oprofilefs_create_file(dir, "kernel", &kernel_fops); |
388 | oprofilefs_create_file(sb, dir, "user", &user_fops); | 387 | oprofilefs_create_file(dir, "user", &user_fops); |
389 | oprofilefs_create_ulong(sb, dir, "hw_sdbt_blocks", | 388 | oprofilefs_create_ulong(dir, "hw_sdbt_blocks", |
390 | &oprofile_sdbt_blocks); | 389 | &oprofile_sdbt_blocks); |
391 | 390 | ||
392 | } else { | 391 | } else { |
@@ -396,19 +395,19 @@ static int oprofile_create_hwsampling_files(struct super_block *sb, | |||
396 | * space tools. The /dev/oprofile/hwsampling fs is | 395 | * space tools. The /dev/oprofile/hwsampling fs is |
397 | * provided in that case. | 396 | * provided in that case. |
398 | */ | 397 | */ |
399 | dir = oprofilefs_mkdir(sb, root, "hwsampling"); | 398 | dir = oprofilefs_mkdir(root, "hwsampling"); |
400 | if (!dir) | 399 | if (!dir) |
401 | return -EINVAL; | 400 | return -EINVAL; |
402 | 401 | ||
403 | oprofilefs_create_file(sb, dir, "hwsampler", | 402 | oprofilefs_create_file(dir, "hwsampler", |
404 | &hwsampler_fops); | 403 | &hwsampler_fops); |
405 | oprofilefs_create_file(sb, dir, "hw_interval", | 404 | oprofilefs_create_file(dir, "hw_interval", |
406 | &hw_interval_fops); | 405 | &hw_interval_fops); |
407 | oprofilefs_create_ro_ulong(sb, dir, "hw_min_interval", | 406 | oprofilefs_create_ro_ulong(dir, "hw_min_interval", |
408 | &oprofile_min_interval); | 407 | &oprofile_min_interval); |
409 | oprofilefs_create_ro_ulong(sb, dir, "hw_max_interval", | 408 | oprofilefs_create_ro_ulong(dir, "hw_max_interval", |
410 | &oprofile_max_interval); | 409 | &oprofile_max_interval); |
411 | oprofilefs_create_ulong(sb, dir, "hw_sdbt_blocks", | 410 | oprofilefs_create_ulong(dir, "hw_sdbt_blocks", |
412 | &oprofile_sdbt_blocks); | 411 | &oprofile_sdbt_blocks); |
413 | } | 412 | } |
414 | return 0; | 413 | return 0; |