[Ocfs2-devel] [PATCH 7/8] ocfs2: Add extended attributes support. v1

Tao Ma tao.ma at oracle.com
Mon Jun 16 00:18:45 PDT 2008



Mark Fasheh wrote:
>> +
>> +#define OCFS2_XATTR_PAD_BITS	2
>> +#define OCFS2_XATTR_PAD		4
>> +#define OCFS2_XATTR_ROUND	(OCFS2_XATTR_PAD-1)
>> +#define OCFS2_XATTR_SIZE(size)	(((size) + OCFS2_XATTR_ROUND) & \
>> +				~OCFS2_XATTR_ROUND)
>> +#define OCFS2_XATTR_ROOT_SIZE	(sizeof(struct ocfs2_xattr_def_value_root))
>> +#define OCFS2_XATTR_INLINE_SIZE	80
>> +#define OCFS2_NAME_HASH_SHIFT	5
>> +#define OCFS2_VALUE_HASH_SHIFT	16
> 
> Some of these should be defined in the patch where they're actually used.
I wonder whether we should put the below lines into ocfs2_fs.h(combined 
with my previous xattr header patch)?
#define OCFS2_XATTR_PAD_BITS	2
#define OCFS2_XATTR_PAD		4
#define OCFS2_XATTR_ROUND	(OCFS2_XATTR_PAD-1)
#define OCFS2_XATTR_SIZE(size)	(((size) + OCFS2_XATTR_ROUND) & \
				~OCFS2_XATTR_ROUND)

ocfs2-tools also need this when fsck try to find the large xattr value. 
So if we put them in ocfs2_fs.h, we can keep both tools and kernel src 
synchronized easily.

Regards,
Tao



More information about the Ocfs2-devel mailing list