fs/jffs2/: misc cleanups
PATCH 1/1 fs/jffs2/: misc cleanups
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 <[email protected]>
---
fs/jffs2/compr.c | 10 ---------- fs/jffs2/compr.h | 3 --- fs/jffs2/compr_rtime.c | 12 ++++++++---- fs/jffs2/erase.c | 3 ++- fs/jffs2/file.c | 15 +++++++++++---- fs/jffs2/fs.c | 3 ++- fs/jffs2/nodelist.h | 1 - fs/jffs2/os-linux.h | 5 ----- fs/jffs2/wbuf.c | 2 +- 9 files changed, 24 insertions(+), 30 deletions(-)
This patch was already sent on:
- 8 Jan 2005
fs/jffs2/compr.h renamed from fs/jffs2/compr.h.old +0 -3
@@ -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 */
fs/jffs2/compr.c renamed from fs/jffs2/compr.c.old +0 -10
@@ -23,16 +23,6 @@/* 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 ;
fs/jffs2/compr_rtime.c renamed from fs/jffs2/compr_rtime.c.old +8 -4
@@ -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_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 ;
fs/jffs2/nodelist.h renamed from fs/jffs2/nodelist.h.old +0 -1
@@ -460,7 +460,6 @@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
fs/jffs2/erase.c renamed from fs/jffs2/erase.c.old +2 -1
@@ -33,7 +33,8 @@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;
fs/jffs2/os-linux.h renamed from fs/jffs2/os-linux.h.old +0 -5
@@ -173,11 +173,7 @@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 @@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);
fs/jffs2/file.c renamed from fs/jffs2/file.c.old +11 -4
@@ -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 @@ .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_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 @@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 @@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
fs/jffs2/fs.c renamed from fs/jffs2/fs.c.old +2 -1
@@ -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 @@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)) {
fs/jffs2/wbuf.c renamed from fs/jffs2/wbuf.c.old +1 -1
@@ -1087,7 +1087,7 @@ }; -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;