Whamcloud - gitweb
libext2fs: eliminate empty element holes in ext2_xattr_handle->attrs
authorTahsin Erdogan <tahsin@google.com>
Mon, 24 Jul 2017 02:47:05 +0000 (22:47 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 24 Jul 2017 02:47:05 +0000 (22:47 -0400)
commit7649f31d4c1d1c7bddb7e7d0235c0b4fa19f1dff
treea3d7f22109031948f80620df61d5b0dcd385e5e0
parentc270f4ec6f1ab542a4c496a5f1aa59a0edc54c07
libext2fs: eliminate empty element holes in ext2_xattr_handle->attrs

When an extended attribute is removed, its array element is emptied.
This creates holes in the array so various places that want to walk
filled elements have to do an empty element check.

Have remove operation shift remaining filled elements to the left.
This allows a simple iteration up to ext2_xattr_handle->count to walk
all filled entries, and so empty element checks become unnecessary.

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ext_attr.c