Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ext2fs add EXT2F_HAS_ROCOMPAT_FEATURE() macro, and c...
details: https://anonhg.NetBSD.org/src/rev/c37852fbbece
branches: trunk
changeset: 347104:c37852fbbece
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Sun Aug 14 11:40:31 2016 +0000
description:
add EXT2F_HAS_ROCOMPAT_FEATURE() macro, and change the current EXT2F_HAS_{COMPAT|INCOMPAT}_FEATURE() to take fs as first parameter
diffstat:
sys/ufs/ext2fs/ext2fs.h | 22 +++++++++++++---------
sys/ufs/ext2fs/ext2fs_xattr.c | 10 +++++-----
2 files changed, 18 insertions(+), 14 deletions(-)
diffs (88 lines):
diff -r d9d44ef77103 -r c37852fbbece sys/ufs/ext2fs/ext2fs.h
--- a/sys/ufs/ext2fs/ext2fs.h Sun Aug 14 11:31:41 2016 +0000
+++ b/sys/ufs/ext2fs/ext2fs.h Sun Aug 14 11:40:31 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ext2fs.h,v 1.43 2016/08/12 20:26:15 macallan Exp $ */
+/* $NetBSD: ext2fs.h,v 1.44 2016/08/14 11:40:31 jdolecek Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -341,14 +341,6 @@
"\02INCOMPAT_FTYPE" \
"\01INCOMPAT_COMP"
-#define EXT2F_HAS_COMPAT_FEATURE(ip, feature) \
- ((ip)->i_e2fs->e2fs.e2fs_rev >= E2FS_REV1 && \
- ((ip)->i_e2fs->e2fs.e2fs_features_compat & (feature)) != 0)
-
-#define EXT2F_HAS_INCOMPAT_FEATURE(ip, feature) \
- ((ip)->i_e2fs->e2fs.e2fs_rev >= E2FS_REV1 && \
- ((ip)->i_e2fs->e2fs.e2fs_features_incompat & (feature)) != 0)
-
/*
* Features supported in this implementation
*
@@ -375,6 +367,18 @@
*/
#define EXT2_HAS_COMPAT_FEATURE(sb, mask) \
((sb)->e2fs.e2fs_features_compat & htole32(mask))
+#define EXT2F_HAS_COMPAT_FEATURE(fs, feature) \
+ ((fs)->e2fs.e2fs_rev >= E2FS_REV1 && \
+ ((fs)->e2fs.e2fs_features_compat & (feature)) != 0)
+
+#define EXT2F_HAS_ROCOMPAT_FEATURE(fs, feature) \
+ ((fs)->e2fs.e2fs_rev >= E2FS_REV1 && \
+ ((fs)->e2fs.e2fs_features_rocompat & (feature)) != 0)
+
+#define EXT2F_HAS_INCOMPAT_FEATURE(fs, feature) \
+ ((fs)->e2fs.e2fs_rev >= E2FS_REV1 && \
+ ((fs)->e2fs.e2fs_features_incompat & (feature)) != 0)
+
/*
* Definitions of behavior on errors
diff -r d9d44ef77103 -r c37852fbbece sys/ufs/ext2fs/ext2fs_xattr.c
--- a/sys/ufs/ext2fs/ext2fs_xattr.c Sun Aug 14 11:31:41 2016 +0000
+++ b/sys/ufs/ext2fs/ext2fs_xattr.c Sun Aug 14 11:40:31 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ext2fs_xattr.c,v 1.2 2016/08/13 07:40:10 christos Exp $ */
+/* $NetBSD: ext2fs_xattr.c,v 1.3 2016/08/14 11:40:31 jdolecek Exp $ */
/*-
* Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_xattr.c,v 1.2 2016/08/13 07:40:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_xattr.c,v 1.3 2016/08/14 11:40:31 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -158,7 +158,7 @@
daddr_t xblk;
xblk = di->e2di_facl;
- if (EXT2F_HAS_INCOMPAT_FEATURE(ip, EXT2F_INCOMPAT_64BIT))
+ if (EXT2F_HAS_INCOMPAT_FEATURE(ip->i_e2fs, EXT2F_INCOMPAT_64BIT))
xblk |= (((daddr_t)di->e2di_facl_high) << 32);
/* don't do anything if no attr block was allocated */
@@ -348,7 +348,7 @@
daddr_t xblk;
xblk = di->e2di_facl;
- if (EXT2F_HAS_INCOMPAT_FEATURE(ip, EXT2F_INCOMPAT_64BIT))
+ if (EXT2F_HAS_INCOMPAT_FEATURE(ip->i_e2fs, EXT2F_INCOMPAT_64BIT))
xblk |= (((daddr_t)di->e2di_facl_high) << 32);
/* don't do anything if no attr block was allocated */
@@ -390,7 +390,7 @@
const char *prefix;
size_t listsize = 0;
- if (!EXT2F_HAS_COMPAT_FEATURE(ip, EXT2F_COMPAT_EXTATTR)) {
+ if (!EXT2F_HAS_COMPAT_FEATURE(ip->i_e2fs, EXT2F_COMPAT_EXTATTR)) {
/* no EA on the filesystem */
goto out;
}
Home |
Main Index |
Thread Index |
Old Index