This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
cluster: RHEL5 - Add #ifdefs to allow gfs2-utils to compile on olderkernels
- From: Bob Peterson <rpeterso at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Tue, 11 Aug 2009 21:18:07 +0000 (UTC)
- Subject: cluster: RHEL5 - Add #ifdefs to allow gfs2-utils to compile on olderkernels
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=14cf0e60735aaf5f55f53d9295e17c796ae58aab
Commit: 14cf0e60735aaf5f55f53d9295e17c796ae58aab
Parent: a433f20da90644561d0433ab200ee7c54e77e935
Author: Bob Peterson <rpeterso@redhat.com>
AuthorDate: Tue Aug 11 16:19:22 2009 -0500
Committer: Bob Peterson <rpeterso@redhat.com>
CommitterDate: Tue Aug 11 16:19:22 2009 -0500
Add #ifdefs to allow gfs2-utils to compile on older kernels
bz 515370
This patch pulls in a bunch of #ifdef statements, as they appear
upstream, to allow gfs2-utils to compile properly on older kernels.
---
gfs2/edit/gfs2hex.c | 2 ++
gfs2/libgfs2/ondisk.c | 8 ++++++++
gfs2/libgfs2/structures.c | 3 ++-
gfs2/tool/sb.c | 2 ++
4 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/gfs2/edit/gfs2hex.c b/gfs2/edit/gfs2hex.c
index 869ee00..977770d 100644
--- a/gfs2/edit/gfs2hex.c
+++ b/gfs2/edit/gfs2hex.c
@@ -469,7 +469,9 @@ void gfs2_sb_print2(struct gfs2_sb *sb)
gfs2_inum_print2("quota ino ", &gfs1_quota_di);
gfs2_inum_print2("license ", &gfs1_license_di);
}
+#ifdef GFS2_HAS_UUID
print_it(" sb_uuid", "%s", NULL, str_uuid(sb->sb_uuid));
+#endif
}
/******************************************************************************
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 4d14448..60a0bd8 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -112,7 +112,9 @@ void gfs2_sb_in(struct gfs2_sb *sb, char *buf)
CPIN_08(sb, str, sb_lockproto, GFS2_LOCKNAME_LEN);
CPIN_08(sb, str, sb_locktable, GFS2_LOCKNAME_LEN);
+#ifdef GFS2_HAS_UUID
CPIN_08(sb, str, sb_uuid, sizeof(sb->sb_uuid));
+#endif
}
void gfs2_sb_out(struct gfs2_sb *sb, char *buf)
@@ -132,7 +134,9 @@ void gfs2_sb_out(struct gfs2_sb *sb, char *buf)
CPOUT_08(sb, str, sb_lockproto, GFS2_LOCKNAME_LEN);
CPOUT_08(sb, str, sb_locktable, GFS2_LOCKNAME_LEN);
+#ifdef GFS2_HAS_UUID
CPOUT_08(sb, str, sb_uuid, sizeof(sb->sb_uuid));
+#endif
}
const char *str_uuid(const unsigned char *uuid)
@@ -154,10 +158,12 @@ const char *str_uuid(const unsigned char *uuid)
return str;
}
+#ifdef GFS2_HAS_UUID
void gfs2_print_uuid(const unsigned char *uuid)
{
print_it(" uuid", "%s", NULL, str_uuid(uuid));
}
+#endif
void gfs2_sb_print(struct gfs2_sb *sb)
{
@@ -175,7 +181,9 @@ void gfs2_sb_print(struct gfs2_sb *sb)
pv(sb, sb_lockproto, "%s", NULL);
pv(sb, sb_locktable, "%s", NULL);
+#ifdef GFS2_HAS_UUID
gfs2_print_uuid(sb->sb_uuid);
+#endif
}
void gfs2_rindex_in(struct gfs2_rindex *ri, char *buf)
diff --git a/gfs2/libgfs2/structures.c b/gfs2/libgfs2/structures.c
index 8a7dc07..e5507ca 100644
--- a/gfs2/libgfs2/structures.c
+++ b/gfs2/libgfs2/structures.c
@@ -71,8 +71,9 @@ build_sb(struct gfs2_sbd *sdp, const unsigned char *uuid)
sb.sb_root_dir = sdp->md.rooti->i_di.di_num;
strcpy(sb.sb_lockproto, sdp->lockproto);
strcpy(sb.sb_locktable, sdp->locktable);
+#ifdef GFS2_HAS_UUID
memcpy(sb.sb_uuid, uuid, sizeof(sb.sb_uuid));
-
+#endif
bh = bget(&sdp->buf_list, sdp->sb_addr);
gfs2_sb_out(&sb, bh->b_data);
brelse(bh, updated);
diff --git a/gfs2/tool/sb.c b/gfs2/tool/sb.c
index 5cd91eb..ccf4039 100644
--- a/gfs2/tool/sb.c
+++ b/gfs2/tool/sb.c
@@ -164,6 +164,7 @@ do_sb(int argc, char **argv)
printf("new multihost format = %u\n",
sb.sb_multihost_format);
}
+#ifdef GFS2_HAS_UUID
} else if (strcmp(field, "uuid") == 0) {
printf("current uuid = %s\n", str_uuid(sb.sb_uuid));
@@ -193,6 +194,7 @@ do_sb(int argc, char **argv)
memcpy(sb.sb_uuid, uuid, 16);
printf("new uuid = %s\n", str_uuid(sb.sb_uuid));
}
+#endif
} else if (strcmp(field, "all") == 0) {
gfs2_sb_print(&sb);
newval = FALSE;