
From: Adrian Bunk <bunk@stusta.de>

This patch contains the following cleanups:
- make some needlessly global functions static
- remove the following unused global functions:
  - compr.c: jffs2_set_compression_mode
  - compr.c: jffs2_get_compression_mode

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/jffs2/compr.c       |   10 ----------
 25-akpm/fs/jffs2/compr.h       |    3 ---
 25-akpm/fs/jffs2/compr_rtime.c |   12 ++++++++----
 25-akpm/fs/jffs2/erase.c       |    3 ++-
 25-akpm/fs/jffs2/file.c        |   15 +++++++++++----
 25-akpm/fs/jffs2/fs.c          |    3 ++-
 25-akpm/fs/jffs2/nodelist.h    |    1 -
 25-akpm/fs/jffs2/os-linux.h    |    5 -----
 25-akpm/fs/jffs2/wbuf.c        |    2 +-
 9 files changed, 24 insertions(+), 30 deletions(-)

diff -puN fs/jffs2/compr.c~fs-jffs2-misc-cleanups fs/jffs2/compr.c
--- 25/fs/jffs2/compr.c~fs-jffs2-misc-cleanups	Thu Feb 17 17:04:42 2005
+++ 25-akpm/fs/jffs2/compr.c	Thu Feb 17 17:04:42 2005
@@ -23,16 +23,6 @@ static LIST_HEAD(jffs2_compressor_list);
 /* Actual compression mode */
 static int jffs2_compression_mode = JFFS2_COMPR_MODE_PRIORITY;
 
-void jffs2_set_compression_mode(int mode) 
-{
-        jffs2_compression_mode = mode;
-}
-
-int jffs2_get_compression_mode(void)
-{
-        return jffs2_compression_mode;
-}
-
 /* Statistics for blocks stored without compression */
 static uint32_t none_stat_compr_blocks=0,none_stat_decompr_blocks=0,none_stat_compr_size=0;
 
diff -puN fs/jffs2/compr.h~fs-jffs2-misc-cleanups fs/jffs2/compr.h
--- 25/fs/jffs2/compr.h~fs-jffs2-misc-cleanups	Thu Feb 17 17:04:42 2005
+++ 25-akpm/fs/jffs2/compr.h	Thu Feb 17 17:04:42 2005
@@ -41,9 +41,6 @@
 #define JFFS2_COMPR_MODE_PRIORITY   1
 #define JFFS2_COMPR_MODE_SIZE       2
 
-void jffs2_set_compression_mode(int mode);
-int jffs2_get_compression_mode(void);
-
 struct jffs2_compressor {
         struct list_head list;
         int priority;              /* used by prirority comr. mode */
diff -puN fs/jffs2/compr_rtime.c~fs-jffs2-misc-cleanups fs/jffs2/compr_rtime.c
--- 25/fs/jffs2/compr_rtime.c~fs-jffs2-misc-cleanups	Thu Feb 17 17:04:42 2005
+++ 25-akpm/fs/jffs2/compr_rtime.c	Thu Feb 17 17:04:42 2005
@@ -29,8 +29,10 @@
 #include "compr.h"
 
 /* _compress returns the compressed size, -1 if bigger */
-int jffs2_rtime_compress(unsigned char *data_in, unsigned char *cpage_out, 
-		   uint32_t *sourcelen, uint32_t *dstlen, void *model)
+static int jffs2_rtime_compress(unsigned char *data_in,
+				unsigned char *cpage_out,
+				uint32_t *sourcelen, uint32_t *dstlen,
+				void *model)
 {
 	short positions[256];
 	int outpos = 0;
@@ -69,8 +71,10 @@ int jffs2_rtime_compress(unsigned char *
 }		   
 
 
-int jffs2_rtime_decompress(unsigned char *data_in, unsigned char *cpage_out,
-		      uint32_t srclen, uint32_t destlen, void *model)
+static int jffs2_rtime_decompress(unsigned char *data_in,
+				  unsigned char *cpage_out,
+				  uint32_t srclen, uint32_t destlen,
+				  void *model)
 {
 	short positions[256];
 	int outpos = 0;
diff -puN fs/jffs2/erase.c~fs-jffs2-misc-cleanups fs/jffs2/erase.c
--- 25/fs/jffs2/erase.c~fs-jffs2-misc-cleanups	Thu Feb 17 17:04:42 2005
+++ 25-akpm/fs/jffs2/erase.c	Thu Feb 17 17:04:42 2005
@@ -33,7 +33,8 @@ static void jffs2_erase_succeeded(struct
 static void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 
-void jffs2_erase_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
+static void jffs2_erase_block(struct jffs2_sb_info *c,
+			      struct jffs2_eraseblock *jeb)
 {
 	int ret;
 	uint32_t bad_offset;
diff -puN fs/jffs2/file.c~fs-jffs2-misc-cleanups fs/jffs2/file.c
--- 25/fs/jffs2/file.c~fs-jffs2-misc-cleanups	Thu Feb 17 17:04:42 2005
+++ 25-akpm/fs/jffs2/file.c	Thu Feb 17 17:04:42 2005
@@ -25,6 +25,11 @@
 extern int generic_file_open(struct inode *, struct file *) __attribute__((weak));
 extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin) __attribute__((weak));
 
+static int jffs2_commit_write (struct file *filp, struct page *pg,
+			       unsigned start, unsigned end);
+static int jffs2_prepare_write (struct file *filp, struct page *pg,
+				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)
 {
@@ -65,7 +70,7 @@ struct address_space_operations jffs2_fi
 	.commit_write =	jffs2_commit_write
 };
 
-int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
+static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg)
 {
 	struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
 	struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
@@ -105,7 +110,7 @@ int jffs2_do_readpage_unlock(struct inod
 }
 
 
-int jffs2_readpage (struct file *filp, struct page *pg)
+static int jffs2_readpage (struct file *filp, struct page *pg)
 {
 	struct jffs2_inode_info *f = JFFS2_INODE_INFO(pg->mapping->host);
 	int ret;
@@ -116,7 +121,8 @@ int jffs2_readpage (struct file *filp, s
 	return ret;
 }
 
-int jffs2_prepare_write (struct file *filp, struct page *pg, unsigned start, unsigned end)
+static int jffs2_prepare_write (struct file *filp, struct page *pg,
+				unsigned start, unsigned end)
 {
 	struct inode *inode = pg->mapping->host;
 	struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
@@ -198,7 +204,8 @@ int jffs2_prepare_write (struct file *fi
 	return ret;
 }
 
-int jffs2_commit_write (struct file *filp, struct page *pg, unsigned start, unsigned end)
+static int jffs2_commit_write (struct file *filp, struct page *pg,
+			       unsigned start, unsigned end)
 {
 	/* Actually commit the write from the page cache page we're looking at.
 	 * For now, we write the full page out each time. It sucks, but it's simple
diff -puN fs/jffs2/fs.c~fs-jffs2-misc-cleanups fs/jffs2/fs.c
--- 25/fs/jffs2/fs.c~fs-jffs2-misc-cleanups	Thu Feb 17 17:04:42 2005
+++ 25-akpm/fs/jffs2/fs.c	Thu Feb 17 17:04:42 2005
@@ -25,6 +25,7 @@
 #include <linux/crc32.h>
 #include "nodelist.h"
 
+static int jffs2_flash_setup(struct jffs2_sb_info *c);
 
 static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
 {
@@ -644,7 +645,7 @@ void jffs2_gc_release_page(struct jffs2_
 	page_cache_release(pg);
 }
 
-int jffs2_flash_setup(struct jffs2_sb_info *c) {
+static int jffs2_flash_setup(struct jffs2_sb_info *c) {
 	int ret = 0;
 	
 	if (jffs2_cleanmarker_oob(c)) {
diff -puN fs/jffs2/nodelist.h~fs-jffs2-misc-cleanups fs/jffs2/nodelist.h
--- 25/fs/jffs2/nodelist.h~fs-jffs2-misc-cleanups	Thu Feb 17 17:04:42 2005
+++ 25-akpm/fs/jffs2/nodelist.h	Thu Feb 17 17:04:42 2005
@@ -460,7 +460,6 @@ void jffs2_rotate_lists(struct jffs2_sb_
 int jffs2_do_mount_fs(struct jffs2_sb_info *c);
 
 /* erase.c */
-void jffs2_erase_block(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
 void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count);
 
 #ifdef CONFIG_JFFS2_FS_NAND
diff -puN fs/jffs2/os-linux.h~fs-jffs2-misc-cleanups fs/jffs2/os-linux.h
--- 25/fs/jffs2/os-linux.h~fs-jffs2-misc-cleanups	Thu Feb 17 17:04:42 2005
+++ 25-akpm/fs/jffs2/os-linux.h	Thu Feb 17 17:04:42 2005
@@ -173,11 +173,7 @@ extern struct file_operations jffs2_file
 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_nolock (struct inode *inode, struct page *pg);
 int jffs2_do_readpage_unlock (struct inode *inode, struct page *pg);
-int jffs2_readpage (struct file *, struct page *);
-int jffs2_prepare_write (struct file *, struct page *, unsigned, unsigned);
-int jffs2_commit_write (struct file *, struct page *, unsigned, unsigned);
 
 /* ioctl.c */
 int jffs2_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
@@ -208,7 +204,6 @@ unsigned char *jffs2_gc_fetch_page(struc
 void jffs2_gc_release_page(struct jffs2_sb_info *c,
 			   unsigned char *pg,
 			   unsigned long *priv);
-int jffs2_flash_setup(struct jffs2_sb_info *c);
 void jffs2_flash_cleanup(struct jffs2_sb_info *c);
      
 
diff -puN fs/jffs2/wbuf.c~fs-jffs2-misc-cleanups fs/jffs2/wbuf.c
--- 25/fs/jffs2/wbuf.c~fs-jffs2-misc-cleanups	Thu Feb 17 17:04:42 2005
+++ 25-akpm/fs/jffs2/wbuf.c	Thu Feb 17 17:04:42 2005
@@ -1087,7 +1087,7 @@ static struct nand_oobinfo jffs2_oobinfo
 };
 
 
-int jffs2_nand_set_oobinfo(struct jffs2_sb_info *c)
+static int jffs2_nand_set_oobinfo(struct jffs2_sb_info *c)
 {
 	struct nand_oobinfo *oinfo = &c->mtd->oobinfo;
 
_
