Merge of master-melb:xfs-cmds:25844a by kenmcd.
for (i = 0, tcarg = targ; i < num_targets; i++, tcarg++) {
if (!duplicate)
- uuid_generate(tcarg->uuid);
+ platform_uuid_generate(&tcarg->uuid);
else
- uuid_copy(tcarg->uuid, mp->m_sb.sb_uuid);
+ platform_uuid_copy(&tcarg->uuid, &mp->m_sb.sb_uuid);
if (pthread_mutex_init(&tcarg->wait, NULL) != 0) {
do_log(_("Error creating thread mutex %d\n"), i);
/* do each thread in turn, each has its own UUID */
for (j = 0, tcarg = targ; j < num_targets; j++) {
- uuid_copy(ag_hdr.xfs_sb->sb_uuid, tcarg->uuid);
+ platform_uuid_copy(&ag_hdr.xfs_sb->sb_uuid,
+ &tcarg->uuid);
do_write(tcarg);
tcarg++;
}
i++, p++) {
if (array)
dbprintf("%d:", i + base);
- uuid_unparse(*p, bp);
+ platform_uuid_unparse(p, bp);
dbprintf("%s", bp);
if (i < count - 1)
dbprintf(" ");
}
if (!strcasecmp(argv[1], "generate")) {
- uuid_generate(uu);
+ platform_uuid_generate(&uu);
} else if (!strcasecmp(argv[1], "nil")) {
- uuid_clear(uu);
+ platform_uuid_clear(&uu);
} else if (!strcasecmp(argv[1], "rewrite")) {
uup = do_uuid(0, NULL);
if (!uup) {
return 0;
}
memcpy(&uu, uup, sizeof(uuid_t));
- uuid_unparse(uu, bp);
+ platform_uuid_unparse(&uu, bp);
dbprintf("old UUID = %s\n", bp);
} else {
- if (uuid_parse(argv[1], uu)) {
+ if (platform_uuid_parse(argv[1], &uu)) {
dbprintf("invalid UUID\n");
return 0;
}
break;
}
- uuid_unparse(uu, bp);
+ platform_uuid_unparse(&uu, bp);
dbprintf("new UUID = %s\n", bp);
return 0;
"for FS with an external log\n");
}
- uuid_unparse(uu, bp);
+ platform_uuid_unparse(&uu, bp);
dbprintf("UUID = %s\n", bp);
}
b+tree nodes as corrupt.
- Portability changes, get xfs_repair compiling on IRIX.
- Parent pointer updates in xfs_io checker command.
+ - Allow LDFLAGS to be overridden, for Gentoo punters.
xfsprogs-2.7.17 (05 April 2006)
- Fix libxfs access(2) check on /proc/mounts, which was
DEBUG = @debug_build@
OPTIMIZER = @opt_build@
MALLOCLIB = @malloc_lib@
+LOADERFLAGS = @LDFLAGS@
LIBUUID = @libuuid@
LIBPTHREAD = @libpthread@
# $(CXXFILES), or $(HFILES) and is used to construct the manifest list
# during the "dist" phase (packaging).
-LDFLAGS = $(LLDFLAGS)
+LDFLAGS += $(LOADERFLAGS) $(LLDFLAGS)
LDLIBS = $(LLDLIBS) $(PLDLIBS) $(MALLOCLIB)
MAKEOPTS = --no-print-directory
return uuid_compare(uu1, uu2, NULL);
}
-static __inline__ void platform_uuid_unparse(uuid_t *uu, char **buffer)
+static __inline__ void platform_uuid_unparse(uuid_t *uu, char *buffer)
{
uint32_t status;
- char *str;
- uuid_to_string(uu, &str, &status);
+ char *s;
+ uuid_to_string(uu, &s, &status);
if (status == uuid_s_ok)
- strcpy(buf, str);
- else *buf = '\0';
- free(str);
+ strcpy(buffer, s);
+ else buffer[0] = '\0';
+ free(s);
}
static __inline__ int platform_uuid_parse(char *buffer, uuid_t *uu)
return uuid_compare(uu1, uu2, NULL);
}
-static __inline__ void platform_uuid_unparse(uuid_t *uu, char **buffer)
+static __inline__ void platform_uuid_unparse(uuid_t *uu, char *buffer)
{
uint32_t status;
char *s;
uuid_to_string(uu, &s, &status);
if (status == uuid_s_ok)
- strcpy(*buffer, s);
- else *buffer[0] = '\0';
+ strcpy(buffer, s);
+ else buffer[0] = '\0';
free(s);
}
return uuid_compare(uu1, uu2, &status);
}
-static __inline__ void platform_uuid_unparse(uuid_t *uu, char **buffer)
+static __inline__ void platform_uuid_unparse(uuid_t *uu, char *buffer)
{
uint_t status;
char *s;
uuid_to_string(uu, &s, &status);
if (status == uuid_s_ok)
- strcpy(*buffer, s);
- else *buffer[0] = '\0';
+ strcpy(buffer, s);
+ else buffer[0] = '\0';
free(s);
}
return uuid_compare(*uu1, *uu2);
}
-static __inline__ void platform_uuid_unparse(uuid_t *uu, char **buffer)
+static __inline__ void platform_uuid_unparse(uuid_t *uu, char *buffer)
{
- uuid_unparse(*uu, *buffer);
+ uuid_unparse(*uu, buffer);
+}
+
+static __inline__ int platform_uuid_parse(char *buffer, uuid_t *uu)
+{
+ return uuid_parse(buffer, *uu);
}
static __inline__ int platform_uuid_is_null(uuid_t *uu)
return uuid_is_null(*uu);
}
+static __inline__ void platform_uuid_generate(uuid_t *uu)
+{
+ uuid_generate(*uu);
+}
+
+static __inline__ void platform_uuid_clear(uuid_t *uu)
+{
+ uuid_clear(*uu);
+}
+
+static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src)
+{
+ uuid_copy(*dst, *src);
+}
+
#if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ <= 1))
# define constpp const char * const *
#else
*n = ((unsigned long) *n) / (unsigned) base;
return __res;
}
-#define do_div(n,base) (__do_div(&(n), (base)))
+#define do_div(n,base) (__do_div((unsigned long long *)&(n), (base)))
#define do_mod(a, b) ((a) % (b))
#define rol32(x,y) (((x) << (y)) | ((x) >> (32 - (y))))
static int
header_check_uuid(xfs_mount_t *mp, xlog_rec_header_t *head)
{
- char uu_log[64], uu_sb[64], *uup_log = &uu_log[0], *uup_sb = &uu_sb[0];
+ char uu_log[64], uu_sb[64];
if (print_skip_uuid) return 0;
if (!platform_uuid_compare(&mp->m_sb.sb_uuid, &head->h_fs_uuid)) return 0;
- platform_uuid_unparse(&mp->m_sb.sb_uuid, &uup_sb);
- platform_uuid_unparse(&head->h_fs_uuid, &uup_log);
+ platform_uuid_unparse(&mp->m_sb.sb_uuid, uu_sb);
+ platform_uuid_unparse(&head->h_fs_uuid, uu_log);
printf(_("* ERROR: mismatched uuid in log\n"
"* SB : %s\n* log: %s\n"),
printf("\n");
}
- uuid_unparse(head->h_fs_uuid, uub);
+ platform_uuid_unparse(&head->h_fs_uuid, uub);
printf("uuid: %s format: ", uub);
switch (INT_GET(head->h_fmt, ARCH_CONVERT)) {
case XLOG_FMT_UNKNOWN:
sbp->sb_dblocks = dblocks;
sbp->sb_rblocks = rtblocks;
sbp->sb_rextents = rtextents;
- uuid_generate(uuid);
- uuid_copy(sbp->sb_uuid, uuid);
+ platform_uuid_generate(&uuid);
+ platform_uuid_copy(&sbp->sb_uuid, &uuid);
sbp->sb_logstart = logstart;
sbp->sb_rootino = sbp->sb_rbmino = sbp->sb_rsumino = NULLFSINO;
sbp->sb_rextsize = rtextblocks;