Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ext2: Explicitly assign values to on-disk enum of filetypes

It is somewhat dangerous to use a straight enum here, because this will
reassign values of later variables if one of the earlier ones is removed.

Signed-off-by: Jan Blunck <jblunck@suse.de>
Cc: Andreas Dilger <adilger@sun.com>
Signed-off-by: Jan Kara <jack@suse.cz>

authored by

Jan Blunck and committed by
Jan Kara
ad888a1f c56818d7

+8 -8
+8 -8
include/linux/ext2_fs.h
··· 565 565 * other bits are reserved for now. 566 566 */ 567 567 enum { 568 - EXT2_FT_UNKNOWN, 569 - EXT2_FT_REG_FILE, 570 - EXT2_FT_DIR, 571 - EXT2_FT_CHRDEV, 572 - EXT2_FT_BLKDEV, 573 - EXT2_FT_FIFO, 574 - EXT2_FT_SOCK, 575 - EXT2_FT_SYMLINK, 568 + EXT2_FT_UNKNOWN = 0, 569 + EXT2_FT_REG_FILE = 1, 570 + EXT2_FT_DIR = 2, 571 + EXT2_FT_CHRDEV = 3, 572 + EXT2_FT_BLKDEV = 4, 573 + EXT2_FT_FIFO = 5, 574 + EXT2_FT_SOCK = 6, 575 + EXT2_FT_SYMLINK = 7, 576 576 EXT2_FT_MAX 577 577 }; 578 578