struct obd_device *obd = data;
struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return 0;
return snprintf(page, count, "%d\n", osp->opd_pre_grow_count);
struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
int val, rc, i;
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return 0;
rc = lprocfs_write_helper(buffer, count, &val);
struct obd_device *obd = data;
struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return 0;
return snprintf(page, count, "%d\n", osp->opd_pre_max_grow_count);
struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
int val, rc;
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return 0;
rc = lprocfs_write_helper(buffer, count, &val);
struct obd_device *obd = data;
struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return 0;
return snprintf(page, count, "%u\n",
struct obd_device *obd = data;
struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return 0;
return snprintf(page, count, "%u\n",
struct obd_device *obd = data;
struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return 0;
return snprintf(page, count, LPX64"\n",
struct obd_device *obd = data;
struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return 0;
return snprintf(page, count, LPX64"\n",
struct obd_device *obd = data;
struct osp_device *osp = lu2osp_dev(obd->obd_lu_dev);
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return 0;
return snprintf(page, count, LPU64"\n", osp->opd_pre_reserved);
struct osp_device *osp = lu2osp_dev(dev->obd_lu_dev);
int rc;
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return -EINVAL;
rc = snprintf(page, count, "%d\n", osp->opd_pre_status);
return rc;
}
+static int osp_rd_lfsck_max_rpcs_in_flight(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct obd_device *dev = data;
+ __u32 max;
+ int rc;
+
+ *eof = 1;
+ max = obd_get_max_rpcs_in_flight(&dev->u.cli);
+ rc = snprintf(page, count, "%u\n", max);
+
+ return rc;
+}
+
+static int osp_wr_lfsck_max_rpcs_in_flight(struct file *file,
+ const char *buffer,
+ unsigned long count, void *data)
+{
+ struct obd_device *dev = data;
+ int val;
+ int rc;
+
+ rc = lprocfs_write_helper(buffer, count, &val);
+ if (rc == 0)
+ rc = obd_set_max_rpcs_in_flight(&dev->u.cli, val);
+
+ if (rc != 0)
+ count = rc;
+
+ return count;
+}
+
static struct lprocfs_vars lprocfs_osp_obd_vars[] = {
{ "uuid", lprocfs_rd_uuid, 0, 0 },
{ "ping", 0, lprocfs_wr_ping, 0, 0, 0222 },
/* for compatibility reasons */
{ "destroys_in_flight", osp_rd_destroys_in_flight, 0, 0 },
+ { "lfsck_max_rpcs_in_flight", osp_rd_lfsck_max_rpcs_in_flight,
+ osp_wr_lfsck_max_rpcs_in_flight, 0 },
{ 0 }
};