Thread (8 messages) 8 messages, 3 authors, 2012-11-09
STALE4976d

[PATCH] Remove VLAIS usage from JBD2 code

From: Behan Webster <hidden>
Date: 2012-10-30 18:39:50
Subsystem: journalling layer for block devices (jbd2), the rest · Maintainers: "Theodore Ts'o", Jan Kara, Linus Torvalds

From: Mark Charlebois <redacted>

The use of variable length arrays in structs (VLAIS) in the Linux Kernel code
precludes the use of compilers which don't implement VLAIS (for instance the
Clang compiler). Since ctx is always a 32-bit CRC, hard coding a size of 4
bytes accomplishes the same thing without the use of VLAIS. This is the same
technique already employed in fs/ext4/ext4.h

Signed-off-by: Mark Charlebois <redacted>
Signed-off-by: Behan Webster <redacted>
---
 include/linux/jbd2.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 3efc43f..efcbdfc 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1308,7 +1308,7 @@ static inline u32 jbd2_chksum(journal_t *journal, u32 crc,
 {
 	struct {
 		struct shash_desc shash;
-		char ctx[crypto_shash_descsize(journal->j_chksum_driver)];
+		char ctx[4];
 	} desc;
 	int err;
 
-- 
1.7.9.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help