[Ocfs2-tools-devel] [PATCH 2/2] Ocfs2-tests: Enhance truncate and tunefs-test test to solve the compilation error.

Tao Ma tao.ma at oracle.com
Mon Oct 6 00:52:20 PDT 2008


hi tristan,

Tristan Ye wrote:
> Oringal test_truncate.c and remove_slot.c use old version of ocfs2_expand_dir() function,
> which accept 3 args. Currently libocfs2 only need 2 agrs for this func.therefore,the corresponding
> testcases should be adjusted.
> 
> Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
> ---
>  programs/truncate/ocfs2-tools/test_truncate.c  |    3 +--
>  programs/tunefs-test/remove-slot/remove_slot.c |    2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/programs/truncate/ocfs2-tools/test_truncate.c b/programs/truncate/ocfs2-tools/test_truncate.c
> index 5593b5e..80b8df6 100644
> --- a/programs/truncate/ocfs2-tools/test_truncate.c
> +++ b/programs/truncate/ocfs2-tools/test_truncate.c
> @@ -146,8 +146,7 @@ static errcode_t open_test_inode(ocfs2_filesys *fs, char *name, uint64_t *ino)
>  	ret = ocfs2_link(fs, fs->fs_root_blkno, name,
>  			 tmp_blkno, OCFS2_FT_REG_FILE);
>  	if (ret == OCFS2_ET_DIR_NO_SPACE) {
> -		ret = ocfs2_expand_dir(fs, fs->fs_root_blkno,
> -				       fs->fs_root_blkno);
> +		ret = ocfs2_expand_dir(fs, fs->fs_root_blkno);
>  		if (ret)
>  			return ret;
ocfs2_expand_dir has been moved into ocfs2_link(because of inline-data). 
So it means now the user will not need to handle this issue. Please see 
ocfs2-tools/libocfs2/link.c. So you can just "return ret" if you meet 
with any error in ocfs2_link. No need to call ocfs2_expand_dir any more.

Regards,
Tao



More information about the Ocfs2-tools-devel mailing list