aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/hypfs
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /arch/s390/hypfs
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/s390/hypfs')
-rw-r--r--arch/s390/hypfs/hypfs_diag.c9
-rw-r--r--arch/s390/hypfs/hypfs_vm.c2
-rw-r--r--arch/s390/hypfs/inode.c44
3 files changed, 19 insertions, 36 deletions
diff --git a/arch/s390/hypfs/hypfs_diag.c b/arch/s390/hypfs/hypfs_diag.c
index 77df726180ba..5b1acdba6495 100644
--- a/arch/s390/hypfs/hypfs_diag.c
+++ b/arch/s390/hypfs/hypfs_diag.c
@@ -12,7 +12,6 @@
12 12
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/errno.h> 14#include <linux/errno.h>
15#include <linux/gfp.h>
16#include <linux/slab.h> 15#include <linux/slab.h>
17#include <linux/string.h> 16#include <linux/string.h>
18#include <linux/vmalloc.h> 17#include <linux/vmalloc.h>
@@ -164,7 +163,7 @@ static inline void part_hdr__part_name(enum diag204_format type, void *hdr,
164 LPAR_NAME_LEN); 163 LPAR_NAME_LEN);
165 EBCASC(name, LPAR_NAME_LEN); 164 EBCASC(name, LPAR_NAME_LEN);
166 name[LPAR_NAME_LEN] = 0; 165 name[LPAR_NAME_LEN] = 0;
167 strstrip(name); 166 strim(name);
168} 167}
169 168
170struct cpu_info { 169struct cpu_info {
@@ -488,7 +487,7 @@ out:
488 487
489static int diag224(void *ptr) 488static int diag224(void *ptr)
490{ 489{
491 int rc = -ENOTSUPP; 490 int rc = -EOPNOTSUPP;
492 491
493 asm volatile( 492 asm volatile(
494 " diag %1,%2,0x224\n" 493 " diag %1,%2,0x224\n"
@@ -507,7 +506,7 @@ static int diag224_get_name_table(void)
507 return -ENOMEM; 506 return -ENOMEM;
508 if (diag224(diag224_cpu_names)) { 507 if (diag224(diag224_cpu_names)) {
509 kfree(diag224_cpu_names); 508 kfree(diag224_cpu_names);
510 return -ENOTSUPP; 509 return -EOPNOTSUPP;
511 } 510 }
512 EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16); 511 EBCASC(diag224_cpu_names + 16, (*diag224_cpu_names + 1) * 16);
513 return 0; 512 return 0;
@@ -523,7 +522,7 @@ static int diag224_idx2name(int index, char *name)
523 memcpy(name, diag224_cpu_names + ((index + 1) * CPU_NAME_LEN), 522 memcpy(name, diag224_cpu_names + ((index + 1) * CPU_NAME_LEN),
524 CPU_NAME_LEN); 523 CPU_NAME_LEN);
525 name[CPU_NAME_LEN] = 0; 524 name[CPU_NAME_LEN] = 0;
526 strstrip(name); 525 strim(name);
527 return 0; 526 return 0;
528} 527}
529 528
diff --git a/arch/s390/hypfs/hypfs_vm.c b/arch/s390/hypfs/hypfs_vm.c
index d01fc8f799f0..f0b0d31f0b48 100644
--- a/arch/s390/hypfs/hypfs_vm.c
+++ b/arch/s390/hypfs/hypfs_vm.c
@@ -124,7 +124,7 @@ static int hpyfs_vm_create_guest(struct super_block *sb,
124 /* guest dir */ 124 /* guest dir */
125 memcpy(guest_name, data->guest_name, NAME_LEN); 125 memcpy(guest_name, data->guest_name, NAME_LEN);
126 EBCASC(guest_name, NAME_LEN); 126 EBCASC(guest_name, NAME_LEN);
127 strstrip(guest_name); 127 strim(guest_name);
128 guest_dir = hypfs_mkdir(sb, systems_dir, guest_name); 128 guest_dir = hypfs_mkdir(sb, systems_dir, guest_name);
129 if (IS_ERR(guest_dir)) 129 if (IS_ERR(guest_dir))
130 return PTR_ERR(guest_dir); 130 return PTR_ERR(guest_dir);
diff --git a/arch/s390/hypfs/inode.c b/arch/s390/hypfs/inode.c
index 341aff2687a5..c53f8ac825ca 100644
--- a/arch/s390/hypfs/inode.c
+++ b/arch/s390/hypfs/inode.c
@@ -14,8 +14,8 @@
14#include <linux/fs.h> 14#include <linux/fs.h>
15#include <linux/namei.h> 15#include <linux/namei.h>
16#include <linux/vfs.h> 16#include <linux/vfs.h>
17#include <linux/slab.h>
17#include <linux/pagemap.h> 18#include <linux/pagemap.h>
18#include <linux/gfp.h>
19#include <linux/time.h> 19#include <linux/time.h>
20#include <linux/parser.h> 20#include <linux/parser.h>
21#include <linux/sysfs.h> 21#include <linux/sysfs.h>
@@ -288,46 +288,30 @@ static int hypfs_fill_super(struct super_block *sb, void *data, int silent)
288 sb->s_blocksize_bits = PAGE_CACHE_SHIFT; 288 sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
289 sb->s_magic = HYPFS_MAGIC; 289 sb->s_magic = HYPFS_MAGIC;
290 sb->s_op = &hypfs_s_ops; 290 sb->s_op = &hypfs_s_ops;
291 if (hypfs_parse_options(data, sb)) { 291 if (hypfs_parse_options(data, sb))
292 rc = -EINVAL; 292 return -EINVAL;
293 goto err_alloc;
294 }
295 root_inode = hypfs_make_inode(sb, S_IFDIR | 0755); 293 root_inode = hypfs_make_inode(sb, S_IFDIR | 0755);
296 if (!root_inode) { 294 if (!root_inode)
297 rc = -ENOMEM; 295 return -ENOMEM;
298 goto err_alloc;
299 }
300 root_inode->i_op = &simple_dir_inode_operations; 296 root_inode->i_op = &simple_dir_inode_operations;
301 root_inode->i_fop = &simple_dir_operations; 297 root_inode->i_fop = &simple_dir_operations;
302 root_dentry = d_alloc_root(root_inode); 298 sb->s_root = root_dentry = d_alloc_root(root_inode);
303 if (!root_dentry) { 299 if (!root_dentry) {
304 iput(root_inode); 300 iput(root_inode);
305 rc = -ENOMEM; 301 return -ENOMEM;
306 goto err_alloc;
307 } 302 }
308 if (MACHINE_IS_VM) 303 if (MACHINE_IS_VM)
309 rc = hypfs_vm_create_files(sb, root_dentry); 304 rc = hypfs_vm_create_files(sb, root_dentry);
310 else 305 else
311 rc = hypfs_diag_create_files(sb, root_dentry); 306 rc = hypfs_diag_create_files(sb, root_dentry);
312 if (rc) 307 if (rc)
313 goto err_tree; 308 return rc;
314 sbi->update_file = hypfs_create_update_file(sb, root_dentry); 309 sbi->update_file = hypfs_create_update_file(sb, root_dentry);
315 if (IS_ERR(sbi->update_file)) { 310 if (IS_ERR(sbi->update_file))
316 rc = PTR_ERR(sbi->update_file); 311 return PTR_ERR(sbi->update_file);
317 goto err_tree;
318 }
319 hypfs_update_update(sb); 312 hypfs_update_update(sb);
320 sb->s_root = root_dentry;
321 pr_info("Hypervisor filesystem mounted\n"); 313 pr_info("Hypervisor filesystem mounted\n");
322 return 0; 314 return 0;
323
324err_tree:
325 hypfs_delete_tree(root_dentry);
326 d_genocide(root_dentry);
327 dput(root_dentry);
328err_alloc:
329 kfree(sbi);
330 return rc;
331} 315}
332 316
333static int hypfs_get_super(struct file_system_type *fst, int flags, 317static int hypfs_get_super(struct file_system_type *fst, int flags,
@@ -340,12 +324,12 @@ static void hypfs_kill_super(struct super_block *sb)
340{ 324{
341 struct hypfs_sb_info *sb_info = sb->s_fs_info; 325 struct hypfs_sb_info *sb_info = sb->s_fs_info;
342 326
343 if (sb->s_root) { 327 if (sb->s_root)
344 hypfs_delete_tree(sb->s_root); 328 hypfs_delete_tree(sb->s_root);
329 if (sb_info->update_file)
345 hypfs_remove(sb_info->update_file); 330 hypfs_remove(sb_info->update_file);
346 kfree(sb->s_fs_info); 331 kfree(sb->s_fs_info);
347 sb->s_fs_info = NULL; 332 sb->s_fs_info = NULL;
348 }
349 kill_litter_super(sb); 333 kill_litter_super(sb);
350} 334}
351 335