]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: don't force a big memset of stat data just to clear padding fields
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 May 2012 01:02:40 +0000 (18:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 7 May 2012 01:02:40 +0000 (18:02 -0700)
commit1f779f65d380a0a4a94909ceee0130011c9a8564
treec8d29b5c266d90ddbaf3982b3863d64dc2be2ca4
parent5d4ae33448baa1aa7a6e2c061a96fdbf2931efc8
vfs: don't force a big memset of stat data just to clear padding fields

Admittedly this is something that the compiler should be able to just do
for us, but gcc just isn't that smart.  And trying to use a structure
initializer (which would get us the right semantics) ends up resulting
in gcc allocating stack space for _two_ 'struct stat', and then copying
one into the other.

So do it by hand - just have a per-architecture macro that initializes
the padding fields.  And if the architecture doesn't provide one, fall
back to the old behavior of just doing the whole memset() first.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/x86/include/asm/stat.h
fs/stat.c