Whamcloud - gitweb
libext2fs: avoid pointless EA block allocation
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 27 Jan 2015 16:02:30 +0000 (11:02 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 27 Jan 2015 18:09:52 +0000 (13:09 -0500)
commitf99143146a2a71ccf6fe6cca074cd7b2677f7b52
tree3d12ab132dcf314a7c1628d8e537c9cfaa20e39d
parent366d299fe73f6e93b4182ed65d72d26705a378da
libext2fs: avoid pointless EA block allocation

Use qsort to move the inlinedata attribute to the front of the list
and the empty entries to the end.  Then we can use handle->count to
decide if we're done writing xattrs, which helps us to avoid the
situation where we're midway through the attribute list, so we
allocate an EA block to store more, but have no idea that there's
actually nothing left in the list.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ext_attr.c