This is an automated email from the git hooks/post-receive script.
andyp pushed a commit to branch master
in repository gfs2-utils.
commit 015a09a937e7d850a69a5a91e15307319340a74f
Author: Andreas Gruenbacher <agruenba(a)redhat.com>
AuthorDate: Mon Mar 25 21:32:17 2019 +0000
libgfs2: Allow to suppress symbol prefixes
Add a PREFIX_SYM macro that allows to define short versions of symbols
(for example, just UNMOUNT for symbol GFS2_LOG_HEAD_UNMOUNT), to be used
in contexts where the prefix isn't helpful.
---
gfs2/libgfs2/libgfs2.h | 1 +
gfs2/libgfs2/meta.c | 55 +++++++++++++++++++++++++-------------------------
2 files changed, 29 insertions(+), 27 deletions(-)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 05e4512..f75ff1e 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -105,6 +105,7 @@ enum lgfs2_meta_type {
struct lgfs2_symbolic {
const uint32_t key;
const char *value;
+ unsigned int prefix;
};
struct lgfs2_metafield {
diff --git a/gfs2/libgfs2/meta.c b/gfs2/libgfs2/meta.c
index 04b8978..19d0c41 100644
--- a/gfs2/libgfs2/meta.c
+++ b/gfs2/libgfs2/meta.c
@@ -8,7 +8,8 @@
#endif
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
-#define SYM(x) { x, #x },
+#define SYM(x) { x, #x, 0 },
+#define PREFIX_SYM(p,x) { p##x, #p #x, sizeof #p - 1 },
const struct lgfs2_symbolic lgfs2_metatypes[] = {
SYM(GFS2_METATYPE_NONE)
@@ -70,35 +71,35 @@ SYM(GFS2_DIF_INHERIT_JDATA)
const unsigned lgfs2_di_flag_size = ARRAY_SIZE(lgfs2_di_flags);
const struct lgfs2_symbolic lgfs2_lh_flags[] = {
-SYM(GFS2_LOG_HEAD_UNMOUNT)
+PREFIX_SYM(GFS2_LOG_HEAD_, UNMOUNT)
#ifdef GFS2_HAS_LH_V2
-SYM(GFS2_LOG_HEAD_FLUSH_NORMAL)
-S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2_LFC_, AIL_FLUSH)
+PREFIX_SYM(GFS2_LFC_, RGRP_GO_SYNC)
+PREFIX_SYM(GFS2_LFC_, INODE_GO_SYNC)
+PREFIX_SYM(GFS2_LFC_, INODE_GO_INVAL)
+PREFIX_SYM(GFS2_LFC_, FREEZE_GO_SYNC)
+PREFIX_SYM(GFS2_LFC_, KILL_SB)
+PREFIX_SYM(GFS2_LFC_, DO_SYNC)
+PREFIX_SYM(GFS2_LFC_, INPLACE_RESERVE)
+PREFIX_SYM(GFS2_LFC_, WRITE_INODE)
+PREFIX_SYM(GFS2_LFC_, MAKE_FS_RO)
+PREFIX_SYM(GFS2_LFC_, SYNC_FS)
+PREFIX_SYM(GFS2_LFC_, EVICT_INODE)
+PREFIX_SYM(GFS2_LFC_, TRANS_END)
+PREFIX_SYM(GFS2_LFC_, LOGD_JFLUSH_REQD)
+PREFIX_SYM(GFS2_LFC_, LOGD_AIL_FLUSH_REQD)
#endif
};
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.