-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
* GPL HEADER START
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* Author: Wang Di <wangdi@clusterfs.com>
*/
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
#define DEBUG_SUBSYSTEM S_MDS
-#include <linux/module.h>
-#include <linux/poll.h>
#include <obd.h>
#include <obd_class.h>
-#include <lustre_ver.h>
#include <obd_support.h>
#include <lprocfs_status.h>
#include <lu_time.h>
-#include <lustre_log.h>
-#include <lustre/lustre_idl.h>
#include <libcfs/libcfs_string.h>
#include "mdd_internal.h"
GOTO(out, rc = -EFAULT);
kernbuf[count] = 0;
- rc = libcfs_str2mask(kernbuf, changelog_type2str, &mdd->mdd_cl.mc_mask,
- CHANGELOG_MINMASK, CHANGELOG_ALLMASK);
+ rc = cfs_str2mask(kernbuf, changelog_type2str, &mdd->mdd_cl.mc_mask,
+ CHANGELOG_MINMASK, CHANGELOG_ALLMASK);
if (rc == 0)
rc = count;
out:
int idx;
};
-static int lprocfs_changelog_users_cb(struct llog_handle *llh,
- struct llog_rec_hdr *hdr, void *data)
+static int lprocfs_changelog_users_cb(const struct lu_env *env,
+ struct llog_handle *llh,
+ struct llog_rec_hdr *hdr, void *data)
{
struct llog_changelog_user_rec *rec;
struct cucb_data *cucb = (struct cucb_data *)data;
cucb.idx += snprintf(cucb.page + cucb.idx, cucb.count - cucb.idx,
"%-5s %s\n", "ID", "index");
- llog_cat_process(ctxt->loc_handle, lprocfs_changelog_users_cb,
- &cucb, 0, 0);
+ llog_cat_process(NULL, ctxt->loc_handle, lprocfs_changelog_users_cb,
+ &cucb, 0, 0);
llog_ctxt_put(ctxt);
return cucb.idx;
return count;
}
+static int lprocfs_rd_lfsck_speed_limit(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct mdd_device *mdd = data;
+
+ LASSERT(mdd != NULL);
+ *eof = 1;
+ return snprintf(page, count, "%u\n", mdd->mdd_lfsck.ml_speed_limit);
+}
+
+static int lprocfs_wr_lfsck_speed_limit(struct file *file, const char *buffer,
+ unsigned long count, void *data)
+{
+ struct mdd_device *mdd = data;
+ struct md_lfsck *lfsck;
+ __u32 val;
+ int rc;
+
+ LASSERT(mdd != NULL);
+ rc = lprocfs_write_helper(buffer, count, &val);
+ if (rc)
+ return rc;
+
+ lfsck = &mdd->mdd_lfsck;
+ if (val != lfsck->ml_speed_limit)
+ mdd_lfsck_set_speed(lfsck, val);
+ return count;
+}
+
static struct lprocfs_vars lprocfs_mdd_obd_vars[] = {
{ "atime_diff", lprocfs_rd_atime_diff, lprocfs_wr_atime_diff, 0 },
{ "changelog_mask", lprocfs_rd_changelog_mask,
mdd_lprocfs_quota_wr_type, 0 },
#endif
{ "sync_permission", lprocfs_rd_sync_perm, lprocfs_wr_sync_perm, 0 },
- { 0 }
+ { "lfsck_speed_limit", lprocfs_rd_lfsck_speed_limit,
+ lprocfs_wr_lfsck_speed_limit, 0 },
+ { 0 }
};
static struct lprocfs_vars lprocfs_mdd_module_vars[] = {