Commit 18891d81 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

[PATCH] 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: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0761f492
...@@ -23,16 +23,6 @@ static LIST_HEAD(jffs2_compressor_list); ...@@ -23,16 +23,6 @@ static LIST_HEAD(jffs2_compressor_list);
/* Actual compression mode */ /* Actual compression mode */
static int jffs2_compression_mode = JFFS2_COMPR_MODE_PRIORITY; 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 */ /* Statistics for blocks stored without compression */
static uint32_t none_stat_compr_blocks=0,none_stat_decompr_blocks=0,none_stat_compr_size=0; static uint32_t none_stat_compr_blocks=0,none_stat_decompr_blocks=0,none_stat_compr_size=0;
......
...@@ -41,9 +41,6 @@ ...@@ -41,9 +41,6 @@
#define JFFS2_COMPR_MODE_PRIORITY 1 #define JFFS2_COMPR_MODE_PRIORITY 1
#define JFFS2_COMPR_MODE_SIZE 2 #define JFFS2_COMPR_MODE_SIZE 2
void jffs2_set_compression_mode(int mode);
int jffs2_get_compression_mode(void);
struct jffs2_compressor { struct jffs2_compressor {
struct list_head list; struct list_head list;
int priority; /* used by prirority comr. mode */ int priority; /* used by prirority comr. mode */
......
...@@ -29,8 +29,10 @@ ...@@ -29,8 +29,10 @@
#include "compr.h" #include "compr.h"
/* _compress returns the compressed size, -1 if bigger */ /* _compress returns the compressed size, -1 if bigger */
int jffs2_rtime_compress(unsigned char *data_in, unsigned char *cpage_out, static int jffs2_rtime_compress(unsigned char *data_in,
uint32_t *sourcelen, uint32_t *dstlen, void *model) unsigned char *cpage_out,
uint32_t *sourcelen, uint32_t *dstlen,
void *model)
{ {
short positions[256]; short positions[256];
int outpos = 0; int outpos = 0;
...@@ -69,8 +71,10 @@ int jffs2_rtime_compress(unsigned char *data_in, unsigned char *cpage_out, ...@@ -69,8 +71,10 @@ int jffs2_rtime_compress(unsigned char *data_in, unsigned char *cpage_out,
} }
int jffs2_rtime_decompress(unsigned char *data_in, unsigned char *cpage_out, static int jffs2_rtime_decompress(unsigned char *data_in,
uint32_t srclen, uint32_t destlen, void *model) unsigned char *cpage_out,
uint32_t srclen, uint32_t destlen,
void *model)
{ {
short positions[256]; short positions[256];
int outpos = 0; int outpos = 0;
......
...@@ -33,7 +33,8 @@ static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblo ...@@ -33,7 +33,8 @@ static void jffs2_erase_succeeded(struct jffs2_sb_info *c, struct jffs2_eraseblo
static void jffs2_free_all_node_refs(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); 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); 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; int ret;
uint32_t bad_offset; uint32_t bad_offset;
......
...@@ -25,6 +25,11 @@ ...@@ -25,6 +25,11 @@
extern int generic_file_open(struct inode *, struct file *) __attribute__((weak)); 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)); 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) int jffs2_fsync(struct file *filp, struct dentry *dentry, int datasync)
{ {
...@@ -65,7 +70,7 @@ struct address_space_operations jffs2_file_address_operations = ...@@ -65,7 +70,7 @@ struct address_space_operations jffs2_file_address_operations =
.commit_write = jffs2_commit_write .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_inode_info *f = JFFS2_INODE_INFO(inode);
struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
...@@ -105,7 +110,7 @@ int jffs2_do_readpage_unlock(struct inode *inode, struct page *pg) ...@@ -105,7 +110,7 @@ int jffs2_do_readpage_unlock(struct inode *inode, struct page *pg)
} }
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); struct jffs2_inode_info *f = JFFS2_INODE_INFO(pg->mapping->host);
int ret; int ret;
...@@ -116,7 +121,8 @@ int jffs2_readpage (struct file *filp, struct page *pg) ...@@ -116,7 +121,8 @@ int jffs2_readpage (struct file *filp, struct page *pg)
return ret; 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 inode *inode = pg->mapping->host;
struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
...@@ -198,7 +204,8 @@ int jffs2_prepare_write (struct file *filp, struct page *pg, unsigned start, uns ...@@ -198,7 +204,8 @@ int jffs2_prepare_write (struct file *filp, struct page *pg, unsigned start, uns
return ret; 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. /* 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 * For now, we write the full page out each time. It sucks, but it's simple
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#include <linux/crc32.h> #include <linux/crc32.h>
#include "nodelist.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) static int jffs2_do_setattr (struct inode *inode, struct iattr *iattr)
{ {
...@@ -644,7 +645,7 @@ void jffs2_gc_release_page(struct jffs2_sb_info *c, ...@@ -644,7 +645,7 @@ void jffs2_gc_release_page(struct jffs2_sb_info *c,
page_cache_release(pg); 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; int ret = 0;
if (jffs2_cleanmarker_oob(c)) { if (jffs2_cleanmarker_oob(c)) {
......
...@@ -460,7 +460,6 @@ void jffs2_rotate_lists(struct jffs2_sb_info *c); ...@@ -460,7 +460,6 @@ void jffs2_rotate_lists(struct jffs2_sb_info *c);
int jffs2_do_mount_fs(struct jffs2_sb_info *c); int jffs2_do_mount_fs(struct jffs2_sb_info *c);
/* erase.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); void jffs2_erase_pending_blocks(struct jffs2_sb_info *c, int count);
#ifdef CONFIG_JFFS2_FS_NAND #ifdef CONFIG_JFFS2_FS_NAND
......
...@@ -173,11 +173,7 @@ extern struct file_operations jffs2_file_operations; ...@@ -173,11 +173,7 @@ extern struct file_operations jffs2_file_operations;
extern struct inode_operations jffs2_file_inode_operations; extern struct inode_operations jffs2_file_inode_operations;
extern struct address_space_operations jffs2_file_address_operations; extern struct address_space_operations jffs2_file_address_operations;
int jffs2_fsync(struct file *, struct dentry *, int); 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_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 */ /* ioctl.c */
int jffs2_ioctl(struct inode *, struct file *, unsigned int, unsigned long); int jffs2_ioctl(struct inode *, struct file *, unsigned int, unsigned long);
...@@ -208,7 +204,6 @@ unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, ...@@ -208,7 +204,6 @@ unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c,
void jffs2_gc_release_page(struct jffs2_sb_info *c, void jffs2_gc_release_page(struct jffs2_sb_info *c,
unsigned char *pg, unsigned char *pg,
unsigned long *priv); unsigned long *priv);
int jffs2_flash_setup(struct jffs2_sb_info *c);
void jffs2_flash_cleanup(struct jffs2_sb_info *c); void jffs2_flash_cleanup(struct jffs2_sb_info *c);
......
...@@ -1087,7 +1087,7 @@ static struct nand_oobinfo jffs2_oobinfo_docecc = { ...@@ -1087,7 +1087,7 @@ static struct nand_oobinfo jffs2_oobinfo_docecc = {
}; };
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; struct nand_oobinfo *oinfo = &c->mtd->oobinfo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment