[Ocfs2-tools-devel] [PATCH 1/4] defrag.ocfs2: Basic framework borrowed from fsck.ocfs2

Joel Becker Joel.Becker at oracle.com
Fri Nov 12 16:49:41 PST 2010


On Tue, Sep 07, 2010 at 10:49:05PM -0500, Goldwyn Rodrigues wrote:
> Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.de>

Hey Goldwyn,
	Sorry it's taken so long to have a look at these patches.  I'm
hoping we can get them ready for inclusion soon.

> +static void print_help(void)
> +{
> +	fprintf(stderr, "Usage: %s [-hvV] device\n", whoami);
> +	fprintf(stderr, "Options:\n");
> +	fprintf(stderr, "-h\t\t Print this help\n");
> +	fprintf(stderr, "-v\t\t Verbose output\n");
> +	fprintf(stderr, "-V\t\t Print version information\n");
> +}

	We definitely want help with the -1 and -2 options.

> +static errcode_t open_and_check(struct defrag_state *dst, char *filename,
> +				int open_flags, uint64_t blkno,
> +				uint64_t blksize)
> +{
> +	errcode_t ret;
> +
> +	ret = ocfs2_open(filename, open_flags, blkno, blksize, &dst->dst_fs);
> +	if (ret) {
> +		com_err(whoami, ret, "while opening \"%s\"", filename);
> +		goto out;
> +	}
> +
> +	if (ret) {
> +		printf("Unrecoverable errors in the super block."
> +				"Cannot continue.\n");
> +		goto out;
> +	}

	I think this second if(ret) is meaningless, right?

> +	printf("  De-fragmenting OCFS2 filesystem in %s:\n", filename);

						'on' instead of 'in'.

	I also would love to see the progress code used, but maybe you
have that in later patches?

Joel

-- 

"I think it would be a good idea."  
        - Mahatma Ghandi, when asked what he thought of Western
          civilization

Joel Becker
Senior Development Manager
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list