[Ocfs2-tools-devel] [PATCH 2/6] extent_map: Add a parameter for ocfs2_extent_map_get_blocks.

Joel Becker Joel.Becker at oracle.com
Mon Sep 24 14:24:07 PDT 2007


On Mon, Sep 24, 2007 at 05:19:53PM +0800, Tao Ma wrote:
> extent_map: Add a parameter for ocfs2_extent_map_get_blocks.
>  	    So the extent flags can be returned.

	Wouldn't it be better to have a separate "get flags" API?  That
is, you'd ask for the extent out of the map, but then you can also ask
for the flags based on the extent data?
	I only ask because it seems silly to have this
almost-always-NULL parameter for every call.  You could rather have
ocfs2_extent_map_get_flags() that returns the flags for the extent
rather than the blkno.  Underneath, it uses the same lookup functions.
	Heck, you could turn your current function (flags and blocks)
into ocfs2_extent_map_get_full(). then do:

errcode_t ocfs2_extent_map_get_blocks(..., blkno, count
{
	return ocfs2_extent_map_get_full(..., blkno, count, NULL);
}
errcode_t ocfs2_extent_map_get_flags(..., flags)
{
	return ocfs2_extent_map_get_full(..., NULL, NULL, flags);
}

Joel

-- 

Life's Little Instruction Book #69

	"Whistle"

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