diff --git a/fs/jffs2/Makefile b/fs/jffs2/Makefile index 7f28ee0..3f51c0d 100644 --- a/fs/jffs2/Makefile +++ b/fs/jffs2/Makefile @@ -6,6 +6,7 @@ # obj-$(CONFIG_JFFS2_FS) += jffs2.o +ifndef ALL_IN_ONE jffs2-y := compr.o dir.o file.o ioctl.o nodelist.o malloc.o jffs2-y += read.o nodemgmt.o readinode.o write.o scan.o gc.o jffs2-y += symlink.o build.o erase.o background.o fs.o writev.o @@ -19,3 +20,4 @@ jffs2-$(CONFIG_JFFS2_RUBIN) += compr_rub jffs2-$(CONFIG_JFFS2_RTIME) += compr_rtime.o jffs2-$(CONFIG_JFFS2_ZLIB) += compr_zlib.o jffs2-$(CONFIG_JFFS2_SUMMARY) += summary.o +endif diff --git a/fs/jffs2/acl.c b/fs/jffs2/acl.c index 320dd48..f7ed3b3 100644 --- a/fs/jffs2/acl.c +++ b/fs/jffs2/acl.c @@ -298,12 +298,12 @@ static int jffs2_check_acl(struct inode return -EAGAIN; } -int jffs2_permission(struct inode *inode, int mask, struct nameidata *nd) +objstatic int jffs2_permission(struct inode *inode, int mask, struct nameidata *nd) { return generic_permission(inode, mask, jffs2_check_acl); } -int jffs2_init_acl(struct inode *inode, struct inode *dir) +objstatic int jffs2_init_acl(struct inode *inode, struct inode *dir) { struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); struct posix_acl *acl = NULL, *clone; @@ -343,7 +343,7 @@ int jffs2_init_acl(struct inode *inode, return rc; } -void jffs2_clear_acl(struct inode *inode) +objstatic void jffs2_clear_acl(struct inode *inode) { struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); @@ -357,7 +357,7 @@ void jffs2_clear_acl(struct inode *inode } } -int jffs2_acl_chmod(struct inode *inode) +objstatic int jffs2_acl_chmod(struct inode *inode) { struct posix_acl *acl, *clone; int rc; diff --git a/fs/jffs2/acl.h b/fs/jffs2/acl.h index 8893bd1..ba3e2ed 100644 --- a/fs/jffs2/acl.h +++ b/fs/jffs2/acl.h @@ -27,10 +27,10 @@ #ifdef CONFIG_JFFS2_FS_POSIX_ACL #define JFFS2_ACL_NOT_CACHED ((void *)-1) -extern int jffs2_permission(struct inode *, int, struct nameidata *); -extern int jffs2_acl_chmod(struct inode *); -extern int jffs2_init_acl(struct inode *, struct inode *); -extern void jffs2_clear_acl(struct inode *); +objstatic int jffs2_permission(struct inode *, int, struct nameidata *); +objstatic int jffs2_acl_chmod(struct inode *); +objstatic int jffs2_init_acl(struct inode *, struct inode *); +objstatic void jffs2_clear_acl(struct inode *); extern struct xattr_handler jffs2_acl_access_xattr_handler; extern struct xattr_handler jffs2_acl_default_xattr_handler; diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c index ff2a872..0bf0655 100644 --- a/fs/jffs2/background.c +++ b/fs/jffs2/background.c @@ -21,7 +21,7 @@ #include "nodelist.h" static int jffs2_garbage_collect_thread(void *); -void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c) +objstatic void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c) { spin_lock(&c->erase_completion_lock); if (c->gc_task && jffs2_thread_should_wake(c)) @@ -30,7 +30,7 @@ void jffs2_garbage_collect_trigger(struc } /* This must only ever be called when no GC thread is currently running */ -int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c) +objstatic int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c) { pid_t pid; int ret = 0; @@ -54,7 +54,7 @@ int jffs2_start_garbage_collect_thread(s return ret; } -void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c) +objstatic void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c) { int wait = 0; spin_lock(&c->erase_completion_lock); diff --git a/fs/jffs2/build.c b/fs/jffs2/build.c index 0282696..c1a2fba 100644 --- a/fs/jffs2/build.c +++ b/fs/jffs2/build.c @@ -307,7 +307,7 @@ static void jffs2_calc_trigger_levels(st c->nospc_dirty_size); } -int jffs2_do_mount_fs(struct jffs2_sb_info *c) +objstatic int jffs2_do_mount_fs(struct jffs2_sb_info *c) { int ret; int i; diff --git a/fs/jffs2/compr.c b/fs/jffs2/compr.c index 5f45e01..9f90173 100644 --- a/fs/jffs2/compr.c +++ b/fs/jffs2/compr.c @@ -44,7 +44,7 @@ static uint32_t none_stat_compr_blocks=0 * jffs2_compress should compress as much as will fit, and should set * *datalen accordingly to show the amount of data which were compressed. */ -uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, unsigned char *data_in, unsigned char **cpage_out, uint32_t *datalen, uint32_t *cdatalen) { @@ -163,7 +163,7 @@ uint16_t jffs2_compress(struct jffs2_sb_ return ret; } -int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint16_t comprtype, unsigned char *cdata_in, unsigned char *data_out, uint32_t cdatalen, uint32_t datalen) { @@ -210,7 +210,7 @@ int jffs2_decompress(struct jffs2_sb_inf return 0; } -int jffs2_register_compressor(struct jffs2_compressor *comp) +objstatic int jffs2_register_compressor(struct jffs2_compressor *comp) { struct jffs2_compressor *this; @@ -246,7 +246,7 @@ out: return 0; } -int jffs2_unregister_compressor(struct jffs2_compressor *comp) +objstatic int jffs2_unregister_compressor(struct jffs2_compressor *comp) { D2(struct jffs2_compressor *this;) @@ -272,7 +272,7 @@ #ifdef CONFIG_JFFS2_PROC #define JFFS2_STAT_BUF_SIZE 16000 -char *jffs2_list_compressors(void) +objstatic char *jffs2_list_compressors(void) { struct jffs2_compressor *this; char *buf, *act_buf; @@ -289,7 +289,7 @@ char *jffs2_list_compressors(void) return buf; } -char *jffs2_stats(void) +objstatic char *jffs2_stats(void) { struct jffs2_compressor *this; char *buf, *act_buf; @@ -317,7 +317,7 @@ char *jffs2_stats(void) return buf; } -char *jffs2_get_compression_mode_name(void) +objstatic char *jffs2_get_compression_mode_name(void) { switch (jffs2_compression_mode) { case JFFS2_COMPR_MODE_NONE: @@ -330,7 +330,7 @@ char *jffs2_get_compression_mode_name(vo return "unkown"; } -int jffs2_set_compression_mode_name(const char *name) +objstatic int jffs2_set_compression_mode_name(const char *name) { if (!strcmp("none",name)) { jffs2_compression_mode = JFFS2_COMPR_MODE_NONE; @@ -363,17 +363,17 @@ static int jffs2_compressor_Xable(const return 1; } -int jffs2_enable_compressor_name(const char *name) +objstatic int jffs2_enable_compressor_name(const char *name) { return jffs2_compressor_Xable(name, 0); } -int jffs2_disable_compressor_name(const char *name) +objstatic int jffs2_disable_compressor_name(const char *name) { return jffs2_compressor_Xable(name, 1); } -int jffs2_set_compressor_priority(const char *name, int priority) +objstatic int jffs2_set_compressor_priority(const char *name, int priority) { struct jffs2_compressor *this,*comp; spin_lock(&jffs2_compressor_list_lock); @@ -406,13 +406,13 @@ reinsert: #endif -void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig) +objstatic void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig) { if (orig != comprbuf) kfree(comprbuf); } -int __init jffs2_compressors_init(void) +objstatic int __init jffs2_compressors_init(void) { /* Registering compressors */ #ifdef CONFIG_JFFS2_ZLIB @@ -440,7 +440,7 @@ #endif return 0; } -int __exit jffs2_compressors_exit(void) +objstatic int __exit jffs2_compressors_exit(void) { /* Unregistering compressors */ #ifdef CONFIG_JFFS2_RUBIN diff --git a/fs/jffs2/compr.h b/fs/jffs2/compr.h index 509b8b1..276dccb 100644 --- a/fs/jffs2/compr.h +++ b/fs/jffs2/compr.h @@ -60,48 +60,48 @@ struct jffs2_compressor { uint32_t stat_decompr_blocks; }; -int jffs2_register_compressor(struct jffs2_compressor *comp); -int jffs2_unregister_compressor(struct jffs2_compressor *comp); +objstatic int jffs2_register_compressor(struct jffs2_compressor *comp); +objstatic int jffs2_unregister_compressor(struct jffs2_compressor *comp); -int jffs2_compressors_init(void); -int jffs2_compressors_exit(void); +objstatic int jffs2_compressors_init(void); +objstatic int jffs2_compressors_exit(void); -uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic uint16_t jffs2_compress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, unsigned char *data_in, unsigned char **cpage_out, uint32_t *datalen, uint32_t *cdatalen); -int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_decompress(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint16_t comprtype, unsigned char *cdata_in, unsigned char *data_out, uint32_t cdatalen, uint32_t datalen); -void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig); +objstatic void jffs2_free_comprbuf(unsigned char *comprbuf, unsigned char *orig); #ifdef CONFIG_JFFS2_PROC -int jffs2_enable_compressor_name(const char *name); -int jffs2_disable_compressor_name(const char *name); -int jffs2_set_compression_mode_name(const char *mode_name); -char *jffs2_get_compression_mode_name(void); -int jffs2_set_compressor_priority(const char *mode_name, int priority); -char *jffs2_list_compressors(void); -char *jffs2_stats(void); +objstatic int jffs2_enable_compressor_name(const char *name); +objstatic int jffs2_disable_compressor_name(const char *name); +objstatic int jffs2_set_compression_mode_name(const char *mode_name); +objstatic char *jffs2_get_compression_mode_name(void); +objstatic int jffs2_set_compressor_priority(const char *mode_name, int priority); +objstatic char *jffs2_list_compressors(void); +objstatic char *jffs2_stats(void); #endif /* Compressor modules */ /* These functions will be called by jffs2_compressors_init/exit */ #ifdef CONFIG_JFFS2_RUBIN -int jffs2_rubinmips_init(void); -void jffs2_rubinmips_exit(void); -int jffs2_dynrubin_init(void); -void jffs2_dynrubin_exit(void); +objstatic int jffs2_rubinmips_init(void); +objstatic void jffs2_rubinmips_exit(void); +objstatic int jffs2_dynrubin_init(void); +objstatic void jffs2_dynrubin_exit(void); #endif #ifdef CONFIG_JFFS2_RTIME -int jffs2_rtime_init(void); -void jffs2_rtime_exit(void); +objstatic int jffs2_rtime_init(void); +objstatic void jffs2_rtime_exit(void); #endif #ifdef CONFIG_JFFS2_ZLIB -int jffs2_zlib_init(void); -void jffs2_zlib_exit(void); +objstatic int jffs2_zlib_init(void); +objstatic void jffs2_zlib_exit(void); #endif #endif /* __JFFS2_COMPR_H__ */ diff --git a/fs/jffs2/compr_rtime.c b/fs/jffs2/compr_rtime.c index 2eb1b74..162a754 100644 --- a/fs/jffs2/compr_rtime.c +++ b/fs/jffs2/compr_rtime.c @@ -121,12 +121,12 @@ #else #endif }; -int jffs2_rtime_init(void) +objstatic int jffs2_rtime_init(void) { return jffs2_register_compressor(&jffs2_rtime_comp); } -void jffs2_rtime_exit(void) +objstatic void jffs2_rtime_exit(void) { jffs2_unregister_compressor(&jffs2_rtime_comp); } diff --git a/fs/jffs2/compr_rubin.c b/fs/jffs2/compr_rubin.c index e792e67..f60d418 100644 --- a/fs/jffs2/compr_rubin.c +++ b/fs/jffs2/compr_rubin.c @@ -221,7 +221,7 @@ static int rubin_do_compress(int bit_div } #if 0 /* _compress returns the compressed size, -1 if bigger */ -int jffs2_rubinmips_compress(unsigned char *data_in, unsigned char *cpage_out, +objstatic int jffs2_rubinmips_compress(unsigned char *data_in, unsigned char *cpage_out, uint32_t *sourcelen, uint32_t *dstlen, void *model) { return rubin_do_compress(BIT_DIVIDER_MIPS, bits_mips, data_in, cpage_out, sourcelen, dstlen); @@ -344,12 +344,12 @@ #else #endif }; -int jffs2_rubinmips_init(void) +objstatic int jffs2_rubinmips_init(void) { return jffs2_register_compressor(&jffs2_rubinmips_comp); } -void jffs2_rubinmips_exit(void) +objstatic void jffs2_rubinmips_exit(void) { jffs2_unregister_compressor(&jffs2_rubinmips_comp); } @@ -367,12 +367,12 @@ #else #endif }; -int jffs2_dynrubin_init(void) +objstatic int jffs2_dynrubin_init(void) { return jffs2_register_compressor(&jffs2_dynrubin_comp); } -void jffs2_dynrubin_exit(void) +objstatic void jffs2_dynrubin_exit(void) { jffs2_unregister_compressor(&jffs2_dynrubin_comp); } diff --git a/fs/jffs2/compr_zlib.c b/fs/jffs2/compr_zlib.c index d43cbac..96cd3b9 100644 --- a/fs/jffs2/compr_zlib.c +++ b/fs/jffs2/compr_zlib.c @@ -201,7 +201,7 @@ #else #endif }; -int __init jffs2_zlib_init(void) +objstatic int __init jffs2_zlib_init(void) { int ret; @@ -216,7 +216,7 @@ int __init jffs2_zlib_init(void) return ret; } -void __exit jffs2_zlib_exit(void) +objstatic void __exit jffs2_zlib_exit(void) { jffs2_unregister_compressor(&jffs2_zlib_comp); free_workspaces(); diff --git a/fs/jffs2/comprtest.c b/fs/jffs2/comprtest.c index f0fb8be..ba1ba5d 100644 --- a/fs/jffs2/comprtest.c +++ b/fs/jffs2/comprtest.c @@ -265,12 +265,12 @@ #endif static unsigned char comprbuf[TESTDATA_LEN]; static unsigned char decomprbuf[TESTDATA_LEN]; -int jffs2_decompress(unsigned char comprtype, unsigned char *cdata_in, +objstatic int jffs2_decompress(unsigned char comprtype, unsigned char *cdata_in, unsigned char *data_out, uint32_t cdatalen, uint32_t datalen); -unsigned char jffs2_compress(unsigned char *data_in, unsigned char *cpage_out, +objstatic unsigned char jffs2_compress(unsigned char *data_in, unsigned char *cpage_out, uint32_t *datalen, uint32_t *cdatalen); -int init_module(void ) { +objstatic int init_module(void ) { unsigned char comprtype; uint32_t c, d; int ret; diff --git a/fs/jffs2/debug.c b/fs/jffs2/debug.c index 1fe17de..6ad1557 100644 --- a/fs/jffs2/debug.c +++ b/fs/jffs2/debug.c @@ -21,7 +21,7 @@ #include "debug.h" #ifdef JFFS2_DBG_SANITY_CHECKS -void +objstatic void __jffs2_dbg_acct_sanity_check_nolock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { @@ -45,7 +45,7 @@ __jffs2_dbg_acct_sanity_check_nolock(str } } -void +objstatic void __jffs2_dbg_acct_sanity_check(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { @@ -60,7 +60,7 @@ #ifdef JFFS2_DBG_PARANOIA_CHECKS /* * Check the fragtree. */ -void +objstatic void __jffs2_dbg_fragtree_paranoia_check(struct jffs2_inode_info *f) { down(&f->sem); @@ -68,7 +68,7 @@ __jffs2_dbg_fragtree_paranoia_check(stru up(&f->sem); } -void +objstatic void __jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f) { struct jffs2_node_frag *frag; @@ -118,7 +118,7 @@ __jffs2_dbg_fragtree_paranoia_check_nolo /* * Check if the flash contains all 0xFF before we start writing. */ -void +objstatic void __jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c, uint32_t ofs, int len) { @@ -157,7 +157,7 @@ __jffs2_dbg_prewrite_paranoia_check(stru /* * Check the space accounting and node_ref list correctness for the JFFS2 erasable block 'jeb'. */ -void +objstatic void __jffs2_dbg_acct_paranoia_check(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { @@ -166,7 +166,7 @@ __jffs2_dbg_acct_paranoia_check(struct j spin_unlock(&c->erase_completion_lock); } -void +objstatic void __jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { @@ -245,7 +245,7 @@ #if defined(JFFS2_DBG_DUMPS) || defined( /* * Dump the node_refs of the 'jeb' JFFS2 eraseblock. */ -void +objstatic void __jffs2_dbg_dump_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { @@ -254,7 +254,7 @@ __jffs2_dbg_dump_node_refs(struct jffs2_ spin_unlock(&c->erase_completion_lock); } -void +objstatic void __jffs2_dbg_dump_node_refs_nolock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { @@ -285,7 +285,7 @@ __jffs2_dbg_dump_node_refs_nolock(struct /* * Dump an eraseblock's space accounting. */ -void +objstatic void __jffs2_dbg_dump_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { spin_lock(&c->erase_completion_lock); @@ -293,7 +293,7 @@ __jffs2_dbg_dump_jeb(struct jffs2_sb_inf spin_unlock(&c->erase_completion_lock); } -void +objstatic void __jffs2_dbg_dump_jeb_nolock(struct jffs2_eraseblock *jeb) { if (!jeb) @@ -309,7 +309,7 @@ __jffs2_dbg_dump_jeb_nolock(struct jffs2 printk(JFFS2_DBG "free_size: %#08x\n", jeb->free_size); } -void +objstatic void __jffs2_dbg_dump_block_lists(struct jffs2_sb_info *c) { spin_lock(&c->erase_completion_lock); @@ -317,7 +317,7 @@ __jffs2_dbg_dump_block_lists(struct jffs spin_unlock(&c->erase_completion_lock); } -void +objstatic void __jffs2_dbg_dump_block_lists_nolock(struct jffs2_sb_info *c) { printk(JFFS2_DBG_MSG_PREFIX " dump JFFS2 blocks lists:\n"); @@ -530,7 +530,7 @@ __jffs2_dbg_dump_block_lists_nolock(stru } } -void +objstatic void __jffs2_dbg_dump_fragtree(struct jffs2_inode_info *f) { down(&f->sem); @@ -538,7 +538,7 @@ __jffs2_dbg_dump_fragtree(struct jffs2_i up(&f->sem); } -void +objstatic void __jffs2_dbg_dump_fragtree_nolock(struct jffs2_inode_info *f) { struct jffs2_node_frag *this = frag_first(&f->fragtree); @@ -572,7 +572,7 @@ __jffs2_dbg_dump_fragtree_nolock(struct } #define JFFS2_BUFDUMP_BYTES_PER_LINE 32 -void +objstatic void __jffs2_dbg_dump_buffer(unsigned char *buf, int len, uint32_t offs) { int skip; @@ -608,7 +608,7 @@ __jffs2_dbg_dump_buffer(unsigned char *b /* * Dump a JFFS2 node. */ -void +objstatic void __jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs) { union jffs2_node_union node; diff --git a/fs/jffs2/debug.h b/fs/jffs2/debug.h index 5fa494a..f6e0606 100644 --- a/fs/jffs2/debug.h +++ b/fs/jffs2/debug.h @@ -179,50 +179,50 @@ #define dbg_xattr(fmt, ...) #endif /* "Sanity" checks */ -void +objstatic void __jffs2_dbg_acct_sanity_check_nolock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -void +objstatic void __jffs2_dbg_acct_sanity_check(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); /* "Paranoia" checks */ -void +objstatic void __jffs2_dbg_fragtree_paranoia_check(struct jffs2_inode_info *f); -void +objstatic void __jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f); -void +objstatic void __jffs2_dbg_acct_paranoia_check(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -void +objstatic void __jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -void +objstatic void __jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c, uint32_t ofs, int len); /* "Dump" functions */ -void +objstatic void __jffs2_dbg_dump_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -void +objstatic void __jffs2_dbg_dump_jeb_nolock(struct jffs2_eraseblock *jeb); -void +objstatic void __jffs2_dbg_dump_block_lists(struct jffs2_sb_info *c); -void +objstatic void __jffs2_dbg_dump_block_lists_nolock(struct jffs2_sb_info *c); -void +objstatic void __jffs2_dbg_dump_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -void +objstatic void __jffs2_dbg_dump_node_refs_nolock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -void +objstatic void __jffs2_dbg_dump_fragtree(struct jffs2_inode_info *f); -void +objstatic void __jffs2_dbg_dump_fragtree_nolock(struct jffs2_inode_info *f); -void +objstatic void __jffs2_dbg_dump_buffer(unsigned char *buf, int len, uint32_t offs); -void +objstatic void __jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs); #ifdef JFFS2_DBG_PARANOIA_CHECKS diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c index 4616fed..ac3f806 100644 --- a/fs/jffs2/erase.c +++ b/fs/jffs2/erase.c @@ -103,7 +103,7 @@ #endif /* __ECOS */ jffs2_erase_failed(c, jeb, bad_offset); } -void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count) +objstatic void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count) { struct jffs2_eraseblock *jeb; @@ -283,7 +283,7 @@ static inline void jffs2_remove_node_ref jffs2_del_ino_cache(c, ic); } -void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) +objstatic void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { struct jffs2_raw_node_ref *ref; D1(printk(KERN_DEBUG "Freeing all node refs for eraseblock offset 0x%08x\n", jeb->offset)); diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index bb8844f..25c29c5 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c @@ -27,7 +27,7 @@ static int jffs2_prepare_write (struct f unsigned start, unsigned end); static int jffs2_readpage (struct file *filp, struct page *pg); -int jffs2_fsync(struct file *filp, struct dentry *dentry, int datasync) +objstatic int jffs2_fsync(struct file *filp, struct dentry *dentry, int datasync) { struct inode *inode = dentry->d_inode; struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); @@ -100,7 +100,7 @@ static int jffs2_do_readpage_nolock (str return 0; } -int jffs2_do_readpage_unlock(struct inode *inode, struct page *pg) +objstatic int jffs2_do_readpage_unlock(struct inode *inode, struct page *pg) { int ret = jffs2_do_readpage_nolock(inode, pg); unlock_page(pg); diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index 7b6c24b..4e11f41 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c @@ -182,7 +182,7 @@ static int jffs2_do_setattr (struct inod return 0; } -int jffs2_setattr(struct dentry *dentry, struct iattr *iattr) +objstatic int jffs2_setattr(struct dentry *dentry, struct iattr *iattr) { int rc; @@ -192,7 +192,7 @@ int jffs2_setattr(struct dentry *dentry, return rc; } -int jffs2_statfs(struct super_block *sb, struct kstatfs *buf) +objstatic int jffs2_statfs(struct super_block *sb, struct kstatfs *buf) { struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); unsigned long avail; @@ -218,7 +218,7 @@ int jffs2_statfs(struct super_block *sb, } -void jffs2_clear_inode (struct inode *inode) +objstatic void jffs2_clear_inode (struct inode *inode) { /* We can forget about this inode for now - drop all * the nodelists associated with it, etc. @@ -232,7 +232,7 @@ void jffs2_clear_inode (struct inode *in jffs2_do_clear_inode(c, f); } -void jffs2_read_inode (struct inode *inode) +objstatic void jffs2_read_inode (struct inode *inode) { struct jffs2_inode_info *f; struct jffs2_sb_info *c; @@ -340,7 +340,7 @@ void jffs2_read_inode (struct inode *ino D1(printk(KERN_DEBUG "jffs2_read_inode() returning\n")); } -void jffs2_dirty_inode(struct inode *inode) +objstatic void jffs2_dirty_inode(struct inode *inode) { struct iattr iattr; @@ -362,7 +362,7 @@ void jffs2_dirty_inode(struct inode *ino jffs2_do_setattr(inode, &iattr); } -int jffs2_remount_fs (struct super_block *sb, int *flags, char *data) +objstatic int jffs2_remount_fs (struct super_block *sb, int *flags, char *data) { struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); @@ -388,7 +388,7 @@ int jffs2_remount_fs (struct super_block return 0; } -void jffs2_write_super (struct super_block *sb) +objstatic void jffs2_write_super (struct super_block *sb) { struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); sb->s_dirt = 0; @@ -405,7 +405,7 @@ void jffs2_write_super (struct super_blo /* jffs2_new_inode: allocate a new inode and inocache, add it to the hash, fill in the raw_inode while you're at it. */ -struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_inode *ri) +objstatic struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_inode *ri) { struct inode *inode; struct super_block *sb = dir_i->i_sb; @@ -462,7 +462,7 @@ struct inode *jffs2_new_inode (struct in } -int jffs2_do_fill_super(struct super_block *sb, void *data, int silent) +objstatic int jffs2_do_fill_super(struct super_block *sb, void *data, int silent) { struct jffs2_sb_info *c; struct inode *root_i; @@ -558,13 +558,13 @@ #endif return ret; } -void jffs2_gc_release_inode(struct jffs2_sb_info *c, +objstatic void jffs2_gc_release_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f) { iput(OFNI_EDONI_2SFFJ(f)); } -struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, +objstatic struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, int inum, int nlink) { struct inode *inode; @@ -627,7 +627,7 @@ struct jffs2_inode_info *jffs2_gc_fetch_ return JFFS2_INODE_INFO(inode); } -unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, +objstatic unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, struct jffs2_inode_info *f, unsigned long offset, unsigned long *priv) @@ -644,7 +644,7 @@ unsigned char *jffs2_gc_fetch_page(struc return kmap(pg); } -void jffs2_gc_release_page(struct jffs2_sb_info *c, +objstatic void jffs2_gc_release_page(struct jffs2_sb_info *c, unsigned char *ptr, unsigned long *priv) { @@ -681,7 +681,7 @@ static int jffs2_flash_setup(struct jffs return ret; } -void jffs2_flash_cleanup(struct jffs2_sb_info *c) { +objstatic void jffs2_flash_cleanup(struct jffs2_sb_info *c) { if (jffs2_cleanmarker_oob(c)) { jffs2_nand_flash_cleanup(c); diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index f9e982a..fe95a8f 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c @@ -118,7 +118,7 @@ again: * Make a single attempt to progress GC. Move one node, and possibly * start erasing one eraseblock. */ -int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) +objstatic int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) { struct jffs2_inode_info *f; struct jffs2_inode_cache *ic; diff --git a/fs/jffs2/ioctl.c b/fs/jffs2/ioctl.c index 6909983..8ab2186 100644 --- a/fs/jffs2/ioctl.c +++ b/fs/jffs2/ioctl.c @@ -12,8 +12,9 @@ */ #include +#include "nodelist.h" -int jffs2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, +objstatic int jffs2_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg) { /* Later, this will provide for lsattr.jffs2 and chattr.jffs2, which diff --git a/fs/jffs2/malloc.c b/fs/jffs2/malloc.c index f2473fa..59bbc53 100644 --- a/fs/jffs2/malloc.c +++ b/fs/jffs2/malloc.c @@ -31,7 +31,7 @@ static kmem_cache_t *xattr_datum_cache; static kmem_cache_t *xattr_ref_cache; #endif -int __init jffs2_create_slab_caches(void) +objstatic int __init jffs2_create_slab_caches(void) { full_dnode_slab = kmem_cache_create("jffs2_full_dnode", sizeof(struct jffs2_full_dnode), @@ -95,7 +95,7 @@ #endif return -ENOMEM; } -void jffs2_destroy_slab_caches(void) +objstatic void jffs2_destroy_slab_caches(void) { if(full_dnode_slab) kmem_cache_destroy(full_dnode_slab); @@ -119,7 +119,7 @@ #ifdef CONFIG_JFFS2_FS_XATTR #endif } -struct jffs2_full_dirent *jffs2_alloc_full_dirent(int namesize) +objstatic struct jffs2_full_dirent *jffs2_alloc_full_dirent(int namesize) { struct jffs2_full_dirent *ret; ret = kmalloc(sizeof(struct jffs2_full_dirent) + namesize, GFP_KERNEL); @@ -127,13 +127,13 @@ struct jffs2_full_dirent *jffs2_alloc_fu return ret; } -void jffs2_free_full_dirent(struct jffs2_full_dirent *x) +objstatic void jffs2_free_full_dirent(struct jffs2_full_dirent *x) { dbg_memalloc("%p\n", x); kfree(x); } -struct jffs2_full_dnode *jffs2_alloc_full_dnode(void) +objstatic struct jffs2_full_dnode *jffs2_alloc_full_dnode(void) { struct jffs2_full_dnode *ret; ret = kmem_cache_alloc(full_dnode_slab, GFP_KERNEL); @@ -141,13 +141,13 @@ struct jffs2_full_dnode *jffs2_alloc_ful return ret; } -void jffs2_free_full_dnode(struct jffs2_full_dnode *x) +objstatic void jffs2_free_full_dnode(struct jffs2_full_dnode *x) { dbg_memalloc("%p\n", x); kmem_cache_free(full_dnode_slab, x); } -struct jffs2_raw_dirent *jffs2_alloc_raw_dirent(void) +objstatic struct jffs2_raw_dirent *jffs2_alloc_raw_dirent(void) { struct jffs2_raw_dirent *ret; ret = kmem_cache_alloc(raw_dirent_slab, GFP_KERNEL); @@ -155,13 +155,13 @@ struct jffs2_raw_dirent *jffs2_alloc_raw return ret; } -void jffs2_free_raw_dirent(struct jffs2_raw_dirent *x) +objstatic void jffs2_free_raw_dirent(struct jffs2_raw_dirent *x) { dbg_memalloc("%p\n", x); kmem_cache_free(raw_dirent_slab, x); } -struct jffs2_raw_inode *jffs2_alloc_raw_inode(void) +objstatic struct jffs2_raw_inode *jffs2_alloc_raw_inode(void) { struct jffs2_raw_inode *ret; ret = kmem_cache_alloc(raw_inode_slab, GFP_KERNEL); @@ -169,13 +169,13 @@ struct jffs2_raw_inode *jffs2_alloc_raw_ return ret; } -void jffs2_free_raw_inode(struct jffs2_raw_inode *x) +objstatic void jffs2_free_raw_inode(struct jffs2_raw_inode *x) { dbg_memalloc("%p\n", x); kmem_cache_free(raw_inode_slab, x); } -struct jffs2_tmp_dnode_info *jffs2_alloc_tmp_dnode_info(void) +objstatic struct jffs2_tmp_dnode_info *jffs2_alloc_tmp_dnode_info(void) { struct jffs2_tmp_dnode_info *ret; ret = kmem_cache_alloc(tmp_dnode_info_slab, GFP_KERNEL); @@ -184,13 +184,13 @@ struct jffs2_tmp_dnode_info *jffs2_alloc return ret; } -void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *x) +objstatic void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *x) { dbg_memalloc("%p\n", x); kmem_cache_free(tmp_dnode_info_slab, x); } -struct jffs2_raw_node_ref *jffs2_alloc_raw_node_ref(void) +objstatic struct jffs2_raw_node_ref *jffs2_alloc_raw_node_ref(void) { struct jffs2_raw_node_ref *ret; ret = kmem_cache_alloc(raw_node_ref_slab, GFP_KERNEL); @@ -198,13 +198,13 @@ struct jffs2_raw_node_ref *jffs2_alloc_r return ret; } -void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *x) +objstatic void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *x) { dbg_memalloc("%p\n", x); kmem_cache_free(raw_node_ref_slab, x); } -struct jffs2_node_frag *jffs2_alloc_node_frag(void) +objstatic struct jffs2_node_frag *jffs2_alloc_node_frag(void) { struct jffs2_node_frag *ret; ret = kmem_cache_alloc(node_frag_slab, GFP_KERNEL); @@ -212,13 +212,13 @@ struct jffs2_node_frag *jffs2_alloc_node return ret; } -void jffs2_free_node_frag(struct jffs2_node_frag *x) +objstatic void jffs2_free_node_frag(struct jffs2_node_frag *x) { dbg_memalloc("%p\n", x); kmem_cache_free(node_frag_slab, x); } -struct jffs2_inode_cache *jffs2_alloc_inode_cache(void) +objstatic struct jffs2_inode_cache *jffs2_alloc_inode_cache(void) { struct jffs2_inode_cache *ret; ret = kmem_cache_alloc(inode_cache_slab, GFP_KERNEL); @@ -226,14 +226,14 @@ struct jffs2_inode_cache *jffs2_alloc_in return ret; } -void jffs2_free_inode_cache(struct jffs2_inode_cache *x) +objstatic void jffs2_free_inode_cache(struct jffs2_inode_cache *x) { dbg_memalloc("%p\n", x); kmem_cache_free(inode_cache_slab, x); } #ifdef CONFIG_JFFS2_FS_XATTR -struct jffs2_xattr_datum *jffs2_alloc_xattr_datum(void) +objstatic struct jffs2_xattr_datum *jffs2_alloc_xattr_datum(void) { struct jffs2_xattr_datum *xd; xd = kmem_cache_alloc(xattr_datum_cache, GFP_KERNEL); @@ -245,13 +245,13 @@ struct jffs2_xattr_datum *jffs2_alloc_xa return xd; } -void jffs2_free_xattr_datum(struct jffs2_xattr_datum *xd) +objstatic void jffs2_free_xattr_datum(struct jffs2_xattr_datum *xd) { dbg_memalloc("%p\n", xd); kmem_cache_free(xattr_datum_cache, xd); } -struct jffs2_xattr_ref *jffs2_alloc_xattr_ref(void) +objstatic struct jffs2_xattr_ref *jffs2_alloc_xattr_ref(void) { struct jffs2_xattr_ref *ref; ref = kmem_cache_alloc(xattr_ref_cache, GFP_KERNEL); @@ -262,7 +262,7 @@ struct jffs2_xattr_ref *jffs2_alloc_xatt return ref; } -void jffs2_free_xattr_ref(struct jffs2_xattr_ref *ref) +objstatic void jffs2_free_xattr_ref(struct jffs2_xattr_ref *ref) { dbg_memalloc("%p\n", ref); kmem_cache_free(xattr_ref_cache, ref); diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c index d25d491..843b7ff 100644 --- a/fs/jffs2/nodelist.c +++ b/fs/jffs2/nodelist.c @@ -21,7 +21,7 @@ #include #include #include "nodelist.h" -void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list) +objstatic void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list) { struct jffs2_full_dirent **prev = list; @@ -51,7 +51,7 @@ void jffs2_add_fd_to_list(struct jffs2_s *prev = new; } -void jffs2_truncate_fragtree(struct jffs2_sb_info *c, struct rb_root *list, uint32_t size) +objstatic void jffs2_truncate_fragtree(struct jffs2_sb_info *c, struct rb_root *list, uint32_t size) { struct jffs2_node_frag *frag = jffs2_lookup_node_frag(list, size); @@ -87,7 +87,7 @@ void jffs2_truncate_fragtree(struct jffs } } -void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this) +objstatic void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this) { if (this->node) { this->node->frags--; @@ -348,7 +348,7 @@ static int jffs2_add_frag_to_fragtree(st * Given an inode, probably with existing tree of fragments, add the new node * to the fragment tree. */ -int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn) +objstatic int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn) { int ret; struct jffs2_node_frag *newfrag; @@ -633,7 +633,7 @@ static int split_hole(struct jffs2_sb_in * 1 if it wasn't inserted (since it is obsolete) * < 0 an if error occured */ -int jffs2_add_older_frag_to_fragtree(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_add_older_frag_to_fragtree(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_tmp_dnode_info *tn) { struct jffs2_node_frag *this, *newfrag; @@ -853,7 +853,7 @@ out_ok: return 0; } -void jffs2_set_inocache_state(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, int state) +objstatic void jffs2_set_inocache_state(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, int state) { spin_lock(&c->inocache_lock); ic->state = state; @@ -866,7 +866,7 @@ void jffs2_set_inocache_state(struct jff Rather than introducing special case get_ino_cache functions or callbacks, we just let the caller do the locking itself. */ -struct jffs2_inode_cache *jffs2_get_ino_cache(struct jffs2_sb_info *c, uint32_t ino) +objstatic struct jffs2_inode_cache *jffs2_get_ino_cache(struct jffs2_sb_info *c, uint32_t ino) { struct jffs2_inode_cache *ret; @@ -881,7 +881,7 @@ struct jffs2_inode_cache *jffs2_get_ino_ return ret; } -void jffs2_add_ino_cache (struct jffs2_sb_info *c, struct jffs2_inode_cache *new) +objstatic void jffs2_add_ino_cache (struct jffs2_sb_info *c, struct jffs2_inode_cache *new) { struct jffs2_inode_cache **prev; @@ -902,7 +902,7 @@ void jffs2_add_ino_cache (struct jffs2_s spin_unlock(&c->inocache_lock); } -void jffs2_del_ino_cache(struct jffs2_sb_info *c, struct jffs2_inode_cache *old) +objstatic void jffs2_del_ino_cache(struct jffs2_sb_info *c, struct jffs2_inode_cache *old) { struct jffs2_inode_cache **prev; @@ -929,7 +929,7 @@ void jffs2_del_ino_cache(struct jffs2_sb spin_unlock(&c->inocache_lock); } -void jffs2_free_ino_caches(struct jffs2_sb_info *c) +objstatic void jffs2_free_ino_caches(struct jffs2_sb_info *c) { int i; struct jffs2_inode_cache *this, *next; @@ -946,7 +946,7 @@ void jffs2_free_ino_caches(struct jffs2_ } } -void jffs2_free_raw_node_refs(struct jffs2_sb_info *c) +objstatic void jffs2_free_raw_node_refs(struct jffs2_sb_info *c) { int i; struct jffs2_raw_node_ref *this, *next; @@ -962,7 +962,7 @@ void jffs2_free_raw_node_refs(struct jff } } -struct jffs2_node_frag *jffs2_lookup_node_frag(struct rb_root *fragtree, uint32_t offset) +objstatic struct jffs2_node_frag *jffs2_lookup_node_frag(struct rb_root *fragtree, uint32_t offset) { /* The common case in lookup is that there will be a node which precisely matches. So we go looking for that first */ @@ -1003,7 +1003,7 @@ struct jffs2_node_frag *jffs2_lookup_nod /* Pass 'c' argument to indicate that nodes should be marked obsolete as they're killed. */ -void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c) +objstatic void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c) { struct jffs2_node_frag *frag; struct jffs2_node_frag *parent; @@ -1047,7 +1047,7 @@ void jffs2_kill_fragtree(struct rb_root } } -void jffs2_link_node_ref(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, +objstatic void jffs2_link_node_ref(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, struct jffs2_raw_node_ref *ref, uint32_t len, struct jffs2_inode_cache *ic) { @@ -1102,7 +1102,7 @@ #endif } /* No locking. Do not use on a live file system */ -int jffs2_scan_dirty_space(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, +objstatic int jffs2_scan_dirty_space(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t size) { if (!size) @@ -1162,7 +1162,7 @@ static inline uint32_t __ref_totlen(stru return ref_end - ref_offset(ref); } -uint32_t __jffs2_ref_totlen(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, +objstatic uint32_t __jffs2_ref_totlen(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, struct jffs2_raw_node_ref *ref) { uint32_t ret; diff --git a/fs/jffs2/nodelist.h b/fs/jffs2/nodelist.h index 76f1b94..8753903 100644 --- a/fs/jffs2/nodelist.h +++ b/fs/jffs2/nodelist.h @@ -14,6 +14,11 @@ #ifndef __JFFS2_NODELIST_H__ #define __JFFS2_NODELIST_H__ +#ifndef objstatic +#define objstatic +#define objextern extern +#endif + #include #include #include @@ -302,128 +307,125 @@ #define frag_right(frag) rb_entry((frag) #define frag_erase(frag, list) rb_erase(&frag->rb, list); /* nodelist.c */ -void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list); -void jffs2_set_inocache_state(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, int state); -struct jffs2_inode_cache *jffs2_get_ino_cache(struct jffs2_sb_info *c, uint32_t ino); -void jffs2_add_ino_cache (struct jffs2_sb_info *c, struct jffs2_inode_cache *new); -void jffs2_del_ino_cache(struct jffs2_sb_info *c, struct jffs2_inode_cache *old); -void jffs2_free_ino_caches(struct jffs2_sb_info *c); -void jffs2_free_raw_node_refs(struct jffs2_sb_info *c); -struct jffs2_node_frag *jffs2_lookup_node_frag(struct rb_root *fragtree, uint32_t offset); -void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c_delete); -struct rb_node *rb_next(struct rb_node *); -struct rb_node *rb_prev(struct rb_node *); -void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root); -void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this); -int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn); -void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size); -int jffs2_add_older_frag_to_fragtree(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_tmp_dnode_info *tn); -void jffs2_link_node_ref(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, +objstatic void jffs2_add_fd_to_list(struct jffs2_sb_info *c, struct jffs2_full_dirent *new, struct jffs2_full_dirent **list); +objstatic void jffs2_set_inocache_state(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic, int state); +objstatic struct jffs2_inode_cache *jffs2_get_ino_cache(struct jffs2_sb_info *c, uint32_t ino); +objstatic void jffs2_add_ino_cache (struct jffs2_sb_info *c, struct jffs2_inode_cache *new); +objstatic void jffs2_del_ino_cache(struct jffs2_sb_info *c, struct jffs2_inode_cache *old); +objstatic void jffs2_free_ino_caches(struct jffs2_sb_info *c); +objstatic void jffs2_free_raw_node_refs(struct jffs2_sb_info *c); +objstatic struct jffs2_node_frag *jffs2_lookup_node_frag(struct rb_root *fragtree, uint32_t offset); +objstatic void jffs2_kill_fragtree(struct rb_root *root, struct jffs2_sb_info *c_delete); +objstatic void jffs2_obsolete_node_frag(struct jffs2_sb_info *c, struct jffs2_node_frag *this); +objstatic int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fn); +objstatic void jffs2_truncate_fragtree (struct jffs2_sb_info *c, struct rb_root *list, uint32_t size); +objstatic int jffs2_add_older_frag_to_fragtree(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_tmp_dnode_info *tn); +objstatic void jffs2_link_node_ref(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, struct jffs2_raw_node_ref *ref, uint32_t len, struct jffs2_inode_cache *ic); -extern uint32_t __jffs2_ref_totlen(struct jffs2_sb_info *c, +objstatic uint32_t __jffs2_ref_totlen(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, struct jffs2_raw_node_ref *ref); /* nodemgmt.c */ -int jffs2_thread_should_wake(struct jffs2_sb_info *c); -int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, +objstatic int jffs2_thread_should_wake(struct jffs2_sb_info *c); +objstatic int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *len, int prio, uint32_t sumsize); -int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, +objstatic int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *len, uint32_t sumsize); -int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, +objstatic int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *new, uint32_t len, struct jffs2_inode_cache *ic); -void jffs2_complete_reservation(struct jffs2_sb_info *c); -void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *raw); +objstatic void jffs2_complete_reservation(struct jffs2_sb_info *c); +objstatic void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *raw); /* write.c */ -int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t mode, struct jffs2_raw_inode *ri); +objstatic int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t mode, struct jffs2_raw_inode *ri); -struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const unsigned char *data, uint32_t datalen, int alloc_mode); -struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_dirent *rd, const unsigned char *name, uint32_t namelen, int alloc_mode); -int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, unsigned char *buf, uint32_t offset, uint32_t writelen, uint32_t *retlen); -int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, struct jffs2_inode_info *f, +objstatic int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const char *name, int namelen); -int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, const char *name, +objstatic int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, const char *name, int namelen, struct jffs2_inode_info *dead_f, uint32_t time); -int jffs2_do_link(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, uint32_t ino, +objstatic int jffs2_do_link(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, uint32_t ino, uint8_t type, const char *name, int namelen, uint32_t time); /* readinode.c */ -int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t ino, struct jffs2_raw_inode *latest_node); -int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); -void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f); +objstatic int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); +objstatic void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f); /* malloc.c */ -int jffs2_create_slab_caches(void); -void jffs2_destroy_slab_caches(void); - -struct jffs2_full_dirent *jffs2_alloc_full_dirent(int namesize); -void jffs2_free_full_dirent(struct jffs2_full_dirent *); -struct jffs2_full_dnode *jffs2_alloc_full_dnode(void); -void jffs2_free_full_dnode(struct jffs2_full_dnode *); -struct jffs2_raw_dirent *jffs2_alloc_raw_dirent(void); -void jffs2_free_raw_dirent(struct jffs2_raw_dirent *); -struct jffs2_raw_inode *jffs2_alloc_raw_inode(void); -void jffs2_free_raw_inode(struct jffs2_raw_inode *); -struct jffs2_tmp_dnode_info *jffs2_alloc_tmp_dnode_info(void); -void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *); -struct jffs2_raw_node_ref *jffs2_alloc_raw_node_ref(void); -void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *); -struct jffs2_node_frag *jffs2_alloc_node_frag(void); -void jffs2_free_node_frag(struct jffs2_node_frag *); -struct jffs2_inode_cache *jffs2_alloc_inode_cache(void); -void jffs2_free_inode_cache(struct jffs2_inode_cache *); +objstatic int jffs2_create_slab_caches(void); +objstatic void jffs2_destroy_slab_caches(void); + +objstatic struct jffs2_full_dirent *jffs2_alloc_full_dirent(int namesize); +objstatic void jffs2_free_full_dirent(struct jffs2_full_dirent *); +objstatic struct jffs2_full_dnode *jffs2_alloc_full_dnode(void); +objstatic void jffs2_free_full_dnode(struct jffs2_full_dnode *); +objstatic struct jffs2_raw_dirent *jffs2_alloc_raw_dirent(void); +objstatic void jffs2_free_raw_dirent(struct jffs2_raw_dirent *); +objstatic struct jffs2_raw_inode *jffs2_alloc_raw_inode(void); +objstatic void jffs2_free_raw_inode(struct jffs2_raw_inode *); +objstatic struct jffs2_tmp_dnode_info *jffs2_alloc_tmp_dnode_info(void); +objstatic void jffs2_free_tmp_dnode_info(struct jffs2_tmp_dnode_info *); +objstatic struct jffs2_raw_node_ref *jffs2_alloc_raw_node_ref(void); +objstatic void jffs2_free_raw_node_ref(struct jffs2_raw_node_ref *); +objstatic struct jffs2_node_frag *jffs2_alloc_node_frag(void); +objstatic void jffs2_free_node_frag(struct jffs2_node_frag *); +objstatic struct jffs2_inode_cache *jffs2_alloc_inode_cache(void); +objstatic void jffs2_free_inode_cache(struct jffs2_inode_cache *); #ifdef CONFIG_JFFS2_FS_XATTR -struct jffs2_xattr_datum *jffs2_alloc_xattr_datum(void); -void jffs2_free_xattr_datum(struct jffs2_xattr_datum *); -struct jffs2_xattr_ref *jffs2_alloc_xattr_ref(void); -void jffs2_free_xattr_ref(struct jffs2_xattr_ref *); +objstatic struct jffs2_xattr_datum *jffs2_alloc_xattr_datum(void); +objstatic void jffs2_free_xattr_datum(struct jffs2_xattr_datum *); +objstatic struct jffs2_xattr_ref *jffs2_alloc_xattr_ref(void); +objstatic void jffs2_free_xattr_ref(struct jffs2_xattr_ref *); #endif /* gc.c */ -int jffs2_garbage_collect_pass(struct jffs2_sb_info *c); +objstatic int jffs2_garbage_collect_pass(struct jffs2_sb_info *c); /* read.c */ -int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fd, unsigned char *buf, int ofs, int len); -int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, unsigned char *buf, uint32_t offset, uint32_t len); -char *jffs2_getlink(struct jffs2_sb_info *c, struct jffs2_inode_info *f); +objstatic char *jffs2_getlink(struct jffs2_sb_info *c, struct jffs2_inode_info *f); /* scan.c */ -int jffs2_scan_medium(struct jffs2_sb_info *c); -void jffs2_rotate_lists(struct jffs2_sb_info *c); -int jffs2_fill_scan_buf(struct jffs2_sb_info *c, void *buf, +objstatic int jffs2_scan_medium(struct jffs2_sb_info *c); +objstatic void jffs2_rotate_lists(struct jffs2_sb_info *c); +objstatic int jffs2_fill_scan_buf(struct jffs2_sb_info *c, void *buf, uint32_t ofs, uint32_t len); -struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uint32_t ino); -int jffs2_scan_classify_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -int jffs2_scan_dirty_space(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t size); +objstatic struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uint32_t ino); +objstatic int jffs2_scan_classify_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); +objstatic int jffs2_scan_dirty_space(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t size); /* build.c */ -int jffs2_do_mount_fs(struct jffs2_sb_info *c); +objstatic int jffs2_do_mount_fs(struct jffs2_sb_info *c); /* erase.c */ -void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count); -void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); +objstatic void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count); +objstatic void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); #ifdef CONFIG_JFFS2_FS_WRITEBUFFER /* wbuf.c */ -int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino); -int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c); -int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); +objstatic int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino); +objstatic int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c); +objstatic int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); +objstatic int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); #endif #include "debug.h" diff --git a/fs/jffs2/nodemgmt.c b/fs/jffs2/nodemgmt.c index 8feb874..cf7f7b0 100644 --- a/fs/jffs2/nodemgmt.c +++ b/fs/jffs2/nodemgmt.c @@ -41,7 +41,7 @@ #include "debug.h" static int jffs2_do_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *len, uint32_t sumsize); -int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, +objstatic int jffs2_reserve_space(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *len, int prio, uint32_t sumsize) { int ret = -EAGAIN; @@ -142,7 +142,7 @@ int jffs2_reserve_space(struct jffs2_sb_ return ret; } -int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, +objstatic int jffs2_reserve_space_gc(struct jffs2_sb_info *c, uint32_t minsize, uint32_t *len, uint32_t sumsize) { int ret = -EAGAIN; @@ -381,7 +381,7 @@ static int jffs2_do_reserve_space(struct * Must be called with the alloc_sem held. */ -int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *new, +objstatic int jffs2_add_physical_node_ref(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *new, uint32_t len, struct jffs2_inode_cache *ic) { struct jffs2_eraseblock *jeb; @@ -429,7 +429,7 @@ #endif } -void jffs2_complete_reservation(struct jffs2_sb_info *c) +objstatic void jffs2_complete_reservation(struct jffs2_sb_info *c) { D1(printk(KERN_DEBUG "jffs2_complete_reservation()\n")); jffs2_garbage_collect_trigger(c); @@ -450,7 +450,7 @@ static inline int on_list(struct list_he return 0; } -void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref) +objstatic void jffs2_mark_node_obsolete(struct jffs2_sb_info *c, struct jffs2_raw_node_ref *ref) { struct jffs2_eraseblock *jeb; int blocknr; @@ -730,7 +730,7 @@ #endif up(&c->erase_free_sem); } -int jffs2_thread_should_wake(struct jffs2_sb_info *c) +objstatic int jffs2_thread_should_wake(struct jffs2_sb_info *c) { int ret = 0; uint32_t dirty; diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index 743c9e5..5940ed7 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h @@ -115,27 +115,27 @@ #define jffs2_flash_read_oob(c, ofs, len #define jffs2_wbuf_dirty(c) (!!(c)->wbuf_len) /* wbuf.c */ -int jffs2_flash_writev(struct jffs2_sb_info *c, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen, uint32_t ino); -int jffs2_flash_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, const u_char *buf); -int jffs2_flash_read(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, u_char *buf); -int jffs2_check_oob_empty(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb,int mode); -int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); -int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset); -void jffs2_wbuf_timeout(unsigned long data); -void jffs2_wbuf_process(void *data); -int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino); -int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c); -int jffs2_nand_flash_setup(struct jffs2_sb_info *c); -void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c); +objstatic int jffs2_flash_writev(struct jffs2_sb_info *c, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen, uint32_t ino); +objstatic int jffs2_flash_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, const u_char *buf); +objstatic int jffs2_flash_read(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, u_char *buf); +objstatic int jffs2_check_oob_empty(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb,int mode); +objstatic int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); +objstatic int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); +objstatic int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset); +objstatic void jffs2_wbuf_timeout(unsigned long data); +objstatic void jffs2_wbuf_process(void *data); +objstatic int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino); +objstatic int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c); +objstatic int jffs2_nand_flash_setup(struct jffs2_sb_info *c); +objstatic void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c); #define jffs2_dataflash(c) (c->mtd->type == MTD_DATAFLASH) -int jffs2_dataflash_setup(struct jffs2_sb_info *c); -void jffs2_dataflash_cleanup(struct jffs2_sb_info *c); +objstatic int jffs2_dataflash_setup(struct jffs2_sb_info *c); +objstatic void jffs2_dataflash_cleanup(struct jffs2_sb_info *c); #define jffs2_nor_wbuf_flash(c) (c->mtd->type == MTD_NORFLASH && ! (c->mtd->flags & MTD_BIT_WRITEABLE)) -int jffs2_nor_wbuf_flash_setup(struct jffs2_sb_info *c); -void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c); +objstatic int jffs2_nor_wbuf_flash_setup(struct jffs2_sb_info *c); +objstatic void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c); #endif /* WRITEBUFFER */ @@ -146,9 +151,9 @@ static inline void jffs2_erase_pending_t } /* background.c */ -int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c); -void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c); -void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c); +objstatic int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c); +objstatic void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c); +objstatic void jffs2_garbage_collect_trigger(struct jffs2_sb_info *c); /* dir.c */ extern const struct file_operations jffs2_dir_operations; @@ -158,45 +163,46 @@ extern struct inode_operations jffs2_dir extern const struct file_operations jffs2_file_operations; extern struct inode_operations jffs2_file_inode_operations; extern struct address_space_operations jffs2_file_address_operations; -int jffs2_fsync(struct file *, struct dentry *, int); -int jffs2_do_readpage_unlock (struct inode *inode, struct page *pg); + +objstatic int jffs2_fsync(struct file *, struct dentry *, int); +objstatic int jffs2_do_readpage_unlock (struct inode *inode, struct page *pg); /* ioctl.c */ -int jffs2_ioctl(struct inode *, struct file *, unsigned int, unsigned long); +objstatic int jffs2_ioctl(struct inode *, struct file *, unsigned int, unsigned long); /* symlink.c */ extern struct inode_operations jffs2_symlink_inode_operations; /* fs.c */ -int jffs2_setattr (struct dentry *, struct iattr *); -void jffs2_read_inode (struct inode *); -void jffs2_clear_inode (struct inode *); -void jffs2_dirty_inode(struct inode *inode); -struct inode *jffs2_new_inode (struct inode *dir_i, int mode, +objstatic int jffs2_setattr(struct dentry *, struct iattr *); +objstatic void jffs2_read_inode(struct inode *); +objstatic void jffs2_clear_inode(struct inode *); +objstatic void jffs2_dirty_inode(struct inode *inode); +objstatic struct inode *jffs2_new_inode(struct inode *dir_i, int mode, struct jffs2_raw_inode *ri); -int jffs2_statfs (struct super_block *, struct kstatfs *); -void jffs2_write_super (struct super_block *); -int jffs2_remount_fs (struct super_block *, int *, char *); -int jffs2_do_fill_super(struct super_block *sb, void *data, int silent); -void jffs2_gc_release_inode(struct jffs2_sb_info *c, +objstatic int jffs2_statfs(struct super_block *, struct kstatfs *); +objstatic void jffs2_write_super (struct super_block *); +objstatic int jffs2_remount_fs(struct super_block *, int *, char *); +objstatic int jffs2_do_fill_super(struct super_block *sb, void *data, int silent); +objstatic void jffs2_gc_release_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f); -struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, +objstatic struct jffs2_inode_info *jffs2_gc_fetch_inode(struct jffs2_sb_info *c, int inum, int nlink); -unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, +objstatic unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, struct jffs2_inode_info *f, unsigned long offset, unsigned long *priv); -void jffs2_gc_release_page(struct jffs2_sb_info *c, +objstatic void jffs2_gc_release_page(struct jffs2_sb_info *c, unsigned char *pg, unsigned long *priv); -void jffs2_flash_cleanup(struct jffs2_sb_info *c); +objstatic void jffs2_flash_cleanup(struct jffs2_sb_info *c); /* writev.c */ -int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs, +objstatic int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); -int jffs2_flash_direct_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, +objstatic int jffs2_flash_direct_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, const u_char *buf); #endif /* __JFFS2_OS_LINUX_H__ */ diff --git a/fs/jffs2/read.c b/fs/jffs2/read.c index f3b86da..4a6a08b 100644 --- a/fs/jffs2/read.c +++ b/fs/jffs2/read.c @@ -20,7 +20,7 @@ #include #include "nodelist.h" #include "compr.h" -int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_full_dnode *fd, unsigned char *buf, int ofs, int len) { @@ -152,7 +152,7 @@ int jffs2_read_dnode(struct jffs2_sb_inf return ret; } -int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_read_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, unsigned char *buf, uint32_t offset, uint32_t len) { uint32_t end = offset + len; diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index e1acce8..ddd023d 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c @@ -848,7 +848,7 @@ static int jffs2_do_read_inode_internal( } /* Scan the list of all nodes present for this ino, build map of versions, etc. */ -int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_do_read_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t ino, struct jffs2_raw_inode *latest_node) { dbg_readinode("read inode #%u\n", ino); @@ -912,7 +912,7 @@ int jffs2_do_read_inode(struct jffs2_sb_ return jffs2_do_read_inode_internal(c, f, latest_node); } -int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) +objstatic int jffs2_do_crccheck_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) { struct jffs2_raw_inode n; struct jffs2_inode_info *f = kmalloc(sizeof(*f), GFP_KERNEL); @@ -934,7 +934,7 @@ int jffs2_do_crccheck_inode(struct jffs2 return ret; } -void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f) +objstatic void jffs2_do_clear_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f) { struct jffs2_full_dirent *fd, *fds; int deleted; diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 6fce703..6fe8aba 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c @@ -84,7 +84,7 @@ static int file_dirty(struct jffs2_sb_in return 0; } -int jffs2_scan_medium(struct jffs2_sb_info *c) +objstatic int jffs2_scan_medium(struct jffs2_sb_info *c) { int i, ret; uint32_t empty_blocks = 0, bad_blocks = 0; @@ -274,7 +274,7 @@ #endif return ret; } -int jffs2_fill_scan_buf (struct jffs2_sb_info *c, void *buf, +objstatic int jffs2_fill_scan_buf (struct jffs2_sb_info *c, void *buf, uint32_t ofs, uint32_t len) { int ret; @@ -292,7 +292,7 @@ int jffs2_fill_scan_buf (struct jffs2_sb return 0; } -int jffs2_scan_classify_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) +objstatic int jffs2_scan_classify_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { if ((jeb->used_size + jeb->unchecked_size) == PAD(c->cleanmarker_size) && !jeb->dirty_size && (!jeb->first_node || !jeb->first_node->next_phys) ) @@ -924,7 +924,7 @@ #endif /* CONFIG_JFFS2_FS_XATTR */ return jffs2_scan_classify_jeb(c, jeb); } -struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uint32_t ino) +objstatic struct jffs2_inode_cache *jffs2_scan_make_ino_cache(struct jffs2_sb_info *c, uint32_t ino) { struct jffs2_inode_cache *ic; @@ -1118,7 +1118,7 @@ static void rotate_list(struct list_head list_add(head, n); } -void jffs2_rotate_lists(struct jffs2_sb_info *c) +objstatic void jffs2_rotate_lists(struct jffs2_sb_info *c) { uint32_t x; uint32_t rotateby; diff --git a/fs/jffs2/security.c b/fs/jffs2/security.c index 52a9894..b3c3092 100644 --- a/fs/jffs2/security.c +++ b/fs/jffs2/security.c @@ -22,7 +22,7 @@ #include #include "nodelist.h" /* ---- Initial Security Label Attachment -------------- */ -int jffs2_init_security(struct inode *inode, struct inode *dir) +objstatic int jffs2_init_security(struct inode *inode, struct inode *dir) { int rc; size_t len; diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c index 351ba9f..2d912fb 100644 --- a/fs/jffs2/summary.c +++ b/fs/jffs2/summary.c @@ -24,7 +24,7 @@ #include #include "nodelist.h" #include "debug.h" -int jffs2_sum_init(struct jffs2_sb_info *c) +objstatic int jffs2_sum_init(struct jffs2_sb_info *c) { c->summary = kmalloc(sizeof(struct jffs2_summary), GFP_KERNEL); @@ -48,7 +48,7 @@ int jffs2_sum_init(struct jffs2_sb_info return 0; } -void jffs2_sum_exit(struct jffs2_sb_info *c) +objstatic void jffs2_sum_exit(struct jffs2_sb_info *c) { dbg_summary("called\n"); @@ -106,14 +106,14 @@ #endif /* The following 3 functions are called from scan.c to collect summary info for not closed jeb */ -int jffs2_sum_add_padding_mem(struct jffs2_summary *s, uint32_t size) +objstatic int jffs2_sum_add_padding_mem(struct jffs2_summary *s, uint32_t size) { dbg_summary("called with %u\n", size); s->sum_padded += size; return 0; } -int jffs2_sum_add_inode_mem(struct jffs2_summary *s, struct jffs2_raw_inode *ri, +objstatic int jffs2_sum_add_inode_mem(struct jffs2_summary *s, struct jffs2_raw_inode *ri, uint32_t ofs) { struct jffs2_sum_inode_mem *temp = kmalloc(sizeof(struct jffs2_sum_inode_mem), GFP_KERNEL); @@ -131,7 +131,7 @@ int jffs2_sum_add_inode_mem(struct jffs2 return jffs2_sum_add_mem(s, (union jffs2_sum_mem *)temp); } -int jffs2_sum_add_dirent_mem(struct jffs2_summary *s, struct jffs2_raw_dirent *rd, +objstatic int jffs2_sum_add_dirent_mem(struct jffs2_summary *s, struct jffs2_raw_dirent *rd, uint32_t ofs) { struct jffs2_sum_dirent_mem *temp = @@ -156,7 +156,7 @@ int jffs2_sum_add_dirent_mem(struct jffs } #ifdef CONFIG_JFFS2_FS_XATTR -int jffs2_sum_add_xattr_mem(struct jffs2_summary *s, struct jffs2_raw_xattr *rx, uint32_t ofs) +objstatic int jffs2_sum_add_xattr_mem(struct jffs2_summary *s, struct jffs2_raw_xattr *rx, uint32_t ofs) { struct jffs2_sum_xattr_mem *temp; @@ -174,7 +174,7 @@ int jffs2_sum_add_xattr_mem(struct jffs2 return jffs2_sum_add_mem(s, (union jffs2_sum_mem *)temp); } -int jffs2_sum_add_xref_mem(struct jffs2_summary *s, struct jffs2_raw_xref *rr, uint32_t ofs) +objstatic int jffs2_sum_add_xref_mem(struct jffs2_summary *s, struct jffs2_raw_xref *rr, uint32_t ofs) { struct jffs2_sum_xref_mem *temp; @@ -208,28 +208,28 @@ static void jffs2_sum_clean_collected(st s->sum_num = 0; } -void jffs2_sum_reset_collected(struct jffs2_summary *s) +objstatic void jffs2_sum_reset_collected(struct jffs2_summary *s) { dbg_summary("called\n"); jffs2_sum_clean_collected(s); s->sum_size = 0; } -void jffs2_sum_disable_collecting(struct jffs2_summary *s) +objstatic void jffs2_sum_disable_collecting(struct jffs2_summary *s) { dbg_summary("called\n"); jffs2_sum_clean_collected(s); s->sum_size = JFFS2_SUMMARY_NOSUM_SIZE; } -int jffs2_sum_is_disabled(struct jffs2_summary *s) +objstatic int jffs2_sum_is_disabled(struct jffs2_summary *s) { return (s->sum_size == JFFS2_SUMMARY_NOSUM_SIZE); } /* Move the collected summary information into sb (called from scan.c) */ -void jffs2_sum_move_collected(struct jffs2_sb_info *c, struct jffs2_summary *s) +objstatic void jffs2_sum_move_collected(struct jffs2_sb_info *c, struct jffs2_summary *s) { dbg_summary("oldsize=0x%x oldnum=%u => newsize=0x%x newnum=%u\n", c->summary->sum_size, c->summary->sum_num, @@ -246,7 +246,7 @@ void jffs2_sum_move_collected(struct jff /* Called from wbuf.c to collect writed node info */ -int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs, +objstatic int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs, unsigned long count, uint32_t ofs) { union jffs2_node_union *node; @@ -589,7 +589,7 @@ #endif } /* Process the summary node - called from jffs2_scan_eraseblock() */ -int jffs2_sum_scan_sumnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, +objstatic int jffs2_sum_scan_sumnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, struct jffs2_raw_summary *summary, uint32_t sumsize, uint32_t *pseudo_random) { @@ -857,7 +857,7 @@ #endif /* Write out summary information - called from jffs2_do_reserve_space */ -int jffs2_sum_write_sumnode(struct jffs2_sb_info *c) +objstatic int jffs2_sum_write_sumnode(struct jffs2_sb_info *c) { struct jffs2_raw_node_ref *summary_ref; int datasize, infosize, padsize, ret; diff --git a/fs/jffs2/summary.h b/fs/jffs2/summary.h index 6bf1f6a..929575d 100644 --- a/fs/jffs2/summary.h +++ b/fs/jffs2/summary.h @@ -168,21 +168,21 @@ #define JFFS2_SUMMARY_FRAME_SIZE (sizeof #ifdef CONFIG_JFFS2_SUMMARY /* SUMMARY SUPPORT ENABLED */ #define jffs2_sum_active() (1) -int jffs2_sum_init(struct jffs2_sb_info *c); -void jffs2_sum_exit(struct jffs2_sb_info *c); -void jffs2_sum_disable_collecting(struct jffs2_summary *s); -int jffs2_sum_is_disabled(struct jffs2_summary *s); -void jffs2_sum_reset_collected(struct jffs2_summary *s); -void jffs2_sum_move_collected(struct jffs2_sb_info *c, struct jffs2_summary *s); -int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs, +objstatic int jffs2_sum_init(struct jffs2_sb_info *c); +objstatic void jffs2_sum_exit(struct jffs2_sb_info *c); +objstatic void jffs2_sum_disable_collecting(struct jffs2_summary *s); +objstatic int jffs2_sum_is_disabled(struct jffs2_summary *s); +objstatic void jffs2_sum_reset_collected(struct jffs2_summary *s); +objstatic void jffs2_sum_move_collected(struct jffs2_sb_info *c, struct jffs2_summary *s); +objstatic int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs, unsigned long count, uint32_t to); -int jffs2_sum_write_sumnode(struct jffs2_sb_info *c); -int jffs2_sum_add_padding_mem(struct jffs2_summary *s, uint32_t size); -int jffs2_sum_add_inode_mem(struct jffs2_summary *s, struct jffs2_raw_inode *ri, uint32_t ofs); -int jffs2_sum_add_dirent_mem(struct jffs2_summary *s, struct jffs2_raw_dirent *rd, uint32_t ofs); -int jffs2_sum_add_xattr_mem(struct jffs2_summary *s, struct jffs2_raw_xattr *rx, uint32_t ofs); -int jffs2_sum_add_xref_mem(struct jffs2_summary *s, struct jffs2_raw_xref *rr, uint32_t ofs); -int jffs2_sum_scan_sumnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, +objstatic int jffs2_sum_write_sumnode(struct jffs2_sb_info *c); +objstatic int jffs2_sum_add_padding_mem(struct jffs2_summary *s, uint32_t size); +objstatic int jffs2_sum_add_inode_mem(struct jffs2_summary *s, struct jffs2_raw_inode *ri, uint32_t ofs); +objstatic int jffs2_sum_add_dirent_mem(struct jffs2_summary *s, struct jffs2_raw_dirent *rd, uint32_t ofs); +objstatic int jffs2_sum_add_xattr_mem(struct jffs2_summary *s, struct jffs2_raw_xattr *rx, uint32_t ofs); +objstatic int jffs2_sum_add_xref_mem(struct jffs2_summary *s, struct jffs2_raw_xref *rr, uint32_t ofs); +objstatic int jffs2_sum_scan_sumnode(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, struct jffs2_raw_summary *summary, uint32_t sumlen, uint32_t *pseudo_random); diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index c7e3040..342a8f3 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c @@ -536,7 +536,7 @@ #endif If ino arg is zero, do it if _any_ real (i.e. not GC) writes are outstanding. If ino arg non-zero, do it only if a write for the given inode is outstanding. */ -int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino) +objstatic int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c, uint32_t ino) { uint32_t old_wbuf_ofs; uint32_t old_wbuf_len; @@ -597,7 +597,7 @@ int jffs2_flush_wbuf_gc(struct jffs2_sb_ } /* Pad write-buffer to end and write it, wasting space. */ -int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c) +objstatic int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c) { int ret; @@ -613,7 +613,7 @@ int jffs2_flush_wbuf_pad(struct jffs2_sb return ret; } -int jffs2_flash_writev(struct jffs2_sb_info *c, const struct kvec *invecs, unsigned long count, loff_t to, size_t *retlen, uint32_t ino) +objstatic int jffs2_flash_writev(struct jffs2_sb_info *c, const struct kvec *invecs, unsigned long count, loff_t to, size_t *retlen, uint32_t ino) { struct kvec outvecs[3]; uint32_t totlen = 0; @@ -845,7 +845,7 @@ exit: * This is the entry for flash write. * Check, if we work on NAND FLASH, if so build an kvec and write it via vritev */ -int jffs2_flash_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, const u_char *buf) +objstatic int jffs2_flash_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, const u_char *buf) { struct kvec vecs[1]; @@ -860,7 +860,7 @@ int jffs2_flash_write(struct jffs2_sb_in /* Handle readback from writebuffer and ECC failure return */ -int jffs2_flash_read(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, u_char *buf) +objstatic int jffs2_flash_read(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, u_char *buf) { loff_t orbf = 0, owbf = 0, lwbf = 0; int ret; @@ -925,7 +925,7 @@ exit: /* * Check, if the out of band area is empty */ -int jffs2_check_oob_empty( struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, int mode) +objstatic int jffs2_check_oob_empty( struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, int mode) { unsigned char *buf; int ret = 0; @@ -994,7 +994,7 @@ out: * only in the first page of the first physical block, but scan for bad blocks in all * physical blocks */ -int jffs2_check_nand_cleanmarker (struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) +objstatic int jffs2_check_nand_cleanmarker (struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { struct jffs2_unknown_node n; unsigned char buf[2 * NAND_MAX_OOBSIZE]; @@ -1055,7 +1055,7 @@ int jffs2_check_nand_cleanmarker (struct return retval; } -int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) +objstatic int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) { struct jffs2_unknown_node n; int ret; @@ -1086,7 +1086,7 @@ int jffs2_write_nand_cleanmarker(struct * a bootloader or something like that. */ -int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset) +objstatic int jffs2_write_nand_badblock(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb, uint32_t bad_offset) { int ret; @@ -1158,7 +1158,7 @@ static int jffs2_nand_set_oobinfo(struct return 0; } -int jffs2_nand_flash_setup(struct jffs2_sb_info *c) +objstatic int jffs2_nand_flash_setup(struct jffs2_sb_info *c) { int res; @@ -1185,12 +1185,12 @@ #endif return res; } -void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c) +objstatic void jffs2_nand_flash_cleanup(struct jffs2_sb_info *c) { kfree(c->wbuf); } -int jffs2_dataflash_setup(struct jffs2_sb_info *c) { +objstatic int jffs2_dataflash_setup(struct jffs2_sb_info *c) { c->cleanmarker_size = 0; /* No cleanmarkers needed */ /* Initialize write buffer */ @@ -1231,11 +1231,11 @@ int jffs2_dataflash_setup(struct jffs2_s return 0; } -void jffs2_dataflash_cleanup(struct jffs2_sb_info *c) { +objstatic void jffs2_dataflash_cleanup(struct jffs2_sb_info *c) { kfree(c->wbuf); } -int jffs2_nor_wbuf_flash_setup(struct jffs2_sb_info *c) { +objstatic int jffs2_nor_wbuf_flash_setup(struct jffs2_sb_info *c) { /* Cleanmarker currently occupies whole programming regions, * either one or 2 for 8Byte STMicro flashes. */ c->cleanmarker_size = max(16u, c->mtd->writesize); @@ -1252,6 +1252,6 @@ int jffs2_nor_wbuf_flash_setup(struct jf return 0; } -void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c) { +objstatic void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c) { kfree(c->wbuf); } diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c index 0e12b75..ca0f5ea 100644 --- a/fs/jffs2/write.c +++ b/fs/jffs2/write.c @@ -21,7 +21,7 @@ #include "nodelist.h" #include "compr.h" -int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t mode, struct jffs2_raw_inode *ri) +objstatic int jffs2_do_new_inode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, uint32_t mode, struct jffs2_raw_inode *ri) { struct jffs2_inode_cache *ic; @@ -56,7 +56,7 @@ int jffs2_do_new_inode(struct jffs2_sb_i /* jffs2_write_dnode - given a raw_inode, allocate a full_dnode for it, write it to the flash, link it into the existing inode/fragment list */ -struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const unsigned char *data, uint32_t datalen, int alloc_mode) @@ -204,7 +204,7 @@ struct jffs2_full_dnode *jffs2_write_dno return fn; } -struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic struct jffs2_full_dirent *jffs2_write_dirent(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_dirent *rd, const unsigned char *name, uint32_t namelen, int alloc_mode) { @@ -333,7 +333,7 @@ struct jffs2_full_dirent *jffs2_write_di /* The OS-specific code fills in the metadata in the jffs2_raw_inode for us, so that we don't have to go digging in struct inode or its equivalent. It should set: mode, uid, gid, (starting)isize, atime, ctime, mtime */ -int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, +objstatic int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, unsigned char *buf, uint32_t offset, uint32_t writelen, uint32_t *retlen) { @@ -431,7 +431,7 @@ int jffs2_write_inode_range(struct jffs2 return ret; } -int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const char *name, int namelen) +objstatic int jffs2_do_create(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, struct jffs2_inode_info *f, struct jffs2_raw_inode *ri, const char *name, int namelen) { struct jffs2_raw_dirent *rd; struct jffs2_full_dnode *fn; @@ -527,7 +527,7 @@ int jffs2_do_create(struct jffs2_sb_info } -int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, +objstatic int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, const char *name, int namelen, struct jffs2_inode_info *dead_f, uint32_t time) { @@ -643,7 +643,7 @@ int jffs2_do_unlink(struct jffs2_sb_info } -int jffs2_do_link (struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, uint32_t ino, uint8_t type, const char *name, int namelen, uint32_t time) +objstatic int jffs2_do_link (struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, uint32_t ino, uint8_t type, const char *name, int namelen, uint32_t time) { struct jffs2_raw_dirent *rd; struct jffs2_full_dirent *fd; diff --git a/fs/jffs2/writev.c b/fs/jffs2/writev.c index c638ae1..be75d69 100644 --- a/fs/jffs2/writev.c +++ b/fs/jffs2/writev.c @@ -39,7 +39,7 @@ static inline int mtd_fake_writev(struct return ret; } -int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs, +objstatic int jffs2_flash_direct_writev(struct jffs2_sb_info *c, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen) { if (!jffs2_is_writebuffered(c)) { @@ -59,7 +59,7 @@ int jffs2_flash_direct_writev(struct jff } } -int jffs2_flash_direct_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, +objstatic int jffs2_flash_direct_write(struct jffs2_sb_info *c, loff_t ofs, size_t len, size_t *retlen, const u_char *buf) { int ret; diff --git a/fs/jffs2/xattr.c b/fs/jffs2/xattr.c index 008f91b..d9cfffa 100644 --- a/fs/jffs2/xattr.c +++ b/fs/jffs2/xattr.c @@ -630,7 +630,7 @@ static struct jffs2_xattr_ref *create_xa return ref; /* success */ } -void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) +objstatic void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) { /* It's called from jffs2_clear_inode() on inode removing. When an inode with XATTR is removed, those XATTRs must be removed. */ @@ -648,7 +648,7 @@ void jffs2_xattr_delete_inode(struct jff up_write(&c->xattr_sem); } -void jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) +objstatic void jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic) { /* It's called from jffs2_free_ino_caches() until unmounting FS. */ struct jffs2_xattr_datum *xd; @@ -732,7 +732,7 @@ static int check_xattr_ref_inode(struct * jffs2_setup_xattr_datum(c, xid, version) * is used to insert xdatum while scanning process. * -------------------------------------------------- */ -void jffs2_init_xattr_subsystem(struct jffs2_sb_info *c) +objstatic void jffs2_init_xattr_subsystem(struct jffs2_sb_info *c) { int i; @@ -761,7 +761,7 @@ static struct jffs2_xattr_datum *jffs2_f return NULL; } -void jffs2_clear_xattr_subsystem(struct jffs2_sb_info *c) +objstatic void jffs2_clear_xattr_subsystem(struct jffs2_sb_info *c) { struct jffs2_xattr_datum *xd, *_xd; struct jffs2_xattr_ref *ref, *_ref; @@ -783,7 +783,7 @@ void jffs2_clear_xattr_subsystem(struct } } -void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c) +objstatic void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c) { struct jffs2_xattr_ref *ref, *_ref; struct jffs2_xattr_datum *xd, *_xd; @@ -850,7 +850,7 @@ void jffs2_build_xattr_subsystem(struct "%u of xref found.\n", xdatum_count, xdatum_unchecked_count, xref_count); } -struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c, +objstatic struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c, uint32_t xid, uint32_t version) { struct jffs2_xattr_datum *xd, *_xd; @@ -993,7 +993,7 @@ ssize_t jffs2_listxattr(struct dentry *d return rc; } -int do_jffs2_getxattr(struct inode *inode, int xprefix, const char *xname, +objstatic int do_jffs2_getxattr(struct inode *inode, int xprefix, const char *xname, char *buffer, size_t size) { struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); @@ -1055,7 +1055,7 @@ int do_jffs2_getxattr(struct inode *inod return rc; } -int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname, +objstatic int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname, const char *buffer, size_t size, int flags) { struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); @@ -1169,7 +1169,7 @@ int do_jffs2_setxattr(struct inode *inod * jffs2_verify_xattr(c) * is used to call do_verify_xattr_datum() before garbage collecting. * -------------------------------------------------- */ -int jffs2_garbage_collect_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *xd) +objstatic int jffs2_garbage_collect_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *xd) { uint32_t totlen, length, old_ofs; int rc = -EINVAL; @@ -1207,7 +1207,7 @@ int jffs2_garbage_collect_xattr_datum(st } -int jffs2_garbage_collect_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref) +objstatic int jffs2_garbage_collect_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref) { uint32_t totlen, length, old_ofs; int rc = -EINVAL; @@ -1236,7 +1236,7 @@ int jffs2_garbage_collect_xattr_ref(stru return rc; } -int jffs2_verify_xattr(struct jffs2_sb_info *c) +objstatic int jffs2_verify_xattr(struct jffs2_sb_info *c) { struct jffs2_xattr_datum *xd, *_xd; int rc; diff --git a/fs/jffs2/xattr.h b/fs/jffs2/xattr.h index 2c19985..8616513 100644 --- a/fs/jffs2/xattr.h +++ b/fs/jffs2/xattr.h @@ -60,30 +60,30 @@ struct jffs2_xattr_ref #ifdef CONFIG_JFFS2_FS_XATTR -extern void jffs2_init_xattr_subsystem(struct jffs2_sb_info *c); -extern void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c); -extern void jffs2_clear_xattr_subsystem(struct jffs2_sb_info *c); +objstatic void jffs2_init_xattr_subsystem(struct jffs2_sb_info *c); +objstatic void jffs2_build_xattr_subsystem(struct jffs2_sb_info *c); +objstatic void jffs2_clear_xattr_subsystem(struct jffs2_sb_info *c); -extern struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c, +objstatic struct jffs2_xattr_datum *jffs2_setup_xattr_datum(struct jffs2_sb_info *c, uint32_t xid, uint32_t version); -extern void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); -extern void jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); +objstatic void jffs2_xattr_delete_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); +objstatic void jffs2_xattr_free_inode(struct jffs2_sb_info *c, struct jffs2_inode_cache *ic); -extern int jffs2_garbage_collect_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *xd); -extern int jffs2_garbage_collect_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref); -extern int jffs2_verify_xattr(struct jffs2_sb_info *c); +objstatic int jffs2_garbage_collect_xattr_datum(struct jffs2_sb_info *c, struct jffs2_xattr_datum *xd); +objstatic int jffs2_garbage_collect_xattr_ref(struct jffs2_sb_info *c, struct jffs2_xattr_ref *ref); +objstatic int jffs2_verify_xattr(struct jffs2_sb_info *c); -extern int do_jffs2_getxattr(struct inode *inode, int xprefix, const char *xname, +objstatic int do_jffs2_getxattr(struct inode *inode, int xprefix, const char *xname, char *buffer, size_t size); -extern int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname, +objstatic int do_jffs2_setxattr(struct inode *inode, int xprefix, const char *xname, const char *buffer, size_t size, int flags); extern struct xattr_handler *jffs2_xattr_handlers[]; extern struct xattr_handler jffs2_user_xattr_handler; extern struct xattr_handler jffs2_trusted_xattr_handler; -extern ssize_t jffs2_listxattr(struct dentry *, char *, size_t); +objstatic ssize_t jffs2_listxattr(struct dentry *, char *, size_t); #define jffs2_getxattr generic_getxattr #define jffs2_setxattr generic_setxattr #define jffs2_removexattr generic_removexattr @@ -107,7 +107,7 @@ #define jffs2_removexattr NULL #endif /* CONFIG_JFFS2_FS_XATTR */ #ifdef CONFIG_JFFS2_FS_SECURITY -extern int jffs2_init_security(struct inode *inode, struct inode *dir); +objstatic int jffs2_init_security(struct inode *inode, struct inode *dir); extern struct xattr_handler jffs2_security_xattr_handler; #else #define jffs2_init_security(inode,dir) (0) --- /dev/null 2006-05-09 11:31:22.656694988 +0100 +++ b/fs/jffs2/jffs2.c 2006-05-23 01:57:01.000000000 +0100 @@ -0,0 +1,41 @@ +#define objstatic static +#define ALL_IN_ONE + +#ifdef CONFIG_JFFS2_FS_XATTR +#include "xattr_trusted.c" +#include "xattr_user.c" +#include "xattr.c" +#endif +#include "background.c" +#include "build.c" +#include "compr.c" +#include "compr_rtime.c" +#include "compr_rubin.c" +#include "compr_zlib.c" +#include "debug.c" +#include "erase.c" +#include "file.c" +#include "fs.c" +#include "gc.c" +#include "ioctl.c" +#include "malloc.c" +#include "nodelist.c" +#include "nodemgmt.c" +#include "read.c" +#include "readinode.c" +#include "scan.c" +#include "summary.c" +#include "super.c" +#include "symlink.c" +#include "write.c" +#include "writev.c" +#include "dir.c" +#ifdef CONFIG_JFFS2_FS_SECURITY +#include "security.c" +#endif +#ifdef CONFIG_JFFS2_FS_POSIX_ACL +#include "acl.c" +#endif +#ifdef CONFIG_JFFS2_FS_WRITEBUFFER +#include "wbuf.c" +#endif