From 060a46f4ccefeaaeeec3e8a217bd8677da17b54c Mon Sep 17 00:00:00 2001 From: root Date: Fri, 10 Dec 2010 02:34:05 -0700 Subject: [PATCH] b=4424 Reserve obd_connect_data.ocd_max_easize field To avoid potential incompatible changes between b1_8 and master, reserve the ocd_max_easize field. The corresponding connect flag OBD_CONNECT_MAX_EASIZE has been reserved for some time already. Add several other OBD_CONNECT_ flags that have already been defined to the wirecheck/wiretest tools. --- lustre/include/lustre/lustre_idl.h | 3 ++- lustre/ptlrpc/pack_generic.c | 1 + lustre/ptlrpc/wiretest.c | 14 ++++++++++++-- lustre/utils/wirecheck.c | 6 ++++++ lustre/utils/wiretest.c | 14 ++++++++++++-- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index 665ff17..7d28f95 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -409,7 +409,8 @@ struct obd_connect_data { __u64 ocd_transno; /* Used in lustre 1.8 */ __u32 ocd_group; /* Used in lustre 1.8 */ __u32 ocd_cksum_types; /* supported checksum algorithms */ - __u64 padding1; /* also fix lustre_swab_connect */ + __u32 ocd_max_easize; /* How big LOV EA size can be on MDS */ + __u32 padding1; /* also fix lustre_swab_connect */ __u64 padding2; /* also fix lustre_swab_connect */ }; diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index 482b35a..be3f0ae 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -1979,6 +1979,7 @@ void lustre_swab_connect(struct obd_connect_data *ocd) __swab64s(&ocd->ocd_transno); __swab32s(&ocd->ocd_group); __swab32s(&ocd->ocd_cksum_types); + __swab32s(&ocd->ocd_max_easize); CLASSERT(offsetof(typeof(*ocd), padding1) != 0); CLASSERT(offsetof(typeof(*ocd), padding2) != 0); } diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index e7c47c8..329d01e 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -516,9 +516,13 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct obd_connect_data, ocd_cksum_types)); LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types) == 4, " found %lld\n", (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types)); - LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 56, " found %lld\n", + LASSERTF((int)offsetof(struct obd_connect_data, ocd_max_easize) == 56, " found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_max_easize)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_max_easize) == 4, " found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_max_easize)); + LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 60, " found %lld\n", (long long)(int)offsetof(struct obd_connect_data, padding1)); - LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 8, " found %lld\n", + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 4, " found %lld\n", (long long)(int)sizeof(((struct obd_connect_data *)0)->padding1)); LASSERTF((int)offsetof(struct obd_connect_data, padding2) == 64, " found %lld\n", (long long)(int)offsetof(struct obd_connect_data, padding2)); @@ -554,6 +558,12 @@ void lustre_assert_wire_constants(void) CLASSERT(OBD_CONNECT_FID == 0x40000000ULL); CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL); CLASSERT(OBD_CONNECT_VBR == 0x80000000ULL); + CLASSERT(OBD_CONNECT_LOV_V3 == 0x100000000ULL); + CLASSERT(OBD_CONNECT_GRANT_SHRINK == 0x200000000ULL); + CLASSERT(OBD_CONNECT_SKIP_ORPHAN == 0x400000000ULL); + CLASSERT(OBD_CONNECT_MAX_EASIZE == 0x800000000ULL); + CLASSERT(OBD_CONNECT_FULL20 == 0x1000000000ULL); + CLASSERT(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL); /* Checks for struct obdo */ LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n", diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index 29d30fe..f978997 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -210,6 +210,7 @@ static void check_obd_connect_data(void) CHECK_MEMBER(obd_connect_data, ocd_transno); CHECK_MEMBER(obd_connect_data, ocd_group); CHECK_MEMBER(obd_connect_data, ocd_cksum_types); + CHECK_MEMBER(obd_connect_data, ocd_max_easize); CHECK_MEMBER(obd_connect_data, padding1); CHECK_MEMBER(obd_connect_data, padding2); @@ -243,6 +244,11 @@ static void check_obd_connect_data(void) CHECK_CDEFINE(OBD_CONNECT_FID); CHECK_CDEFINE(OBD_CONNECT_CKSUM); CHECK_CDEFINE(OBD_CONNECT_VBR); + CHECK_CDEFINE(OBD_CONNECT_LOV_V3); + CHECK_CDEFINE(OBD_CONNECT_GRANT_SHRINK); + CHECK_CDEFINE(OBD_CONNECT_MAX_EASIZE); + CHECK_CDEFINE(OBD_CONNECT_FULL20); + CHECK_CDEFINE(OBD_CONNECT_LAYOUTLOCK); } static void diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index ac3d39e..0138e9f 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -514,9 +514,13 @@ void lustre_assert_wire_constants(void) (long long)(int)offsetof(struct obd_connect_data, ocd_cksum_types)); LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types) == 4, " found %lld\n", (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_cksum_types)); - LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 56, " found %lld\n", + LASSERTF((int)offsetof(struct obd_connect_data, ocd_max_easize) == 56, " found %lld\n", + (long long)(int)offsetof(struct obd_connect_data, ocd_max_easize)); + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->ocd_max_easize) == 4, " found %lld\n", + (long long)(int)sizeof(((struct obd_connect_data *)0)->ocd_max_easize)); + LASSERTF((int)offsetof(struct obd_connect_data, padding1) == 60, " found %lld\n", (long long)(int)offsetof(struct obd_connect_data, padding1)); - LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 8, " found %lld\n", + LASSERTF((int)sizeof(((struct obd_connect_data *)0)->padding1) == 4, " found %lld\n", (long long)(int)sizeof(((struct obd_connect_data *)0)->padding1)); LASSERTF((int)offsetof(struct obd_connect_data, padding2) == 64, " found %lld\n", (long long)(int)offsetof(struct obd_connect_data, padding2)); @@ -552,6 +556,12 @@ void lustre_assert_wire_constants(void) CLASSERT(OBD_CONNECT_FID == 0x40000000ULL); CLASSERT(OBD_CONNECT_CKSUM == 0x20000000ULL); CLASSERT(OBD_CONNECT_VBR == 0x80000000ULL); + CLASSERT(OBD_CONNECT_LOV_V3 == 0x100000000ULL); + CLASSERT(OBD_CONNECT_GRANT_SHRINK == 0x200000000ULL); + CLASSERT(OBD_CONNECT_SKIP_ORPHAN == 0x400000000ULL); + CLASSERT(OBD_CONNECT_MAX_EASIZE == 0x800000000ULL); + CLASSERT(OBD_CONNECT_FULL20 == 0x1000000000ULL); + CLASSERT(OBD_CONNECT_LAYOUTLOCK == 0x2000000000ULL); /* Checks for struct obdo */ LASSERTF((int)sizeof(struct obdo) == 208, " found %lld\n", -- 1.8.3.1