-int lprocfs_quota_wr_sync_blk(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- int val, rc;
- LASSERT(obd != NULL);
-
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc)
- return rc;
-
- if (val < 0)
- return -EINVAL;
-
- obd->u.obt.obt_qctxt.lqc_sync_blk = val;
- return count;
-}
-EXPORT_SYMBOL(lprocfs_quota_wr_sync_blk);
-
-int lprocfs_quota_rd_switch_qs(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- LASSERT(obd != NULL);
-
- return snprintf(page, count, "changing qunit size is %s\n",
- obd->u.obt.obt_qctxt.lqc_switch_qs ?
- "enabled" : "disabled");
-}
-EXPORT_SYMBOL(lprocfs_quota_rd_switch_qs);
-
-int lprocfs_quota_wr_switch_qs(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- int val, rc;
- LASSERT(obd != NULL);
-
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc)
- return rc;
-
- if (val)
- obd->u.obt.obt_qctxt.lqc_switch_qs = 1;
- else
- obd->u.obt.obt_qctxt.lqc_switch_qs = 0;
-
- return count;
-}
-EXPORT_SYMBOL(lprocfs_quota_wr_switch_qs);
-
-int lprocfs_quota_rd_boundary_factor(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- LASSERT(obd != NULL);
-
-
- return snprintf(page, count, "%lu\n",
- obd->u.obt.obt_qctxt.lqc_cqs_boundary_factor);
-}
-EXPORT_SYMBOL(lprocfs_quota_rd_boundary_factor);
-
-int lprocfs_quota_wr_boundary_factor(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- int val, rc;
- LASSERT(obd != NULL);
-
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc)
- return rc;
-
- if (val < 2)
- return -EINVAL;
-
- obd->u.obt.obt_qctxt.lqc_cqs_boundary_factor = val;
- return count;
-}
-EXPORT_SYMBOL(lprocfs_quota_wr_boundary_factor);
-
-int lprocfs_quota_rd_least_bunit(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- LASSERT(obd != NULL);
-
-
- return snprintf(page, count, "%lu\n",
- obd->u.obt.obt_qctxt.lqc_cqs_least_bunit);
-}
-EXPORT_SYMBOL(lprocfs_quota_rd_least_bunit);
-
-int lprocfs_quota_wr_least_bunit(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- int val, rc;
- LASSERT(obd != NULL);
-
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc)
- return rc;
-
- if (val < PTLRPC_MAX_BRW_SIZE ||
- val >= obd->u.obt.obt_qctxt.lqc_bunit_sz)
- return -EINVAL;
-
- obd->u.obt.obt_qctxt.lqc_cqs_least_bunit = val;
- return count;
-}
-EXPORT_SYMBOL(lprocfs_quota_wr_least_bunit);
-
-int lprocfs_quota_rd_least_iunit(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- LASSERT(obd != NULL);
-
-
- return snprintf(page, count, "%lu\n",
- obd->u.obt.obt_qctxt.lqc_cqs_least_iunit);
-}
-EXPORT_SYMBOL(lprocfs_quota_rd_least_iunit);
-
-int lprocfs_quota_wr_least_iunit(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- int val, rc;
- LASSERT(obd != NULL);
-
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc)
- return rc;
-
- if (val < 1 || val >= obd->u.obt.obt_qctxt.lqc_iunit_sz)
- return -EINVAL;
-
- obd->u.obt.obt_qctxt.lqc_cqs_least_iunit = val;
- return count;
-}
-EXPORT_SYMBOL(lprocfs_quota_wr_least_iunit);
-
-int lprocfs_quota_rd_qs_factor(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- LASSERT(obd != NULL);
-
-
- return snprintf(page, count, "%lu\n",
- obd->u.obt.obt_qctxt.lqc_cqs_qs_factor);
-}
-EXPORT_SYMBOL(lprocfs_quota_rd_qs_factor);
-
-int lprocfs_quota_wr_qs_factor(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- struct obd_device *obd = (struct obd_device *)data;
- int val, rc;
- LASSERT(obd != NULL);
-
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc)
- return rc;
-
- if (val < 2)
- return -EINVAL;
-
- obd->u.obt.obt_qctxt.lqc_cqs_qs_factor = val;
- return count;
-}
-EXPORT_SYMBOL(lprocfs_quota_wr_qs_factor);
-
-struct lprocfs_vars lprocfs_quota_common_vars[] = {
- { "quota_bunit_sz", lprocfs_quota_rd_bunit,
- lprocfs_quota_wr_bunit, 0},
- { "quota_btune_sz", lprocfs_quota_rd_btune,
- lprocfs_quota_wr_btune, 0},
- { "quota_iunit_sz", lprocfs_quota_rd_iunit,
- lprocfs_quota_wr_iunit, 0},
- { "quota_itune_sz", lprocfs_quota_rd_itune,
- lprocfs_quota_wr_itune, 0},
- { "quota_type", lprocfs_quota_rd_type,
- lprocfs_quota_wr_type, 0},
- { "quota_switch_seconds", lprocfs_quota_rd_switch_seconds,
- lprocfs_quota_wr_switch_seconds, 0 },
- { "quota_sync_blk", lprocfs_quota_rd_sync_blk,
- lprocfs_quota_wr_sync_blk, 0},
- { NULL }
-};
-
-struct lprocfs_vars lprocfs_quota_master_vars[] = {
- { "quota_switch_qs", lprocfs_quota_rd_switch_qs,
- lprocfs_quota_wr_switch_qs, 0 },
- { "quota_boundary_factor", lprocfs_quota_rd_boundary_factor,
- lprocfs_quota_wr_boundary_factor, 0 },
- { "quota_least_bunit", lprocfs_quota_rd_least_bunit,
- lprocfs_quota_wr_least_bunit, 0 },
- { "quota_least_iunit", lprocfs_quota_rd_least_iunit,
- lprocfs_quota_wr_least_iunit, 0 },
- { "quota_qs_factor", lprocfs_quota_rd_qs_factor,
- lprocfs_quota_wr_qs_factor, 0 },
- { NULL }