diff options
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/bitmap.c | 57 | ||||
-rw-r--r-- | fs/reiserfs/inode.c | 4 | ||||
-rw-r--r-- | fs/reiserfs/journal.c | 3 |
3 files changed, 4 insertions, 60 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 */ | ||
1207 | void 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 */ | ||
1225 | void 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. */ | ||
1246 | int 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 | |||
1261 | void reiserfs_cache_bitmap_metadata(struct super_block *sb, | 1204 | void 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, | 211 | static 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 | } |
969 | int reiserfs_async_progress_wait(struct super_block *s) | 969 | |
970 | static 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); |