#define MDS_MAXREPSIZE max(9 * 1024, 280 + LOV_MAX_STRIPE_COUNT * 56)
/* FLD_MAXREQSIZE == lustre_msg + __u32 padding + ptlrpc_body + opc + md_fld */
-#define FLD_MAXREQSIZE (168)
+#define FLD_MAXREQSIZE (160)
-/* FLD_MAXREPSIZE == lustre_msg + __u32 padding + ptlrpc_body + md_fld */
-#define FLD_MAXREPSIZE (160)
+/* FLD_MAXREPSIZE == lustre_msg + ptlrpc_body + md_fld */
+#define FLD_MAXREPSIZE (152)
/* SEQ_MAXREQSIZE == lustre_msg + __u32 padding + ptlrpc_body + opc + lu_range +
* __u32 padding */
-#define SEQ_MAXREQSIZE (168)
+#define SEQ_MAXREQSIZE (160)
-/* SEQ_MAXREPSIZE == lustre_msg + __u32 padding + ptlrpc_body + lu_range */
-#define SEQ_MAXREPSIZE (160)
+/* SEQ_MAXREPSIZE == lustre_msg + ptlrpc_body + lu_range */
+#define SEQ_MAXREPSIZE (152)
/* FIXME fix all constants here. Andreas suggests dyamically adding threads. */
#define MGS_MAX_THREADS 8UL
LUSTRE_IMP_FULL, 0);
}
+/*
+ * This function now is known to always saying that it will receive 4 buffers
+ * from server. Even for cases when acl_size and md_size is zero, RPC header
+ * willcontain 4 fields and RPC itself will contain zero size fields. This is
+ * because mdt_getattr*() _always_ returns 4 fields, but if acl is not needed
+ * and thus zero, it shirinks it, making zero size. The same story about
+ * md_size. And this is course of problem when client waits for smaller number
+ * of fields. This issue will be fixed later when client gets awar of RPC
+ * layouts. --umka
+ */
static
int mdc_getattr_common(struct obd_export *exp, unsigned int ea_size,
unsigned int acl_size, struct ptlrpc_request *req)
int bufcount = 2, rc;
ENTRY;
- /* request message already built */
+ /* Request message already built. */
if (ea_size != 0) {
- size[bufcount++] = ea_size;
+ size[bufcount] = ea_size;
CDEBUG(D_INODE, "reserved %u bytes for MD/symlink in packet\n",
ea_size);
- } else {
- /* FIXME: reserve some memory even if we do not need it */
- size[bufcount++] = 16;
}
+ bufcount++;
if (acl_size) {
- size[bufcount++] = acl_size;
+ size[bufcount] = acl_size;
CDEBUG(D_INODE, "reserved %u bytes for ACL\n", acl_size);
}
+ bufcount++;
ptlrpc_req_set_repsize(req, bufcount, size);
int acl_size = 0, rc;
ENTRY;
- /* XXX do we need to make another request here? We just did a getattr
- * to do the lookup in the first place.
+ /*
+ * XXX do we need to make another request here? We just did a getattr
+ * to do the lookup in the first place.
*/
req = ptlrpc_prep_req(class_exp2cliimp(exp), LUSTRE_MDS_VERSION,
MDS_GETATTR, 2, size, NULL);
MDS_BFLAG_EXT_FLAGS/*request "new" flags(bug 9486)*/);
/* currently only root inode will call us with FLACL */
-
- /* FIXME:XXX:reserve enough space regardless the flag temporarily.
- * server will do lustre_shrink_reply();
- *
- *if (valid & OBD_MD_FLACL)
- */
- acl_size = LUSTRE_POSIX_ACL_MAX_SIZE;
-
+ if (valid & OBD_MD_FLACL)
+ acl_size = LUSTRE_POSIX_ACL_MAX_SIZE;
rc = mdc_getattr_common(exp, ea_size, acl_size, req);
if (rc != 0) {
acl_size = body->aclsize;
CDEBUG(D_INFO, "Shrink to md_size %d cookie_size %d \n",
- md_size, acl_size);
+ md_size, acl_size);
lustre_shrink_reply(req, offset, md_size, 1);
- lustre_shrink_reply(req, md_size ? offset + 1: offset, acl_size, 0);
+ lustre_shrink_reply(req, md_size ? offset + 1 : offset, acl_size, 0);
}