Revert "ext4fs: Add ext4 extent cache for read operations"
This reverts commit fc0fc50f38a4d7d0554558076a79dfe8b0d78cd5.
The author has asked on the mailing list that we revert this for now as
it breaks write support.
Reported-by: Ćukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Tom Rini <trini@ti.com>
diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c
index 4f1b4c8..417ce7b 100644
--- a/fs/ext4/ext4fs.c
+++ b/fs/ext4/ext4fs.c
@@ -63,14 +63,6 @@
char *delayed_buf = NULL;
short status;
- if (le32_to_cpu(node->inode.flags) & EXT4_EXTENTS_FL) {
- if (ext4fs_build_extent_cache(&node->inode)) {
- printf("Error building extent cache!\n");
- len = -1;
- goto out_exit;
- }
- }
-
/* Adjust len so it we can't read past the end of the file. */
if (len > filesize)
len = filesize;
@@ -83,10 +75,8 @@
int blockend = blocksize;
int skipfirst = 0;
blknr = read_allocated_block(&(node->inode), i);
- if (blknr < 0) {
- len = -1;
- goto out_exit;
- }
+ if (blknr < 0)
+ return -1;
blknr = blknr << log2_fs_blocksize;
@@ -116,10 +106,8 @@
delayed_skipfirst,
delayed_extent,
delayed_buf);
- if (status == 0) {
- len = -1;
- goto out_exit;
- }
+ if (status == 0)
+ return -1;
previous_block_number = blknr;
delayed_start = blknr;
delayed_extent = blockend;
@@ -144,10 +132,8 @@
delayed_skipfirst,
delayed_extent,
delayed_buf);
- if (status == 0) {
- len = -1;
- goto out_exit;
- }
+ if (status == 0)
+ return -1;
previous_block_number = -1;
}
memset(buf, 0, blocksize - skipfirst);
@@ -159,17 +145,11 @@
status = ext4fs_devread(delayed_start,
delayed_skipfirst, delayed_extent,
delayed_buf);
- if (status == 0) {
- len = -1;
- goto out_exit;
- }
+ if (status == 0)
+ return -1;
previous_block_number = -1;
}
-
-out_exit:
- ext4fs_free_extent_cache();
-
return len;
}