[Ocfs2-devel] [PATCH 0/14] ocfs2: Unify the setting of extended attributes

Joel Becker joel.becker at oracle.com
Fri Aug 28 01:35:49 PDT 2009


[PATCH 0/14] ocfs2: Unify the setting of extended attributes

ocfs2 can store extended attributes in many ways.  They can live inside
the inode's inline data area, they can be stored in a single external
block, or they can be in a "bucket" hanging off of a lookup tree.  There
are differences in how each storage type manages the attributes, and the
current ocfs2 code reflects this.

There are two entirely separate code paths for setting extended
attributes.  The first code path handles "block" storage - the inline
inode or the external block.  The second handles "bucket" storage.  They
do very similar things, but they go about them in very different ways.
This makes reading and understanding the ocfs2 xattr code harder than it
needs to be.  Worse, updating the xattr code requires understanding and
modifying both paths.

This patch series unifies the xattr set code such that inodes, block,
and buckets make the same call.  It removes most of the redundant code,
like the repeated implementations of truncating externally stored values.

The core of the implementation is the ocfs2_xa_loc structure.  This is
an in-memory representation of an ocfs2_xattr_entry.  It has operations
that allow blocks and buckets to behave differently during the xattr
modification process.  Blocks and buckets are different enough that
ocfs2_xa_loc_operations has ten different ops!  But with these
differences encapsulated, we can have a single code path to modify an
entry.

The changes don't reduce the size of the source code perceptibly (~10
lines of actual code without comments or blanks), but to my mind they
greatly improve the readability and maintainability.

I've rebased on top of 'merge-window', so they should play well with
cacheme and reflink.  So it's ready to go, unless you all find a problem
or two.

Tao and Tiger, I'd still really appreciate you going over the changes
with a find-toothed comb.

Joel

[Pull]
git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git xa_loc
[View]
http://git.kernel.org/?p=linux/kernel/git/jlbec/ocfs2.git;a=shortlog;h=xa_loc




More information about the Ocfs2-devel mailing list