summaryrefslogtreecommitdiff
path: root/e2fsprogs/ext2fs/bmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'e2fsprogs/ext2fs/bmap.c')
-rw-r--r--e2fsprogs/ext2fs/bmap.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/e2fsprogs/ext2fs/bmap.c b/e2fsprogs/ext2fs/bmap.c
index e840044..45d49f9 100644
--- a/e2fsprogs/ext2fs/bmap.c
+++ b/e2fsprogs/ext2fs/bmap.c
@@ -25,14 +25,14 @@
#endif
extern errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino,
- struct ext2_inode *inode,
+ struct ext2_inode *inode,
char *block_buf, int bmap_flags,
blk_t block, blk_t *phys_blk);
#define inode_bmap(inode, nr) ((inode)->i_block[(nr)])
-static _BMAP_INLINE_ errcode_t block_ind_bmap(ext2_filsys fs, int flags,
- blk_t ind, char *block_buf,
+static _BMAP_INLINE_ errcode_t block_ind_bmap(ext2_filsys fs, int flags,
+ blk_t ind, char *block_buf,
int *blocks_alloc,
blk_t nr, blk_t *ret_blk)
{
@@ -95,17 +95,17 @@ static _BMAP_INLINE_ errcode_t block_ind_bmap(ext2_filsys fs, int flags,
}
static _BMAP_INLINE_ errcode_t block_dind_bmap(ext2_filsys fs, int flags,
- blk_t dind, char *block_buf,
+ blk_t dind, char *block_buf,
int *blocks_alloc,
blk_t nr, blk_t *ret_blk)
{
blk_t b;
errcode_t retval;
blk_t addr_per_block;
-
+
addr_per_block = (blk_t) fs->blocksize >> 2;
- retval = block_ind_bmap(fs, flags & ~BMAP_SET, dind, block_buf,
+ retval = block_ind_bmap(fs, flags & ~BMAP_SET, dind, block_buf,
blocks_alloc, nr / addr_per_block, &b);
if (retval)
return retval;
@@ -115,17 +115,17 @@ static _BMAP_INLINE_ errcode_t block_dind_bmap(ext2_filsys fs, int flags,
}
static _BMAP_INLINE_ errcode_t block_tind_bmap(ext2_filsys fs, int flags,
- blk_t tind, char *block_buf,
+ blk_t tind, char *block_buf,
int *blocks_alloc,
blk_t nr, blk_t *ret_blk)
{
blk_t b;
errcode_t retval;
blk_t addr_per_block;
-
+
addr_per_block = (blk_t) fs->blocksize >> 2;
- retval = block_dind_bmap(fs, flags & ~BMAP_SET, tind, block_buf,
+ retval = block_dind_bmap(fs, flags & ~BMAP_SET, tind, block_buf,
blocks_alloc, nr / addr_per_block, &b);
if (retval)
return retval;
@@ -179,7 +179,7 @@ errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
*phys_blk = inode_bmap(inode, block);
b = block ? inode_bmap(inode, block-1) : 0;
-
+
if ((*phys_blk == 0) && (bmap_flags & BMAP_ALLOC)) {
retval = ext2fs_alloc_block(fs, b, block_buf, &b);
if (retval)
@@ -190,7 +190,7 @@ errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
}
goto done;
}
-
+
/* Indirect block */
block -= EXT2_NDIR_BLOCKS;
if (block < addr_per_block) {
@@ -203,17 +203,17 @@ errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
}
b = inode_bmap(inode, EXT2_IND_BLOCK-1);
- retval = ext2fs_alloc_block(fs, b, block_buf, &b);
+ retval = ext2fs_alloc_block(fs, b, block_buf, &b);
if (retval)
goto done;
inode_bmap(inode, EXT2_IND_BLOCK) = b;
blocks_alloc++;
}
- retval = block_ind_bmap(fs, bmap_flags, b, block_buf,
+ retval = block_ind_bmap(fs, bmap_flags, b, block_buf,
&blocks_alloc, block, phys_blk);
goto done;
}
-
+
/* Doubly indirect block */
block -= addr_per_block;
if (block < addr_per_block * addr_per_block) {
@@ -226,13 +226,13 @@ errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
}
b = inode_bmap(inode, EXT2_IND_BLOCK);
- retval = ext2fs_alloc_block(fs, b, block_buf, &b);
+ retval = ext2fs_alloc_block(fs, b, block_buf, &b);
if (retval)
goto done;
inode_bmap(inode, EXT2_DIND_BLOCK) = b;
blocks_alloc++;
}
- retval = block_dind_bmap(fs, bmap_flags, b, block_buf,
+ retval = block_dind_bmap(fs, bmap_flags, b, block_buf,
&blocks_alloc, block, phys_blk);
goto done;
}
@@ -254,7 +254,7 @@ errcode_t ext2fs_bmap(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode,
inode_bmap(inode, EXT2_TIND_BLOCK) = b;
blocks_alloc++;
}
- retval = block_tind_bmap(fs, bmap_flags, b, block_buf,
+ retval = block_tind_bmap(fs, bmap_flags, b, block_buf,
&blocks_alloc, block, phys_blk);
done:
if (buf)