From 02b4372727a8167d4cc75f133cebdaf81940f03a Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 2 Mar 2005 20:21:51 +0000 Subject: [PATCH] Branch: b1_4 Fix build error if _LARGEFILE64_SOURCE not defined when lustre_user.h is included. lov_user_mds_data isn't widely used, just silently drop it. Quiet compiler warning. r=jacob --- lustre/include/lustre/lustre_user.h | 10 ++++++++-- lustre/utils/lfs.c | 5 ++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lustre/include/lustre/lustre_user.h b/lustre/include/lustre/lustre_user.h index 6174457..fe82883 100644 --- a/lustre/include/lustre/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -76,16 +76,22 @@ struct lov_user_md_v1 { /* LOV EA user data (host-endian) */ #if defined(__x86_64__) || defined(__ia64__) || defined(__ppc64__) typedef struct stat lstat_t; -#else +#define HAVE_LOV_USER_MDS_DATA +#elif defined(__USE_LARGEFILE64) || defined(__KERNEL__) typedef struct stat64 lstat_t; +#define HAVE_LOV_USER_MDS_DATA #endif +/* Compile with -D_LARGEFILE64_SOURCE or -D_GNU_SOURCE (or #define) to + * use this. It is unsafe to #define those values in this header as it + * is possible the application has already #included . */ +#ifdef HAVE_LOV_USER_MDS_DATA #define lov_user_mds_data lov_user_mds_data_v1 struct lov_user_mds_data_v1 { lstat_t lmd_st; /* MDS stat struct */ struct lov_user_md_v1 lmd_lmm; /* LOV EA user data */ } __attribute__((packed)); - +#endif struct ll_recreate_obj { __u64 lrc_id; diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 7d51bd0..09bd187 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -101,9 +101,8 @@ static int lfs_setstripe(int argc, char **argv) } page_size = getpagesize(); if (st_size % page_size) - fprintf(stderr, - "WARNING: stripe size %d is not an increment of page size %d\n", - st_size, page_size); + fprintf(stderr, "WARNING: stripe size %ld is not " + "an increment of page size %d\n", st_size, page_size); // get the stripe offset st_offset = strtoul(argv[3], &end, 0); -- 1.8.3.1