aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/cell/spufs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/inode.c')
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 8079983ef9..13e4f70ec8 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -36,6 +36,7 @@
36#include <asm/prom.h> 36#include <asm/prom.h>
37#include <asm/semaphore.h> 37#include <asm/semaphore.h>
38#include <asm/spu.h> 38#include <asm/spu.h>
39#include <asm/spu_priv1.h>
39#include <asm/uaccess.h> 40#include <asm/uaccess.h>
40 41
41#include "spufs.h" 42#include "spufs.h"
@@ -54,6 +55,7 @@ spufs_alloc_inode(struct super_block *sb)
54 55
55 ei->i_gang = NULL; 56 ei->i_gang = NULL;
56 ei->i_ctx = NULL; 57 ei->i_ctx = NULL;
58 ei->i_openers = 0;
57 59
58 return &ei->vfs_inode; 60 return &ei->vfs_inode;
59} 61}
@@ -520,13 +522,14 @@ out:
520 522
521/* File system initialization */ 523/* File system initialization */
522enum { 524enum {
523 Opt_uid, Opt_gid, Opt_err, 525 Opt_uid, Opt_gid, Opt_mode, Opt_err,
524}; 526};
525 527
526static match_table_t spufs_tokens = { 528static match_table_t spufs_tokens = {
527 { Opt_uid, "uid=%d" }, 529 { Opt_uid, "uid=%d" },
528 { Opt_gid, "gid=%d" }, 530 { Opt_gid, "gid=%d" },
529 { Opt_err, NULL }, 531 { Opt_mode, "mode=%o" },
532 { Opt_err, NULL },
530}; 533};
531 534
532static int 535static int
@@ -553,6 +556,11 @@ spufs_parse_options(char *options, struct inode *root)
553 return 0; 556 return 0;
554 root->i_gid = option; 557 root->i_gid = option;
555 break; 558 break;
559 case Opt_mode:
560 if (match_octal(&args[0], &option))
561 return 0;
562 root->i_mode = option | S_IFDIR;
563 break;
556 default: 564 default:
557 return 0; 565 return 0;
558 } 566 }
@@ -560,6 +568,11 @@ spufs_parse_options(char *options, struct inode *root)
560 return 1; 568 return 1;
561} 569}
562 570
571static void spufs_exit_isolated_loader(void)
572{
573 kfree(isolated_loader);
574}
575
563static void 576static void
564spufs_init_isolated_loader(void) 577spufs_init_isolated_loader(void)
565{ 578{
@@ -571,7 +584,7 @@ spufs_init_isolated_loader(void)
571 if (!dn) 584 if (!dn)
572 return; 585 return;
573 586
574 loader = get_property(dn, "loader", &size); 587 loader = of_get_property(dn, "loader", &size);
575 if (!loader) 588 if (!loader)
576 return; 589 return;
577 590
@@ -653,6 +666,10 @@ static int __init spufs_init(void)
653{ 666{
654 int ret; 667 int ret;
655 668
669 ret = -ENODEV;
670 if (!spu_management_ops)
671 goto out;
672
656 ret = -ENOMEM; 673 ret = -ENOMEM;
657 spufs_inode_cache = kmem_cache_create("spufs_inode_cache", 674 spufs_inode_cache = kmem_cache_create("spufs_inode_cache",
658 sizeof(struct spufs_inode_info), 0, 675 sizeof(struct spufs_inode_info), 0,
@@ -660,25 +677,29 @@ static int __init spufs_init(void)
660 677
661 if (!spufs_inode_cache) 678 if (!spufs_inode_cache)
662 goto out; 679 goto out;
663 if (spu_sched_init() != 0) { 680 ret = spu_sched_init();
664 kmem_cache_destroy(spufs_inode_cache);
665 goto out;
666 }
667 ret = register_filesystem(&spufs_type);
668 if (ret) 681 if (ret)
669 goto out_cache; 682 goto out_cache;
683 ret = register_filesystem(&spufs_type);
684 if (ret)
685 goto out_sched;
670 ret = register_spu_syscalls(&spufs_calls); 686 ret = register_spu_syscalls(&spufs_calls);
671 if (ret) 687 if (ret)
672 goto out_fs; 688 goto out_fs;
673 ret = register_arch_coredump_calls(&spufs_coredump_calls); 689 ret = register_arch_coredump_calls(&spufs_coredump_calls);
674 if (ret) 690 if (ret)
675 goto out_fs; 691 goto out_syscalls;
676 692
677 spufs_init_isolated_loader(); 693 spufs_init_isolated_loader();
678 694
679 return 0; 695 return 0;
696
697out_syscalls:
698 unregister_spu_syscalls(&spufs_calls);
680out_fs: 699out_fs:
681 unregister_filesystem(&spufs_type); 700 unregister_filesystem(&spufs_type);
701out_sched:
702 spu_sched_exit();
682out_cache: 703out_cache:
683 kmem_cache_destroy(spufs_inode_cache); 704 kmem_cache_destroy(spufs_inode_cache);
684out: 705out:
@@ -689,6 +710,7 @@ module_init(spufs_init);
689static void __exit spufs_exit(void) 710static void __exit spufs_exit(void)
690{ 711{
691 spu_sched_exit(); 712 spu_sched_exit();
713 spufs_exit_isolated_loader();
692 unregister_arch_coredump_calls(&spufs_coredump_calls); 714 unregister_arch_coredump_calls(&spufs_coredump_calls);
693 unregister_spu_syscalls(&spufs_calls); 715 unregister_spu_syscalls(&spufs_calls);
694 unregister_filesystem(&spufs_type); 716 unregister_filesystem(&spufs_type);