[Ocfs2-tools-devel] [patch 4/8] Adds slot remove mechanism in tunefs.ocfs2, take 2

Joel Becker Joel.Becker at oracle.com
Mon Jun 18 17:24:23 PDT 2007


On Fri, Jun 15, 2007 at 04:16:01PM +0800, tao.ma at oracle.com wrote:
> +static errcode_t move_group(ocfs2_filesys *fs,
> +			    struct relink_ctxt *ctxt,
> +			    struct moved_group *group)
> +{
<snip>
> +	ret = ocfs2_write_group_desc(fs, group->blkno, group->gd_buf);
<snip>
> +	ret = ocfs2_write_inode(fs, ctxt->new_inode, ctxt->dst_inode);

	I just realized, we're leaving the old chain dangling here.
That's not good.

> +static errcode_t relink_system_alloc(ocfs2_filesys *fs,
> +				     uint16_t removed_slot,
> +				     enum relink_alloc_action action)
> +{
<snip>
> +	/*iterate all the chain record and move them to the new slots. */
> +	for (i = cl->cl_next_free_rec - 1; i >= 0; i--) {
> +		ctxt.new_slot = i % opts.num_slots;
> +		if (ctxt.action == RELINK_EXTENT_ALLOC)
> +			ret = ocfs2_lookup_system_inode(fs,
> +						EXTENT_ALLOC_SYSTEM_INODE,
> +						ctxt.new_slot,
> +						&ctxt.new_inode);

	We are assuming that the extent allocs for all nodes >0 will be
empty, and this is a noop for now, correct?

Joel

-- 

 The zen have a saying:
 "When you learn how to listen, ANYONE can be your teacher."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list