X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_lproc.c;h=0e957188124a9ff7ad1c51d10b5b685a0587c5f2;hp=171c77ada11dead50eb993947aac0d3d8e13a841;hb=5e9b1828ee5a9cb92b85005c0a34962bee56d137;hpb=7947f5262691dfd723e03602809eafa3e6a3c0b8 diff --git a/lustre/mdt/mdt_lproc.c b/lustre/mdt/mdt_lproc.c index 171c77a..0e95718 100644 --- a/lustre/mdt/mdt_lproc.c +++ b/lustre/mdt/mdt_lproc.c @@ -425,6 +425,29 @@ static int lprocfs_mdt_wr_evict_client(struct file *file, const char *buffer, return count; } +static int lprocfs_rd_cos(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct obd_device *obd = data; + struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); + + return snprintf(page, count, "%u\n", mdt_cos_is_enabled(mdt)); +} + +static int lprocfs_wr_cos(struct file *file, const char *buffer, + unsigned long count, void *data) +{ + struct obd_device *obd = data; + struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev); + int val, rc; + + rc = lprocfs_write_helper(buffer, count, &val); + if (rc) + return rc; + mdt_enable_cos(mdt, val); + return count; +} + static struct lprocfs_vars lprocfs_mdt_obd_vars[] = { { "uuid", lprocfs_rd_uuid, 0, 0 }, { "recovery_status", lprocfs_obd_rd_recovery_status, 0, 0 }, @@ -447,6 +470,7 @@ static struct lprocfs_vars lprocfs_mdt_obd_vars[] = { { "site_stats", lprocfs_rd_site_stats, 0, 0 }, { "evict_client", 0, lprocfs_mdt_wr_evict_client, 0 }, { "hash_stats", lprocfs_obd_rd_hash, 0, 0 }, + { "commit_on_sharing", lprocfs_rd_cos, lprocfs_wr_cos, 0 }, { 0 } };