shithub: lwext4

Download patch

ref: ef71d9b49afe0b095a7f601bb23557588c9946ec
parent: e3b6a36302245cd76cb9f7d7dab371c737f8b7c6
author: ngkaho1234 <ngkaho1234@gmail.com>
date: Mon Nov 9 23:07:50 EST 2015

Replace ext4_block_get with ext4_block_get_noread:

ext4_dir, ext4_dir_idx, ext4_extent, ext4_fs

--- a/lwext4/ext4_dir.c
+++ b/lwext4/ext4_dir.c
@@ -418,7 +418,7 @@
 	/* Load new block */
 	struct ext4_block new_block;
 
-	rc = ext4_block_get(fs->bdev, &new_block, fblock);
+	rc = ext4_block_get_noread(fs->bdev, &new_block, fblock);
 	if (rc != EOK)
 		return rc;
 
--- a/lwext4/ext4_dir_idx.c
+++ b/lwext4/ext4_dir_idx.c
@@ -361,7 +361,7 @@
 		return rc;
 
 	struct ext4_block block;
-	rc = ext4_block_get(dir->fs->bdev, &block, fblock);
+	rc = ext4_block_get_noread(dir->fs->bdev, &block, fblock);
 	if (rc != EOK)
 		return rc;
 
@@ -418,7 +418,7 @@
 
 	struct ext4_block new_block;
 
-	rc = ext4_block_get(dir->fs->bdev, &new_block, fblock);
+	rc = ext4_block_get_noread(dir->fs->bdev, &new_block, fblock);
 	if (rc != EOK) {
 		ext4_block_set(dir->fs->bdev, &block);
 		return rc;
@@ -1043,8 +1043,8 @@
 
 	/* Load new block */
 	struct ext4_block new_data_block_tmp;
-	rc = ext4_block_get(inode_ref->fs->bdev, &new_data_block_tmp,
-			    new_fblock);
+	rc = ext4_block_get_noread(inode_ref->fs->bdev, &new_data_block_tmp,
+				   new_fblock);
 	if (rc != EOK) {
 		free(sort_array);
 		free(entry_buffer);
@@ -1202,7 +1202,8 @@
 		/* load new block */
 		struct ext4_block new_block;
 		rc =
-		    ext4_block_get(inode_ref->fs->bdev, &new_block, new_fblock);
+		    ext4_block_get_noread(inode_ref->fs->bdev,
+					  &new_block, new_fblock);
 		if (rc != EOK)
 			return rc;
 
--- a/lwext4/ext4_extent.c
+++ b/lwext4/ext4_extent.c
@@ -651,7 +651,7 @@
 
 			struct ext4_block block;
 			rc =
-			    ext4_block_get(inode_ref->fs->bdev, &block, fblock);
+			    ext4_block_get_noread(inode_ref->fs->bdev, &block, fblock);
 			if (rc != EOK) {
 				ext4_balloc_free_block(inode_ref, fblock);
 				return rc;
@@ -755,7 +755,7 @@
 			return rc;
 
 		struct ext4_block block;
-		rc = ext4_block_get(inode_ref->fs->bdev, &block, new_fblock);
+		rc = ext4_block_get_noread(inode_ref->fs->bdev, &block, new_fblock);
 		if (rc != EOK)
 			return rc;
 
--- a/lwext4/ext4_fs.c
+++ b/lwext4/ext4_fs.c
@@ -306,7 +306,7 @@
 
 	struct ext4_block block_bitmap;
 	int rc =
-	    ext4_block_get(bg_ref->fs->bdev, &block_bitmap, bitmap_block_addr);
+	    ext4_block_get_noread(bg_ref->fs->bdev, &block_bitmap, bitmap_block_addr);
 	if (rc != EOK)
 		return rc;
 
@@ -393,7 +393,8 @@
 
 	struct ext4_block block_bitmap;
 	int rc =
-	    ext4_block_get(bg_ref->fs->bdev, &block_bitmap, bitmap_block_addr);
+	    ext4_block_get_noread(bg_ref->fs->bdev,
+				  &block_bitmap, bitmap_block_addr);
 	if (rc != EOK)
 		return rc;
 
@@ -453,7 +454,7 @@
 	for (fblock = first_block; fblock <= last_block; ++fblock) {
 
 		struct ext4_block block;
-		int rc = ext4_block_get(bg_ref->fs->bdev, &block, fblock);
+		int rc = ext4_block_get_noread(bg_ref->fs->bdev, &block, fblock);
 		if (rc != EOK)
 			return rc;
 
@@ -1543,7 +1544,7 @@
 		inode_ref->dirty = true;
 
 		/* Load newly allocated block */
-		rc = ext4_block_get(fs->bdev, &new_block, new_block_addr);
+		rc = ext4_block_get_noread(fs->bdev, &new_block, new_block_addr);
 		if (rc != EOK) {
 			ext4_balloc_free_block(inode_ref, new_block_addr);
 			return rc;
@@ -1590,7 +1591,7 @@
 			}
 
 			/* Load newly allocated block */
-			rc = ext4_block_get(fs->bdev, &new_block,
+			rc = ext4_block_get_noread(fs->bdev, &new_block,
 					    new_block_addr);
 
 			if (rc != EOK) {