Browse Source

Replace ext4_block_get with ext4_block_get_noread:

ext4_dir, ext4_dir_idx, ext4_extent, ext4_fs
pull/11/head
ngkaho1234 9 years ago
parent
commit
ef71d9b49a
  1. 2
      lwext4/ext4_dir.c
  2. 9
      lwext4/ext4_dir_idx.c
  3. 4
      lwext4/ext4_extent.c
  4. 11
      lwext4/ext4_fs.c

2
lwext4/ext4_dir.c

@ -418,7 +418,7 @@ int ext4_dir_add_entry(struct ext4_inode_ref *parent, const char *name,
/* 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;

9
lwext4/ext4_dir_idx.c

@ -361,7 +361,7 @@ int ext4_dir_dx_init(struct ext4_inode_ref *dir, struct ext4_inode_ref *parent)
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 @@ int ext4_dir_dx_init(struct ext4_inode_ref *dir, struct ext4_inode_ref *parent)
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,7 +1043,7 @@ static int ext4_dir_dx_split_data(struct ext4_inode_ref *inode_ref,
/* Load new block */
struct ext4_block new_data_block_tmp;
rc = ext4_block_get(inode_ref->fs->bdev, &new_data_block_tmp,
rc = ext4_block_get_noread(inode_ref->fs->bdev, &new_data_block_tmp,
new_fblock);
if (rc != EOK) {
free(sort_array);
@ -1202,7 +1202,8 @@ ext4_dir_dx_split_index(struct ext4_inode_ref *inode_ref,
/* 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;

4
lwext4/ext4_extent.c

@ -651,7 +651,7 @@ static int ext4_extent_append_extent(struct ext4_inode_ref *inode_ref,
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 @@ static int ext4_extent_append_extent(struct ext4_inode_ref *inode_ref,
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;

11
lwext4/ext4_fs.c

@ -306,7 +306,7 @@ static int ext4_fs_init_block_bitmap(struct ext4_block_group_ref *bg_ref)
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 @@ static int ext4_fs_init_inode_bitmap(struct ext4_block_group_ref *bg_ref)
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 @@ static int ext4_fs_init_inode_table(struct ext4_block_group_ref *bg_ref)
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 @@ static int ext4_fs_set_inode_data_block_index(struct ext4_inode_ref *inode_ref,
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 @@ static int ext4_fs_set_inode_data_block_index(struct ext4_inode_ref *inode_ref,
}
/* 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) {

Loading…
Cancel
Save