From 12d2b04f2204bc087f380cb214a29c126f50d709 Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Tue, 29 Oct 2013 10:37:06 +0800 Subject: [PATCH] LU-3544 fid: add a connect flag for open by FID Add OBD_CONNECT_OPEN_BY_FID for open by FID, if MDS supports this , for open by FID, it won't retry with name if object with the FID doesn't exist; while if client supports this, client won't pack name in open request if FID is known. Signed-off-by: Lai Siyao Change-Id: I158b96e8f55fe357b3542d320e894aeca18fca94 Reviewed-on: http://review.whamcloud.com/8093 Reviewed-by: John L. Hammond Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger --- lustre/include/lustre/lustre_idl.h | 2 ++ lustre/ptlrpc/wiretest.c | 8 +++++--- lustre/utils/wirecheck.c | 1 + lustre/utils/wiretest.c | 8 +++++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h index f99ef62..9b7e941 100644 --- a/lustre/include/lustre/lustre_idl.h +++ b/lustre/include/lustre/lustre_idl.h @@ -1299,6 +1299,8 @@ extern void lustre_swab_ptlrpc_body(struct ptlrpc_body *pb); #define OBD_CONNECT_PINGLESS 0x4000000000000ULL/* pings not required */ #define OBD_CONNECT_FLOCK_DEAD 0x8000000000000ULL/* improved flock deadlock detection */ #define OBD_CONNECT_DISP_STRIPE 0x10000000000000ULL/* create stripe disposition*/ +#define OBD_CONNECT_OPEN_BY_FID 0x20000000000000ULL /* open by fid won't pack + name in request */ /* XXX README XXX: * Please DO NOT add flag values here before first ensuring that this same diff --git a/lustre/ptlrpc/wiretest.c b/lustre/ptlrpc/wiretest.c index 9d6a17b..7d2781b98 100644 --- a/lustre/ptlrpc/wiretest.c +++ b/lustre/ptlrpc/wiretest.c @@ -54,8 +54,8 @@ void lustre_assert_wire_constants(void) { /* Wire protocol assertions generated by 'wirecheck' * (make -C lustre/utils newwiretest) - * running on Linux centos6-bis 2.6.32-358.0.1.el6-head #3 SMP Wed Apr 17 17:37:43 CEST 2013 - * with gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) */ + * running on Linux deva 2.6.32-358.18.1.el6_lustre.gdf685d2.x86_64 #1 SMP Sat Aug 31 20:41:4 + * with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) */ /* Constants... */ @@ -1159,7 +1159,9 @@ void lustre_assert_wire_constants(void) LASSERTF(OBD_CONNECT_PINGLESS == 0x4000000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_PINGLESS); LASSERTF(OBD_CONNECT_FLOCK_DEAD == 0x8000000000000ULL, "found 0x%.16llxULL\n", - OBD_CONNECT_FLOCK_DEAD); + OBD_CONNECT_FLOCK_DEAD); + LASSERTF(OBD_CONNECT_OPEN_BY_FID == 0x20000000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_OPEN_BY_FID); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)OBD_CKSUM_CRC32); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n", diff --git a/lustre/utils/wirecheck.c b/lustre/utils/wirecheck.c index faa27b4..36808f7 100644 --- a/lustre/utils/wirecheck.c +++ b/lustre/utils/wirecheck.c @@ -523,6 +523,7 @@ check_obd_connect_data(void) CHECK_DEFINE_64X(OBD_CONNECT_SHORTIO); CHECK_DEFINE_64X(OBD_CONNECT_PINGLESS); CHECK_DEFINE_64X(OBD_CONNECT_FLOCK_DEAD); + CHECK_DEFINE_64X(OBD_CONNECT_OPEN_BY_FID); CHECK_VALUE_X(OBD_CKSUM_CRC32); CHECK_VALUE_X(OBD_CKSUM_ADLER); diff --git a/lustre/utils/wiretest.c b/lustre/utils/wiretest.c index 593b8aa..6581525 100644 --- a/lustre/utils/wiretest.c +++ b/lustre/utils/wiretest.c @@ -62,8 +62,8 @@ void lustre_assert_wire_constants(void) { /* Wire protocol assertions generated by 'wirecheck' * (make -C lustre/utils newwiretest) - * running on Linux centos6-bis 2.6.32-358.0.1.el6-head #3 SMP Wed Apr 17 17:37:43 CEST 2013 - * with gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) */ + * running on Linux deva 2.6.32-358.18.1.el6_lustre.gdf685d2.x86_64 #1 SMP Sat Aug 31 20:41:4 + * with gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) */ /* Constants... */ @@ -1167,7 +1167,9 @@ void lustre_assert_wire_constants(void) LASSERTF(OBD_CONNECT_PINGLESS == 0x4000000000000ULL, "found 0x%.16llxULL\n", OBD_CONNECT_PINGLESS); LASSERTF(OBD_CONNECT_FLOCK_DEAD == 0x8000000000000ULL, "found 0x%.16llxULL\n", - OBD_CONNECT_FLOCK_DEAD); + OBD_CONNECT_FLOCK_DEAD); + LASSERTF(OBD_CONNECT_OPEN_BY_FID == 0x20000000000000ULL, "found 0x%.16llxULL\n", + OBD_CONNECT_OPEN_BY_FID); LASSERTF(OBD_CKSUM_CRC32 == 0x00000001UL, "found 0x%.8xUL\n", (unsigned)OBD_CKSUM_CRC32); LASSERTF(OBD_CKSUM_ADLER == 0x00000002UL, "found 0x%.8xUL\n", -- 1.8.3.1