Whamcloud - gitweb
LU-5319 ptlrpc: Add OBD_CONNECT_MULTIMODRPCS flag
[fs/lustre-release.git] / lustre / ptlrpc / layout.c
index 4a37c28..eec818c 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -722,7 +722,6 @@ static struct req_format *req_formats[] = {
         &RQF_MDS_CLOSE,
        &RQF_MDS_RELEASE_CLOSE,
         &RQF_MDS_READPAGE,
-        &RQF_MDS_WRITEPAGE,
         &RQF_MDS_DONE_WRITING,
         &RQF_MDS_REINT,
         &RQF_MDS_REINT_CREATE,
@@ -1005,18 +1004,7 @@ EXPORT_SYMBOL(RMF_CONN);
 struct req_msg_field RMF_CONNECT_DATA =
        DEFINE_MSGF("cdata",
                    RMF_F_NO_SIZE_CHECK /* we allow extra space for interop */,
-#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 7, 53, 0)
                    sizeof(struct obd_connect_data),
-#else
-/* For interoperability with 1.8 and 2.0 clients/servers.
- * The RPC verification code allows larger RPC buffers, but not
- * smaller buffers.  Until we no longer need to keep compatibility
- * with older servers/clients we can only check that the buffer
- * size is at least as large as obd_connect_data_v1.  That is not
- * not in itself harmful, since the chance of just corrupting this
- * field is low.  See JIRA LU-16 for details. */
-                   sizeof(struct obd_connect_data_v1),
-#endif
                    lustre_swab_connect, NULL);
 EXPORT_SYMBOL(RMF_CONNECT_DATA);
 
@@ -1119,8 +1107,8 @@ struct req_msg_field RMF_EAVALS_LENS =
 EXPORT_SYMBOL(RMF_EAVALS_LENS);
 
 struct req_msg_field RMF_OBD_ID =
-        DEFINE_MSGF("obd_id", 0,
-                    sizeof(obd_id), lustre_swab_ost_last_id, NULL);
+       DEFINE_MSGF("obd_id", 0,
+                   sizeof(__u64), lustre_swab_ost_last_id, NULL);
 EXPORT_SYMBOL(RMF_OBD_ID);
 
 struct req_msg_field RMF_FID =
@@ -1550,12 +1538,6 @@ struct req_format RQF_MDS_SWAP_LAYOUTS =
                        mdt_swap_layouts, empty);
 EXPORT_SYMBOL(RQF_MDS_SWAP_LAYOUTS);
 
-/* This is for split */
-struct req_format RQF_MDS_WRITEPAGE =
-        DEFINE_REQ_FMT0("MDS_WRITEPAGE",
-                        mdt_body_capa, mdt_body_only);
-EXPORT_SYMBOL(RQF_MDS_WRITEPAGE);
-
 struct req_format RQF_LLOG_ORIGIN_HANDLE_CREATE =
         DEFINE_REQ_FMT0("LLOG_ORIGIN_HANDLE_CREATE",
                         llog_origin_handle_create_client, llogd_body_only);
@@ -2009,18 +1991,19 @@ static void *__req_capsule_get(struct req_capsule *pill,
         getter = (field->rmf_flags & RMF_F_STRING) ?
                 (typeof(getter))lustre_msg_string : lustre_msg_buf;
 
-        if (field->rmf_flags & RMF_F_STRUCT_ARRAY) {
-                /*
-                 * We've already asserted that field->rmf_size > 0 in
-                 * req_layout_init().
-                 */
-                len = lustre_msg_buflen(msg, offset);
-                if ((len % field->rmf_size) != 0) {
-                        CERROR("%s: array field size mismatch "
+       if (field->rmf_flags & (RMF_F_STRUCT_ARRAY|RMF_F_NO_SIZE_CHECK)) {
+               /*
+                * We've already asserted that field->rmf_size > 0 in
+                * req_layout_init().
+                */
+               len = lustre_msg_buflen(msg, offset);
+               if (!(field->rmf_flags & RMF_F_NO_SIZE_CHECK) &&
+                   (len % field->rmf_size) != 0) {
+                       CERROR("%s: array field size mismatch "
                                "%d modulo %u != 0 (%d)\n",
                                field->rmf_name, len, field->rmf_size, loc);
-                        return NULL;
-                }
+                       return NULL;
+               }
         } else if (pill->rc_area[loc][offset] != -1) {
                 len = pill->rc_area[loc][offset];
         } else {