Commit 1f109d5a authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: make various ext4 functions be static

These functions have no need to be exported beyond file context.

No functions needed to be moved for this commit; just some function
declarations changed to be static and removed from header files.

(A similar patch was submitted by Eric Sandeen, but I wanted to handle
code movement in separate patches to make sure code changes didn't
accidentally get dropped.)
Signed-off-by: default avatarEric Sandeen <sandeen@redhat.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 5dabfc78
...@@ -489,7 +489,7 @@ void ext4_add_groupblocks(handle_t *handle, struct super_block *sb, ...@@ -489,7 +489,7 @@ void ext4_add_groupblocks(handle_t *handle, struct super_block *sb,
* Check if filesystem has nblocks free & available for allocation. * Check if filesystem has nblocks free & available for allocation.
* On success return 1, return 0 on failure. * On success return 1, return 0 on failure.
*/ */
int ext4_has_free_blocks(struct ext4_sb_info *sbi, s64 nblocks) static int ext4_has_free_blocks(struct ext4_sb_info *sbi, s64 nblocks)
{ {
s64 free_blocks, dirty_blocks, root_blocks; s64 free_blocks, dirty_blocks, root_blocks;
struct percpu_counter *fbc = &sbi->s_freeblocks_counter; struct percpu_counter *fbc = &sbi->s_freeblocks_counter;
......
...@@ -1558,8 +1558,6 @@ ext4_group_first_block_no(struct super_block *sb, ext4_group_t group_no) ...@@ -1558,8 +1558,6 @@ ext4_group_first_block_no(struct super_block *sb, ext4_group_t group_no)
void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
ext4_group_t *blockgrpp, ext4_grpblk_t *offsetp); ext4_group_t *blockgrpp, ext4_grpblk_t *offsetp);
extern struct proc_dir_entry *ext4_proc_root;
/* /*
* Timeout and state flag for lazy initialization inode thread. * Timeout and state flag for lazy initialization inode thread.
*/ */
...@@ -1623,7 +1621,6 @@ extern unsigned long ext4_bg_num_gdb(struct super_block *sb, ...@@ -1623,7 +1621,6 @@ extern unsigned long ext4_bg_num_gdb(struct super_block *sb,
extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode, extern ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
ext4_fsblk_t goal, unsigned long *count, int *errp); ext4_fsblk_t goal, unsigned long *count, int *errp);
extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi, s64 nblocks); extern int ext4_claim_free_blocks(struct ext4_sb_info *sbi, s64 nblocks);
extern int ext4_has_free_blocks(struct ext4_sb_info *sbi, s64 nblocks);
extern void ext4_add_groupblocks(handle_t *handle, struct super_block *sb, extern void ext4_add_groupblocks(handle_t *handle, struct super_block *sb,
ext4_fsblk_t block, unsigned long count); ext4_fsblk_t block, unsigned long count);
extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *); extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *);
...@@ -1667,10 +1664,6 @@ extern struct inode * ext4_orphan_get(struct super_block *, unsigned long); ...@@ -1667,10 +1664,6 @@ extern struct inode * ext4_orphan_get(struct super_block *, unsigned long);
extern unsigned long ext4_count_free_inodes(struct super_block *); extern unsigned long ext4_count_free_inodes(struct super_block *);
extern unsigned long ext4_count_dirs(struct super_block *); extern unsigned long ext4_count_dirs(struct super_block *);
extern void ext4_check_inodes_bitmap(struct super_block *); extern void ext4_check_inodes_bitmap(struct super_block *);
extern unsigned ext4_init_inode_bitmap(struct super_block *sb,
struct buffer_head *bh,
ext4_group_t group,
struct ext4_group_desc *desc);
extern void mark_bitmap_end(int start_bit, int end_bit, char *bitmap); extern void mark_bitmap_end(int start_bit, int end_bit, char *bitmap);
extern int ext4_init_inode_table(struct super_block *sb, extern int ext4_init_inode_table(struct super_block *sb,
ext4_group_t group, int barrier); ext4_group_t group, int barrier);
...@@ -1723,7 +1716,6 @@ extern void ext4_get_inode_flags(struct ext4_inode_info *); ...@@ -1723,7 +1716,6 @@ extern void ext4_get_inode_flags(struct ext4_inode_info *);
extern int ext4_alloc_da_blocks(struct inode *inode); extern int ext4_alloc_da_blocks(struct inode *inode);
extern void ext4_set_aops(struct inode *inode); extern void ext4_set_aops(struct inode *inode);
extern int ext4_writepage_trans_blocks(struct inode *); extern int ext4_writepage_trans_blocks(struct inode *);
extern int ext4_meta_trans_blocks(struct inode *, int nrblocks, int idxblocks);
extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks); extern int ext4_chunk_trans_blocks(struct inode *, int nrblocks);
extern int ext4_block_truncate_page(handle_t *handle, extern int ext4_block_truncate_page(handle_t *handle,
struct address_space *mapping, loff_t from); struct address_space *mapping, loff_t from);
......
...@@ -237,19 +237,9 @@ extern int ext4_ext_calc_credits_for_single_extent(struct inode *inode, ...@@ -237,19 +237,9 @@ extern int ext4_ext_calc_credits_for_single_extent(struct inode *inode,
extern int ext4_can_extents_be_merged(struct inode *inode, extern int ext4_can_extents_be_merged(struct inode *inode,
struct ext4_extent *ex1, struct ext4_extent *ex1,
struct ext4_extent *ex2); struct ext4_extent *ex2);
extern int ext4_ext_try_to_merge(struct inode *inode,
struct ext4_ext_path *path,
struct ext4_extent *);
extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *);
extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *, int); extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *, int);
extern int ext4_ext_walk_space(struct inode *, ext4_lblk_t, ext4_lblk_t,
ext_prepare_callback, void *);
extern struct ext4_ext_path *ext4_ext_find_extent(struct inode *, ext4_lblk_t, extern struct ext4_ext_path *ext4_ext_find_extent(struct inode *, ext4_lblk_t,
struct ext4_ext_path *); struct ext4_ext_path *);
extern int ext4_ext_search_left(struct inode *, struct ext4_ext_path *,
ext4_lblk_t *, ext4_fsblk_t *);
extern int ext4_ext_search_right(struct inode *, struct ext4_ext_path *,
ext4_lblk_t *, ext4_fsblk_t *);
extern void ext4_ext_drop_refs(struct ext4_ext_path *); extern void ext4_ext_drop_refs(struct ext4_ext_path *);
extern int ext4_ext_check_inode(struct inode *inode); extern int ext4_ext_check_inode(struct inode *inode);
#endif /* _EXT4_EXTENTS */ #endif /* _EXT4_EXTENTS */
......
...@@ -739,9 +739,9 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block, ...@@ -739,9 +739,9 @@ ext4_ext_find_extent(struct inode *inode, ext4_lblk_t block,
* insert new index [@logical;@ptr] into the block at @curp; * insert new index [@logical;@ptr] into the block at @curp;
* check where to insert: before @curp or after @curp * check where to insert: before @curp or after @curp
*/ */
int ext4_ext_insert_index(handle_t *handle, struct inode *inode, static int ext4_ext_insert_index(handle_t *handle, struct inode *inode,
struct ext4_ext_path *curp, struct ext4_ext_path *curp,
int logical, ext4_fsblk_t ptr) int logical, ext4_fsblk_t ptr)
{ {
struct ext4_extent_idx *ix; struct ext4_extent_idx *ix;
int len, err; int len, err;
...@@ -1232,9 +1232,9 @@ static int ext4_ext_create_new_leaf(handle_t *handle, struct inode *inode, ...@@ -1232,9 +1232,9 @@ static int ext4_ext_create_new_leaf(handle_t *handle, struct inode *inode,
* returns 0 at @phys * returns 0 at @phys
* return value contains 0 (success) or error code * return value contains 0 (success) or error code
*/ */
int static int ext4_ext_search_left(struct inode *inode,
ext4_ext_search_left(struct inode *inode, struct ext4_ext_path *path, struct ext4_ext_path *path,
ext4_lblk_t *logical, ext4_fsblk_t *phys) ext4_lblk_t *logical, ext4_fsblk_t *phys)
{ {
struct ext4_extent_idx *ix; struct ext4_extent_idx *ix;
struct ext4_extent *ex; struct ext4_extent *ex;
...@@ -1297,9 +1297,9 @@ ext4_ext_search_left(struct inode *inode, struct ext4_ext_path *path, ...@@ -1297,9 +1297,9 @@ ext4_ext_search_left(struct inode *inode, struct ext4_ext_path *path,
* returns 0 at @phys * returns 0 at @phys
* return value contains 0 (success) or error code * return value contains 0 (success) or error code
*/ */
int static int ext4_ext_search_right(struct inode *inode,
ext4_ext_search_right(struct inode *inode, struct ext4_ext_path *path, struct ext4_ext_path *path,
ext4_lblk_t *logical, ext4_fsblk_t *phys) ext4_lblk_t *logical, ext4_fsblk_t *phys)
{ {
struct buffer_head *bh = NULL; struct buffer_head *bh = NULL;
struct ext4_extent_header *eh; struct ext4_extent_header *eh;
...@@ -1585,9 +1585,9 @@ ext4_can_extents_be_merged(struct inode *inode, struct ext4_extent *ex1, ...@@ -1585,9 +1585,9 @@ ext4_can_extents_be_merged(struct inode *inode, struct ext4_extent *ex1,
* Returns 0 if the extents (ex and ex+1) were _not_ merged and returns * Returns 0 if the extents (ex and ex+1) were _not_ merged and returns
* 1 if they got merged. * 1 if they got merged.
*/ */
int ext4_ext_try_to_merge(struct inode *inode, static int ext4_ext_try_to_merge(struct inode *inode,
struct ext4_ext_path *path, struct ext4_ext_path *path,
struct ext4_extent *ex) struct ext4_extent *ex)
{ {
struct ext4_extent_header *eh; struct ext4_extent_header *eh;
unsigned int depth, len; unsigned int depth, len;
...@@ -1632,9 +1632,9 @@ int ext4_ext_try_to_merge(struct inode *inode, ...@@ -1632,9 +1632,9 @@ int ext4_ext_try_to_merge(struct inode *inode,
* such that there will be no overlap, and then returns 1. * such that there will be no overlap, and then returns 1.
* If there is no overlap found, it returns 0. * If there is no overlap found, it returns 0.
*/ */
unsigned int ext4_ext_check_overlap(struct inode *inode, static unsigned int ext4_ext_check_overlap(struct inode *inode,
struct ext4_extent *newext, struct ext4_extent *newext,
struct ext4_ext_path *path) struct ext4_ext_path *path)
{ {
ext4_lblk_t b1, b2; ext4_lblk_t b1, b2;
unsigned int depth, len1; unsigned int depth, len1;
...@@ -1845,9 +1845,9 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode, ...@@ -1845,9 +1845,9 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
return err; return err;
} }
int ext4_ext_walk_space(struct inode *inode, ext4_lblk_t block, static int ext4_ext_walk_space(struct inode *inode, ext4_lblk_t block,
ext4_lblk_t num, ext_prepare_callback func, ext4_lblk_t num, ext_prepare_callback func,
void *cbdata) void *cbdata)
{ {
struct ext4_ext_path *path = NULL; struct ext4_ext_path *path = NULL;
struct ext4_ext_cache cbex; struct ext4_ext_cache cbex;
......
...@@ -65,9 +65,10 @@ void mark_bitmap_end(int start_bit, int end_bit, char *bitmap) ...@@ -65,9 +65,10 @@ void mark_bitmap_end(int start_bit, int end_bit, char *bitmap)
} }
/* Initializes an uninitialized inode bitmap */ /* Initializes an uninitialized inode bitmap */
unsigned ext4_init_inode_bitmap(struct super_block *sb, struct buffer_head *bh, static unsigned ext4_init_inode_bitmap(struct super_block *sb,
ext4_group_t block_group, struct buffer_head *bh,
struct ext4_group_desc *gdp) ext4_group_t block_group,
struct ext4_group_desc *gdp)
{ {
struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_sb_info *sbi = EXT4_SB(sb);
...@@ -414,8 +415,8 @@ struct orlov_stats { ...@@ -414,8 +415,8 @@ struct orlov_stats {
* for a particular block group or flex_bg. If flex_size is 1, then g * for a particular block group or flex_bg. If flex_size is 1, then g
* is a block group number; otherwise it is flex_bg number. * is a block group number; otherwise it is flex_bg number.
*/ */
void get_orlov_stats(struct super_block *sb, ext4_group_t g, static void get_orlov_stats(struct super_block *sb, ext4_group_t g,
int flex_size, struct orlov_stats *stats) int flex_size, struct orlov_stats *stats)
{ {
struct ext4_group_desc *desc; struct ext4_group_desc *desc;
struct flex_groups *flex_group = EXT4_SB(sb)->s_flex_groups; struct flex_groups *flex_group = EXT4_SB(sb)->s_flex_groups;
......
...@@ -5543,7 +5543,7 @@ static int ext4_index_trans_blocks(struct inode *inode, int nrblocks, int chunk) ...@@ -5543,7 +5543,7 @@ static int ext4_index_trans_blocks(struct inode *inode, int nrblocks, int chunk)
* *
* Also account for superblock, inode, quota and xattr blocks * Also account for superblock, inode, quota and xattr blocks
*/ */
int ext4_meta_trans_blocks(struct inode *inode, int nrblocks, int chunk) static int ext4_meta_trans_blocks(struct inode *inode, int nrblocks, int chunk)
{ {
ext4_group_t groups, ngroups = ext4_get_groups_count(inode->i_sb); ext4_group_t groups, ngroups = ext4_get_groups_count(inode->i_sb);
int gdpblocks; int gdpblocks;
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
#define CREATE_TRACE_POINTS #define CREATE_TRACE_POINTS
#include <trace/events/ext4.h> #include <trace/events/ext4.h>
struct proc_dir_entry *ext4_proc_root; static struct proc_dir_entry *ext4_proc_root;
static struct kset *ext4_kset; static struct kset *ext4_kset;
struct ext4_lazy_init *ext4_li_info; struct ext4_lazy_init *ext4_li_info;
struct mutex ext4_li_mtx; struct mutex ext4_li_mtx;
......
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