aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/reiserfs/bitmap.c57
-rw-r--r--fs/reiserfs/inode.c4
-rw-r--r--fs/reiserfs/journal.c3
-rw-r--r--include/linux/reiserfs_fs.h7
4 files changed, 4 insertions, 67 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c
index b286ccb08587..2a5dd34649b3 100644
--- a/fs/reiserfs/bitmap.c
+++ b/fs/reiserfs/bitmap.c
@@ -1201,63 +1201,6 @@ int reiserfs_allocate_blocknrs(reiserfs_blocknr_hint_t * hint, b_blocknr_t * new
1201 return ret; 1201 return ret;
1202} 1202}
1203 1203
1204/* These 2 functions are here to provide blocks reservation to the rest of kernel */
1205/* Reserve @blocks amount of blocks in fs pointed by @sb. Caller must make sure
1206 there are actually this much blocks on the FS available */
1207void reiserfs_claim_blocks_to_be_allocated(struct super_block *sb, /* super block of
1208 filesystem where
1209 blocks should be
1210 reserved */
1211 int blocks /* How much to reserve */
1212 )
1213{
1214
1215 /* Fast case, if reservation is zero - exit immediately. */
1216 if (!blocks)
1217 return;
1218
1219 spin_lock(&REISERFS_SB(sb)->bitmap_lock);
1220 REISERFS_SB(sb)->reserved_blocks += blocks;
1221 spin_unlock(&REISERFS_SB(sb)->bitmap_lock);
1222}
1223
1224/* Unreserve @blocks amount of blocks in fs pointed by @sb */
1225void reiserfs_release_claimed_blocks(struct super_block *sb, /* super block of
1226 filesystem where
1227 blocks should be
1228 reserved */
1229 int blocks /* How much to unreserve */
1230 )
1231{
1232
1233 /* Fast case, if unreservation is zero - exit immediately. */
1234 if (!blocks)
1235 return;
1236
1237 spin_lock(&REISERFS_SB(sb)->bitmap_lock);
1238 REISERFS_SB(sb)->reserved_blocks -= blocks;
1239 spin_unlock(&REISERFS_SB(sb)->bitmap_lock);
1240 RFALSE(REISERFS_SB(sb)->reserved_blocks < 0,
1241 "amount of blocks reserved became zero?");
1242}
1243
1244/* This function estimates how much pages we will be able to write to FS
1245 used for reiserfs_file_write() purposes for now. */
1246int reiserfs_can_fit_pages(struct super_block *sb /* superblock of filesystem
1247 to estimate space */ )
1248{
1249 int space;
1250
1251 spin_lock(&REISERFS_SB(sb)->bitmap_lock);
1252 space =
1253 (SB_FREE_BLOCKS(sb) -
1254 REISERFS_SB(sb)->reserved_blocks) >> (PAGE_CACHE_SHIFT -
1255 sb->s_blocksize_bits);
1256 spin_unlock(&REISERFS_SB(sb)->bitmap_lock);
1257
1258 return space > 0 ? space : 0;
1259}
1260
1261void reiserfs_cache_bitmap_metadata(struct super_block *sb, 1204void reiserfs_cache_bitmap_metadata(struct super_block *sb,
1262 struct buffer_head *bh, 1205 struct buffer_head *bh,
1263 struct reiserfs_bitmap_info *info) 1206 struct reiserfs_bitmap_info *info)
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 95051d44a918..9ea12004fa57 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -208,8 +208,8 @@ static int file_capable(struct inode *inode, long block)
208 return 0; 208 return 0;
209} 209}
210 210
211/*static*/ int restart_transaction(struct reiserfs_transaction_handle *th, 211static int restart_transaction(struct reiserfs_transaction_handle *th,
212 struct inode *inode, struct treepath *path) 212 struct inode *inode, struct treepath *path)
213{ 213{
214 struct super_block *s = th->t_super; 214 struct super_block *s = th->t_super;
215 int len = th->t_blocks_allocated; 215 int len = th->t_blocks_allocated;
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index f25086aeef5f..ca8d9e86571f 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -966,7 +966,8 @@ static int flush_older_commits(struct super_block *s,
966 } 966 }
967 return 0; 967 return 0;
968} 968}
969int reiserfs_async_progress_wait(struct super_block *s) 969
970static int reiserfs_async_progress_wait(struct super_block *s)
970{ 971{
971 DEFINE_WAIT(wait); 972 DEFINE_WAIT(wait);
972 struct reiserfs_journal *j = SB_JOURNAL(s); 973 struct reiserfs_journal *j = SB_JOURNAL(s);
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index 180a9d832dde..8dcf237d3386 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -1703,8 +1703,6 @@ static inline int reiserfs_transaction_free_space(struct reiserfs_transaction_ha
1703 return th->t_blocks_allocated - th->t_blocks_logged; 1703 return th->t_blocks_allocated - th->t_blocks_logged;
1704} 1704}
1705 1705
1706int reiserfs_async_progress_wait(struct super_block *s);
1707
1708struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct 1706struct reiserfs_transaction_handle *reiserfs_persistent_transaction(struct
1709 super_block 1707 super_block
1710 *, 1708 *,
@@ -1859,8 +1857,6 @@ void padd_item(char *item, int total_length, int length);
1859#define GET_BLOCK_NO_IMUX 8 /* i_mutex is not held, don't preallocate */ 1857#define GET_BLOCK_NO_IMUX 8 /* i_mutex is not held, don't preallocate */
1860#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */ 1858#define GET_BLOCK_NO_DANGLE 16 /* don't leave any transactions running */
1861 1859
1862int restart_transaction(struct reiserfs_transaction_handle *th,
1863 struct inode *inode, struct treepath *path);
1864void reiserfs_read_locked_inode(struct inode *inode, 1860void reiserfs_read_locked_inode(struct inode *inode,
1865 struct reiserfs_iget_args *args); 1861 struct reiserfs_iget_args *args);
1866int reiserfs_find_actor(struct inode *inode, void *p); 1862int reiserfs_find_actor(struct inode *inode, void *p);
@@ -2137,9 +2133,6 @@ void reiserfs_discard_prealloc(struct reiserfs_transaction_handle *th,
2137 struct inode *inode); 2133 struct inode *inode);
2138void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th); 2134void reiserfs_discard_all_prealloc(struct reiserfs_transaction_handle *th);
2139#endif 2135#endif
2140void reiserfs_claim_blocks_to_be_allocated(struct super_block *sb, int blocks);
2141void reiserfs_release_claimed_blocks(struct super_block *sb, int blocks);
2142int reiserfs_can_fit_pages(struct super_block *sb);
2143 2136
2144/* hashes.c */ 2137/* hashes.c */
2145__u32 keyed_hash(const signed char *msg, int len); 2138__u32 keyed_hash(const signed char *msg, int len);