]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: zero out inline data using memset() instead of empty_zero_page
authorTheodore Ts'o <tytso@mit.edu>
Tue, 11 Dec 2012 08:31:49 +0000 (03:31 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 11 Dec 2012 08:31:49 +0000 (03:31 -0500)
commit739790378af5f050554be3c6c728c0f37cc59840
treeccc30335831784996b7435d10df39ee14e92afad
parentc0dbfa11f54002f9d0f2fa680f279caedfa9a1a9
ext4: zero out inline data using memset() instead of empty_zero_page

Not all architectures (in particular, sparc64) have empty_zero_page.
So instead of copying from empty_zero_page, use memset to clear the
inline data by signalling to ext4_xattr_set_entry() via a magic
pointer value, EXT4_ZERO_ATTR_VALUE, which is defined by casting -1 to
a pointer.

This fixes a build failure on sparc64, and the memset() should be more
efficient than using memcpy() anyway.

Signed-off-by: Tao Ma <boyu.mt@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/inline.c
fs/ext4/xattr.c
fs/ext4/xattr.h