All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH 0/14] ocfs2: Unify the setting of extended attributes
@ 2009-08-19 19:54 Joel Becker
  2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 01/14] ocfs2: Introduce ocfs2_xa_loc Joel Becker
                   ` (14 more replies)
  0 siblings, 15 replies; 33+ messages in thread
From: Joel Becker @ 2009-08-19 19:54 UTC (permalink / raw)
  To: ocfs2-devel

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.

The current series is based on the 'fixes' branch; I'll need to rebase
it atop cachme before it can go upstream.  I wanted to send it out as it
stands now so that the concept can be reviewed while I work on
merge-window.

Tao and Tiger, I'd really appreciate you going over the changes with a
find-toothed comb.  Make sure I have my ideas about block and bucket
stuff correct, etc.  Let me know if you think this is a stupid change,
too :-)

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

^ permalink raw reply	[flat|nested] 33+ messages in thread
* [Ocfs2-devel] [PATCH 0/14] ocfs2: Unify the setting of extended attributes
@ 2009-08-28  8:35 Joel Becker
  2009-08-28  8:35 ` [Ocfs2-devel] [PATCH 10/14] ocfs2: Allocation in ocfs2_xa_prepare_entry() values in ocfs2_xa_store_value() Joel Becker
  0 siblings, 1 reply; 33+ messages in thread
From: Joel Becker @ 2009-08-28  8:35 UTC (permalink / raw)
  To: ocfs2-devel

[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

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2009-09-08  1:25 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-19 19:54 [Ocfs2-devel] [PATCH 0/14] ocfs2: Unify the setting of extended attributes Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 01/14] ocfs2: Introduce ocfs2_xa_loc Joel Becker
2009-08-27  7:48   ` Tao Ma
2009-08-27  9:28     ` Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 02/14] ocfs2: Remove xattrs via ocfs2_xa_loc Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 03/14] ocfs2: Prefix the member fields of struct ocfs2_xattr_info Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 04/14] ocfs2: Add a name_len field to ocfs2_xattr_info Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 05/14] ocfs2: Wrap calculation of name+value pair size Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 06/14] ocfs2: Set the xattr name+value pair in one place Joel Becker
2009-09-02  9:34   ` Tiger Yang
2009-09-02 10:30     ` Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 07/14] ocfs2: Handle value tree roots in ocfs2_xa_set_inline_value() Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 08/14] ocfs2: Provide ocfs2_xa_fill_value_buf() for external value processing Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 09/14] ocfs2: Teach ocfs2_xa_loc how to do its own journal work Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 10/14] ocfs2: Allocation in ocfs2_xa_prepare_entry() values in ocfs2_xa_store_value() Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 11/14] ocfs2: Gell into ocfs2_xa_set() Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 12/14] ocfs2: Let ocfs2_xa_prepare_entry() do space checks Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 13/14] ocfs2: Set xattr block entries with ocfs2_xa_set() Joel Becker
2009-08-19 19:54 ` [Ocfs2-devel] [PATCH 14/14] ocfs2: Set inline xattr " Joel Becker
2009-08-20  2:03 ` [Ocfs2-devel] [PATCH 0/14] ocfs2: Unify the setting of extended attributes Tao Ma
2009-08-28  8:35 Joel Becker
2009-08-28  8:35 ` [Ocfs2-devel] [PATCH 10/14] ocfs2: Allocation in ocfs2_xa_prepare_entry() values in ocfs2_xa_store_value() Joel Becker
2009-09-01  8:55   ` Tao Ma
2009-09-01 20:21     ` Joel Becker
2009-09-02  1:51       ` Joel Becker
2009-09-02  4:59         ` Tao Ma
2009-09-02  8:05           ` Joel Becker
2009-09-02  8:37           ` Joel Becker
2009-09-02  9:01             ` tristan.ye
2009-09-02 10:24               ` Joel Becker
2009-09-02 10:31                 ` Joel Becker
2009-09-03 10:48             ` tristan.ye
2009-09-05  1:35               ` Joel Becker
2009-09-08  1:25                 ` tristan.ye

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.