Commit deba0f49 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

fs/reiserfs/: cleanups

- remove the following no longer used functions:
  - bitmap.c: reiserfs_claim_blocks_to_be_allocated()
  - bitmap.c: reiserfs_release_claimed_blocks()
  - bitmap.c: reiserfs_can_fit_pages()

- make the following functions static:
  - inode.c: restart_transaction()
  - journal.c: reiserfs_async_progress_wait()
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Acked-by: default avatarVladimir V. Saveliev <vs@namesys.com>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e4230030
...@@ -1201,63 +1201,6 @@ int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t * hint, b_blocknr_t * new ...@@ -1201,63 +1201,6 @@ int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t * hint, b_blocknr_t * new
return ret; return ret;
} }
/* These 2 functions are here to provide blocks reservation to the rest of kernel */
/* Reserve @blocks amount of blocks in fs pointed by @sb. Caller must make sure
there are actually this much blocks on the FS available */
void reiserfs_claim_blocks_to_be_allocated(struct super_block *sb, /* super block of
filesystem where
blocks should be
reserved */
int blocks /* How much to reserve */
)
{
/* Fast case, if reservation is zero - exit immediately. */
if (!blocks)
return;
spin_lock(&REISERFS_SB(sb)->bitmap_lock);
REISERFS_SB(sb)->reserved_blocks += blocks;
spin_unlock(&REISERFS_SB(sb)->bitmap_lock);
}
/* Unreserve @blocks amount of blocks in fs pointed by @sb */
void reiserfs_release_claimed_blocks(struct super_block *sb, /* super block of
filesystem where
blocks should be
reserved */
int blocks /* How much to unreserve */
)
{
/* Fast case, if unreservation is zero - exit immediately. */
if (!blocks)
return;
spin_lock(&REISERFS_SB(sb)->bitmap_lock);
REISERFS_SB(sb)->reserved_blocks -= blocks;
spin_unlock(&REISERFS_SB(sb)->bitmap_lock);
RFALSE(REISERFS_SB(sb)->reserved_blocks < 0,
"amount of blocks reserved became zero?");
}
/* This function estimates how much pages we will be able to write to FS
used for reiserfs_file_write() purposes for now. */
int reiserfs_can_fit_pages(struct super_block *sb /* superblock of filesystem
to estimate space */ )
{
int space;
spin_lock(&REISERFS_SB(sb)->bitmap_lock);
space =
(SB_FREE_BLOCKS(sb) -
REISERFS_SB(sb)->reserved_blocks) >> (PAGE_CACHE_SHIFT -
sb->s_blocksize_bits);
spin_unlock(&REISERFS_SB(sb)->bitmap_lock);
return space > 0 ? space : 0;
}
void reiserfs_cache_bitmap_metadata(struct super_block *sb, void reiserfs_cache_bitmap_metadata(struct super_block *sb,
struct buffer_head *bh, struct buffer_head *bh,
struct reiserfs_bitmap_info *info) struct reiserfs_bitmap_info *info)
......
...@@ -208,8 +208,8 @@ static int file_capable(struct inode *inode, long block) ...@@ -208,8 +208,8 @@ static int file_capable(struct inode *inode, long block)
return 0; return 0;
} }
/*static*/ int restart_transaction(struct reiserfs_transaction_handle *th, static int restart_transaction(struct reiserfs_transaction_handle *th,
struct inode *inode, struct treepath *path) struct inode *inode, struct treepath *path)
{ {
struct super_block *s = th->t_super; struct super_block *s = th->t_super;
int len = th->t_blocks_allocated; int len = th->t_blocks_allocated;
......
...@@ -966,7 +966,8 @@ static int flush_older_commits(struct super_block *s, ...@@ -966,7 +966,8 @@ static int flush_older_commits(struct super_block *s,
} }
return 0; return 0;
} }
int reiserfs_async_progress_wait(struct super_block *s)
static int reiserfs_async_progress_wait(struct super_block *s)
{ {
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
struct reiserfs_journal *j = SB_JOURNAL(s); struct reiserfs_journal *j = SB_JOURNAL(s);
......
...@@ -1703,8 +1703,6 @@ static inline int reiserfs_transaction_free_space(struct reiserfs_transaction_ha ...@@ -1703,8 +1703,6 @@ static inline int reiserfs_transaction_free_space(struct reiserfs_transaction_ha
return th->t_blocks_allocated - th->t_blocks_logged; return th->t_blocks_allocated - th->t_blocks_logged;
} }
int reiserfs_async_progress_wait(struct super_block *s);
struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct
super_block super_block
*, *,
...@@ -1859,8 +1857,6 @@ void padd_item(char *item, int total_length, int length); ...@@ -1859,8 +1857,6 @@ void padd_item(char *item, int total_length, int length);
#define GET_BLOCK_NO_IMUX 8 /* i_mutex is not held, don't preallocate */ #define GET_BLOCK_NO_IMUX 8 /* i_mutex is not held, don't preallocate */
#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ #define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */
int restart_transaction(struct reiserfs_transaction_handle *th,
struct inode *inode, struct treepath *path);
void reiserfs_read_locked_inode(struct inode *inode, void reiserfs_read_locked_inode(struct inode *inode,
struct reiserfs_iget_args *args); struct reiserfs_iget_args *args);
int reiserfs_find_actor(struct inode *inode, void *p); int reiserfs_find_actor(struct inode *inode, void *p);
...@@ -2137,9 +2133,6 @@ void reiserfs_discard_prealloc(struct reiserfs_transaction_handle *th, ...@@ -2137,9 +2133,6 @@ void reiserfs_discard_prealloc(struct reiserfs_transaction_handle *th,
struct inode *inode); struct inode *inode);
void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th); void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th);
#endif #endif
void reiserfs_claim_blocks_to_be_allocated(struct super_block *sb, int blocks);
void reiserfs_release_claimed_blocks(struct super_block *sb, int blocks);
int reiserfs_can_fit_pages(struct super_block *sb);
/* hashes.c */ /* hashes.c */
__u32 keyed_hash(const signed char *msg, int len); __u32 keyed_hash(const signed char *msg, int len);
......
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