- spin_lock(&mdt->mdt_lut.lut_flags_lock);
- mdt->mdt_lut.lut_oss_capa = !!(val & 0x1);
- mdt->mdt_lut.lut_mds_capa = !!(val & 0x2);
- spin_unlock(&mdt->mdt_lut.lut_flags_lock);
- mdt->mdt_capa_conf = 1;
- LCONSOLE_INFO("MDS %s %s MDS fid capability.\n",
- mdt_obd_name(mdt),
- mdt->mdt_lut.lut_mds_capa ? "enabled" : "disabled");
- LCONSOLE_INFO("MDS %s %s OSS fid capability.\n",
- mdt_obd_name(mdt),
- mdt->mdt_lut.lut_oss_capa ? "enabled" : "disabled");
- return count;
-}
-
-static int lprocfs_rd_capa_count(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- return snprintf(page, count, "%d %d\n",
- capa_count[CAPA_SITE_CLIENT],
- capa_count[CAPA_SITE_SERVER]);
-}
-
-static int lprocfs_rd_site_stats(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 lu_site_stats_print(mdt_lu_site(mdt), page, count);
-}
-
-static int lprocfs_rd_capa_timeout(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, "%lu\n", mdt->mdt_capa_timeout);
-}
-
-static int lprocfs_wr_capa_timeout(struct file *file, const char __user *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->mdt_capa_timeout = (unsigned long)val;
- mdt->mdt_capa_conf = 1;
- return count;
-}
-
-static int lprocfs_rd_ck_timeout(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, "%lu\n", mdt->mdt_ck_timeout);
-}
-
-static int lprocfs_wr_ck_timeout(struct file *file, const char __user *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->mdt_ck_timeout = (unsigned long)val;
- mdt->mdt_capa_conf = 1;
- return count;
-}
-
-#define BUFLEN (UUID_MAX + 4)
-
-static int lprocfs_mdt_wr_evict_client(struct file *file,
- const char __user *buffer,
- unsigned long count, void *data)
-{
- char *kbuf;
- char *tmpbuf;
-
- OBD_ALLOC(kbuf, BUFLEN);
- if (kbuf == NULL)
- return -ENOMEM;
-
- /*
- * OBD_ALLOC() will zero kbuf, but we only copy BUFLEN - 1
- * bytes into kbuf, to ensure that the string is NUL-terminated.
- * UUID_MAX should include a trailing NUL already.
- */
- if (copy_from_user(kbuf, buffer,
- min_t(unsigned long, BUFLEN - 1, count))) {
- count = -EFAULT;
- goto out;
- }
- tmpbuf = cfs_firststr(kbuf, min_t(unsigned long, BUFLEN - 1, count));