summaryrefslogtreecommitdiff
path: root/src/ext4_blockdev.c
diff options
context:
space:
mode:
authorKaho Ng <ngkaho1234@gmail.com>2016-04-27 19:11:31 +0800
committerKaho Ng <ngkaho1234@gmail.com>2016-04-30 16:18:00 +0800
commit8281a97813ef19452be1ce6ec1a6c40e483f12f1 (patch)
tree46fe725d3b7de77cc98268b2d571a6fa45f37550 /src/ext4_blockdev.c
parent2a5abdbf8c1375f83edde31831cd8b0bb36bc6d8 (diff)
ext4_journal: numorous changes.
- Do not utilize jbd_block_rec::buf because it can be unreliable that jbd_block_rec::buf may be freed. - Do not need to flush buffers before a new transaction is going to reference them. - add some comments to the changes.
Diffstat (limited to 'src/ext4_blockdev.c')
-rw-r--r--src/ext4_blockdev.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ext4_blockdev.c b/src/ext4_blockdev.c
index 4b33cd2..19653bb 100644
--- a/src/ext4_blockdev.c
+++ b/src/ext4_blockdev.c
@@ -41,6 +41,8 @@
#include "ext4_debug.h"
#include "ext4_blockdev.h"
+#include "ext4_fs.h"
+#include "ext4_journal.h"
#include <string.h>
#include <stdlib.h>
@@ -188,6 +190,8 @@ int ext4_block_cache_shake(struct ext4_blockdev *bdev)
if (bdev->bc->dont_shake)
return EOK;
+ bdev->bc->dont_shake = true;
+
while (!RB_EMPTY(&bdev->bc->lru_root) &&
ext4_bcache_is_full(bdev->bc)) {
@@ -202,6 +206,7 @@ int ext4_block_cache_shake(struct ext4_blockdev *bdev)
ext4_bcache_drop_buf(bdev->bc, buf);
}
+ bdev->bc->dont_shake = false;
return r;
}