aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/file.c
diff options
context:
space:
mode:
authorJoern Engel <joern@logfs.org>2010-05-04 13:41:09 -0400
committerJoern Engel <joern@logfs.org>2010-05-04 13:41:09 -0400
commit05ebad852901cf9127a743df6ea10c0e8b1590c3 (patch)
treeeb5e200d3ca4ae15bec2cbf3731055ff29e7f73c /fs/logfs/file.c
parent20503664b008e17976bff1fdbc693c77ebd6f6c9 (diff)
logfs: commit reservations under space pressure
Ensures we only return -ENOSPC when there really is no space. Signed-off-by: Joern Engel <joern@logfs.org>
Diffstat (limited to 'fs/logfs/file.c')
-rw-r--r--fs/logfs/file.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/fs/logfs/file.c b/fs/logfs/file.c
index 370f367a933e..bf9b1cf953a6 100644
--- a/fs/logfs/file.c
+++ b/fs/logfs/file.c
@@ -161,7 +161,17 @@ static int logfs_writepage(struct page *page, struct writeback_control *wbc)
161 161
162static void logfs_invalidatepage(struct page *page, unsigned long offset) 162static void logfs_invalidatepage(struct page *page, unsigned long offset)
163{ 163{
164 move_page_to_btree(page); 164 struct logfs_block *block = logfs_block(page);
165
166 if (block->reserved_bytes) {
167 struct super_block *sb = page->mapping->host->i_sb;
168 struct logfs_super *super = logfs_super(sb);
169
170 super->s_dirty_pages -= block->reserved_bytes;
171 block->ops->free_block(sb, block);
172 BUG_ON(bitmap_weight(block->alias_map, LOGFS_BLOCK_FACTOR));
173 } else
174 move_page_to_btree(page);
165 BUG_ON(PagePrivate(page) || page->private); 175 BUG_ON(PagePrivate(page) || page->private);
166} 176}
167 177