Module Name: src Committed By: christos Date: Sat Sep 1 17:01:24 UTC 2012
Modified Files: src/sys/ufs/ext2fs: ext2fs.h ext2fs_vfsops.c Log Message: really print the incompatible bits. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/ufs/ext2fs/ext2fs.h cvs rdiff -u -r1.165 -r1.166 src/sys/ufs/ext2fs/ext2fs_vfsops.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/ufs/ext2fs/ext2fs.h diff -u src/sys/ufs/ext2fs/ext2fs.h:1.29 src/sys/ufs/ext2fs/ext2fs.h:1.30 --- src/sys/ufs/ext2fs/ext2fs.h:1.29 Fri Nov 27 06:16:54 2009 +++ src/sys/ufs/ext2fs/ext2fs.h Sat Sep 1 13:01:24 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs.h,v 1.29 2009/11/27 11:16:54 tsutsui Exp $ */ +/* $NetBSD: ext2fs.h,v 1.30 2012/09/01 17:01:24 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1993 @@ -198,15 +198,39 @@ struct m_ext2fs { /* compatible/incompatible features */ #define EXT2F_COMPAT_PREALLOC 0x0001 +#define EXT2F_COMPAT_AFS 0x0002 #define EXT2F_COMPAT_HASJOURNAL 0x0004 +#define EXT2F_COMPAT_EXTATTR 0x0008 #define EXT2F_COMPAT_RESIZE 0x0010 +#define EXT2F_COMPAT_DIRHASHINDEX 0x0020 +#define EXT2F_COMPAT_BITS \ + "\20" \ + "\06COMPAT_DIRHASHINDEX" \ + "\05COMPAT_RESIZE" \ + "\04COMPAT_EXTATTR" \ + "\03COMPAT_HASJOURNAL" \ + "\02COMPAT_AFS" \ + "\01COMPAT_PREALLOC" #define EXT2F_ROCOMPAT_SPARSESUPER 0x0001 #define EXT2F_ROCOMPAT_LARGEFILE 0x0002 #define EXT2F_ROCOMPAT_BTREE_DIR 0x0004 +#define EXT2F_ROCOMPAT_BITS \ + "\20" \ + "\03ROCOMPAT_BTREE_DIR" \ + "\02ROCOMPAT_LARGEFILE" \ + "\01ROCOMPAT_SPARSEBUFFER" #define EXT2F_INCOMPAT_COMP 0x0001 #define EXT2F_INCOMPAT_FTYPE 0x0002 +#define EXT2F_INCOMPAT_REPLAY_JOURNAL 0x0004 +#define EXT2F_INCOMPAT_USES_JOURNAL 0x0008 +#define EXT2F_INCOMPAT_BITS \ + "\20" \ + "\04INCOMPAT_USES_JOURNAL" \ + "\03INCOMPAT_REPLAY_JOURNAL" \ + "\02INCOMPAT_FTYPE" \ + "\01INCOMPAT_COMP" /* * Features supported in this implementation Index: src/sys/ufs/ext2fs/ext2fs_vfsops.c diff -u src/sys/ufs/ext2fs/ext2fs_vfsops.c:1.165 src/sys/ufs/ext2fs/ext2fs_vfsops.c:1.166 --- src/sys/ufs/ext2fs/ext2fs_vfsops.c:1.165 Sat Sep 1 11:46:11 2012 +++ src/sys/ufs/ext2fs/ext2fs_vfsops.c Sat Sep 1 13:01:24 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: ext2fs_vfsops.c,v 1.165 2012/09/01 15:46:11 chs Exp $ */ +/* $NetBSD: ext2fs_vfsops.c,v 1.166 2012/09/01 17:01:24 christos Exp $ */ /* * Copyright (c) 1989, 1991, 1993, 1994 @@ -60,7 +60,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.165 2012/09/01 15:46:11 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ext2fs_vfsops.c,v 1.166 2012/09/01 17:01:24 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -1249,21 +1249,24 @@ ext2fs_checksb(struct ext2fs *fs, int ro return (EINVAL); /* XXX needs translation */ } if (fs2h32(fs->e2fs_rev) > E2FS_REV0) { + char buf[256]; if (fs2h32(fs->e2fs_first_ino) != EXT2_FIRSTINO) { printf("ext2fs: unsupported first inode position\n"); return (EINVAL); /* XXX needs translation */ } u32 = fs2h32(fs->e2fs_features_incompat) & ~EXT2F_INCOMPAT_SUPP; if (u32) { - printf("ext2fs: unsupported incompat feature 0x%x\n", - u32); - return (EINVAL); /* XXX needs translation */ + snprintb(buf, sizeof(buf), EXT2F_INCOMPAT_BITS, u32); + printf("ext2fs: unsupported incompat features: %s\n", + buf); + return EINVAL; /* XXX needs translation */ } u32 = fs2h32(fs->e2fs_features_rocompat) & ~EXT2F_ROCOMPAT_SUPP; if (!ronly && u32) { - printf("ext2fs: unsupported ro-incompat feature 0x%x\n", - u32); - return (EROFS); /* XXX needs translation */ + snprintb(buf, sizeof(buf), EXT2F_ROCOMPAT_BITS, u32); + printf("ext2fs: unsupported ro-incompat features: %s\n", + buf); + return EROFS; /* XXX needs translation */ } } return (0);