@@ -208,7 +208,8 @@ struct client_obd {
/* checksumming for data sent over the network */
unsigned int cl_checksum:1, /* 0 = disabled, 1 = enabled */
cl_checksum_dump:1, /* same */
- cl_ocd_grant_param:1;
+ cl_ocd_grant_param:1,
+ cl_lsom_update:1; /* send LSOM updates */
/* supported checksum types that are worked out at connect time */
enum lustre_sec_part cl_sp_me;
enum lustre_sec_part cl_sp_to;
@@ -566,6 +566,33 @@ static ssize_t mdc_dom_min_repsize_seq_write(struct file *file,
}
LDEBUGFS_SEQ_FOPS(mdc_dom_min_repsize);
+static int mdc_lsom_seq_show(struct seq_file *m, void *v)
+{
+ struct obd_device *dev = m->private;
+
+ seq_printf(m, "%s\n", dev->u.cli.cl_lsom_update ? "On" : "Off");
+
+ return 0;
+}
+
+static ssize_t mdc_lsom_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
+{
+ struct obd_device *dev;
+ bool val;
+ int rc;
+
+ dev = ((struct seq_file *)file->private_data)->private;
+ rc = kstrtobool_from_user(buffer, count, &val);
+ if (rc)
+ return rc;
+
+ dev->u.cli.cl_lsom_update = val;
+ return count;
+}
+LDEBUGFS_SEQ_FOPS(mdc_lsom);
+
LDEBUGFS_SEQ_FOPS_RO_TYPE(mdc, connect_flags);
LDEBUGFS_SEQ_FOPS_RO_TYPE(mdc, server_uuid);
LDEBUGFS_SEQ_FOPS_RO_TYPE(mdc, timeouts);
@@ -601,6 +628,8 @@ static ssize_t mdc_dom_min_repsize_seq_write(struct file *file,
.fops = &mdc_stats_fops },
{ .name = "mdc_dom_min_repsize",
.fops = &mdc_dom_min_repsize_fops },
+ { .name = "mdc_lsom",
+ .fops = &mdc_lsom_fops },
{ NULL }
};
@@ -952,7 +952,8 @@ static int mdc_close(struct obd_export *exp, struct md_op_data *op_data,
req->rq_request_portal = MDS_READPAGE_PORTAL;
ptlrpc_at_set_req_timeout(req);
- if (!(exp_connect_flags2(exp) & OBD_CONNECT2_LSOM))
+ if (!obd->u.cli.cl_lsom_update ||
+ !(exp_connect_flags2(exp) & OBD_CONNECT2_LSOM))
op_data->op_xvalid &= ~(OP_XVALID_LAZYSIZE |
OP_XVALID_LAZYBLOCKS);
@@ -2842,6 +2843,7 @@ int mdc_setup(struct obd_device *obd, struct lustre_cfg *cfg)
goto err_osc_cleanup;
obd->u.cli.cl_dom_min_inline_repsize = MDC_DOM_DEF_INLINE_REPSIZE;
+ obd->u.cli.cl_lsom_update = true;
ns_register_cancel(obd->obd_namespace, mdc_cancel_weight);