.. | .. |
---|
772 | 772 | } |
---|
773 | 773 | |
---|
774 | 774 | #define XREF_TMPHASH_SIZE (128) |
---|
775 | | -void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c) |
---|
| 775 | +int jffs2_build_xattr_subsystem(struct jffs2_sb_info *c) |
---|
776 | 776 | { |
---|
777 | 777 | struct jffs2_xattr_ref *ref, *_ref; |
---|
778 | | - struct jffs2_xattr_ref *xref_tmphash[XREF_TMPHASH_SIZE]; |
---|
| 778 | + struct jffs2_xattr_ref **xref_tmphash; |
---|
779 | 779 | struct jffs2_xattr_datum *xd, *_xd; |
---|
780 | 780 | struct jffs2_inode_cache *ic; |
---|
781 | 781 | struct jffs2_raw_node_ref *raw; |
---|
.. | .. |
---|
784 | 784 | |
---|
785 | 785 | BUG_ON(!(c->flags & JFFS2_SB_FLAG_BUILDING)); |
---|
786 | 786 | |
---|
| 787 | + xref_tmphash = kcalloc(XREF_TMPHASH_SIZE, |
---|
| 788 | + sizeof(struct jffs2_xattr_ref *), GFP_KERNEL); |
---|
| 789 | + if (!xref_tmphash) |
---|
| 790 | + return -ENOMEM; |
---|
| 791 | + |
---|
787 | 792 | /* Phase.1 : Merge same xref */ |
---|
788 | | - for (i=0; i < XREF_TMPHASH_SIZE; i++) |
---|
789 | | - xref_tmphash[i] = NULL; |
---|
790 | 793 | for (ref=c->xref_temp; ref; ref=_ref) { |
---|
791 | 794 | struct jffs2_xattr_ref *tmp; |
---|
792 | 795 | |
---|
.. | .. |
---|
884 | 887 | "%u of xref (%u dead, %u orphan) found.\n", |
---|
885 | 888 | xdatum_count, xdatum_unchecked_count, xdatum_orphan_count, |
---|
886 | 889 | xref_count, xref_dead_count, xref_orphan_count); |
---|
| 890 | + kfree(xref_tmphash); |
---|
| 891 | + return 0; |
---|
887 | 892 | } |
---|
888 | 893 | |
---|
889 | 894 | struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c, |
---|