aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-07-19 09:03:49 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-09-03 22:52:48 -0400
commitf78e41e3faca3f8c52a1eadbdd6ae547ae771046 (patch)
tree14d20c550b0327f117ba8a80142351a077a7936d /arch/s390
parent2b2fee80a7058959a6a9ba8706b3af5589b286d3 (diff)
don't pass superblock to hypfs_vm_create_files()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/hypfs/hypfs.h2
-rw-r--r--arch/s390/hypfs/hypfs_vm.c65
-rw-r--r--arch/s390/hypfs/inode.c4
3 files changed, 35 insertions, 36 deletions
diff --git a/arch/s390/hypfs/hypfs.h b/arch/s390/hypfs/hypfs.h
index f41e0ef7fdf9..41a57ceda928 100644
--- a/arch/s390/hypfs/hypfs.h
+++ b/arch/s390/hypfs/hypfs.h
@@ -37,7 +37,7 @@ extern int hypfs_diag_create_files(struct super_block *sb, struct dentry *root);
37/* VM Hypervisor */ 37/* VM Hypervisor */
38extern int hypfs_vm_init(void); 38extern int hypfs_vm_init(void);
39extern void hypfs_vm_exit(void); 39extern void hypfs_vm_exit(void);
40extern int hypfs_vm_create_files(struct super_block *sb, struct dentry *root); 40extern int hypfs_vm_create_files(struct dentry *root);
41 41
42/* debugfs interface */ 42/* debugfs interface */
43struct hypfs_dbfs_file; 43struct hypfs_dbfs_file;
diff --git a/arch/s390/hypfs/hypfs_vm.c b/arch/s390/hypfs/hypfs_vm.c
index f364dcf77e8e..a7c5b57663e5 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) \
111do { \ 111do { \
112 void *rc; \ 112 void *rc; \
113 rc = hypfs_create_u64(sb, dir, name, member); \ 113 rc = hypfs_create_u64(dir->d_sb, 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
118static int hpyfs_vm_create_guest(struct super_block *sb, 118static 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->d_sb, 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->d_sb, 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->d_sb, 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->d_sb, 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
172int hypfs_vm_create_files(struct super_block *sb, struct dentry *root) 171int 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->d_sb, 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(root->d_sb, 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->d_sb, 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(root->d_sb, 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->d_sb, 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..70627216ab66 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -193,7 +193,7 @@ static ssize_t hypfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
193 } 193 }
194 hypfs_delete_tree(sb->s_root); 194 hypfs_delete_tree(sb->s_root);
195 if (MACHINE_IS_VM) 195 if (MACHINE_IS_VM)
196 rc = hypfs_vm_create_files(sb, sb->s_root); 196 rc = hypfs_vm_create_files(sb->s_root);
197 else 197 else
198 rc = hypfs_diag_create_files(sb, sb->s_root); 198 rc = hypfs_diag_create_files(sb, sb->s_root);
199 if (rc) { 199 if (rc) {
@@ -302,7 +302,7 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
302 if (!root_dentry) 302 if (!root_dentry)
303 return -ENOMEM; 303 return -ENOMEM;
304 if (MACHINE_IS_VM) 304 if (MACHINE_IS_VM)
305 rc = hypfs_vm_create_files(sb, root_dentry); 305 rc = hypfs_vm_create_files(root_dentry);
306 else 306 else
307 rc = hypfs_diag_create_files(sb, root_dentry); 307 rc = hypfs_diag_create_files(sb, root_dentry);
308 if (rc) 308 if (rc)