[Ocfs2-devel] [PATCH 02/14] ocfs2: Remove xattrs via ocfs2_xa_loc

Joel Becker Joel.Becker at oracle.com
Tue Sep 1 01:28:17 PDT 2009


On Tue, Sep 01, 2009 at 02:03:55PM +0800, Tao Ma wrote:
> >+	if (count) {
> >+		index = ((char *)entry - (char *)&xh->xh_entries) /
> >+			sizeof(struct ocfs2_xattr_entry);
> 	index = entry - xh->xh_entries should work?

	Yes, but I never use that C math, because it confuses people.
Converting to char* means it's byte math.

Joel

-- 

Life's Little Instruction Book #30

	"Never buy a house without a fireplace."

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



More information about the Ocfs2-devel mailing list