Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ext2fs really print the incompatible bits.
details: https://anonhg.NetBSD.org/src/rev/701280e06cb6
branches: trunk
changeset: 781359:701280e06cb6
user: christos <christos%NetBSD.org@localhost>
date: Sat Sep 01 17:01:24 2012 +0000
description:
really print the incompatible bits.
diffstat:
sys/ufs/ext2fs/ext2fs.h | 26 +++++++++++++++++++++++++-
sys/ufs/ext2fs/ext2fs_vfsops.c | 19 +++++++++++--------
2 files changed, 36 insertions(+), 9 deletions(-)
diffs (98 lines):
diff -r 904a2444b2b3 -r 701280e06cb6 sys/ufs/ext2fs/ext2fs.h
--- a/sys/ufs/ext2fs/ext2fs.h Sat Sep 01 16:19:00 2012 +0000
+++ b/sys/ufs/ext2fs/ext2fs.h Sat Sep 01 17:01:24 2012 +0000
@@ -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 @@
/* 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
diff -r 904a2444b2b3 -r 701280e06cb6 sys/ufs/ext2fs/ext2fs_vfsops.c
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c Sat Sep 01 16:19:00 2012 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c Sat Sep 01 17:01:24 2012 +0000
@@ -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 @@
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);
Home |
Main Index |
Thread Index |
Old Index