aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs/bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs/bitmap.c')
-rw-r--r--fs/reiserfs/bitmap.c57
1 files changed, 0 insertions, 57 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)