/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2012, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include <obd_class.h>
#include <obd_support.h>
#include <lprocfs_status.h>
-#include <lu_time.h>
#include <libcfs/libcfs_string.h>
-
#include "mdd_internal.h"
-static const char *mdd_counter_names[LPROC_MDD_NR] = {
-};
-
int mdd_procfs_init(struct mdd_device *mdd, const char *name)
{
struct lprocfs_static_vars lvars;
GOTO(out, rc);
}
- rc = lu_time_init(&mdd->mdd_stats,
- mdd->mdd_proc_entry,
- mdd_counter_names, ARRAY_SIZE(mdd_counter_names));
+ rc = 0;
EXIT;
out:
int mdd_procfs_fini(struct mdd_device *mdd)
{
- if (mdd->mdd_stats)
- lu_time_fini(&mdd->mdd_stats);
-
if (mdd->mdd_proc_entry) {
lprocfs_remove(&mdd->mdd_proc_entry);
mdd->mdd_proc_entry = NULL;
RETURN(0);
}
-void mdd_lprocfs_time_start(const struct lu_env *env)
-{
- lu_lprocfs_time_start(env);
-}
-
-void mdd_lprocfs_time_end(const struct lu_env *env, struct mdd_device *mdd,
- int idx)
-{
- lu_lprocfs_time_end(env, mdd->mdd_stats, idx);
-}
-
static int lprocfs_wr_atime_diff(struct file *file, const char *buffer,
unsigned long count, void *data)
{
static int lprocfs_rd_changelog_users(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
- struct mdd_device *mdd = data;
- struct llog_ctxt *ctxt;
- struct cucb_data cucb;
- __u64 cur;
+ struct lu_env env;
+ struct mdd_device *mdd = data;
+ struct llog_ctxt *ctxt;
+ struct cucb_data cucb;
+ __u64 cur;
+ int rc;
*eof = 1;
- ctxt = llog_get_context(mdd2obd_dev(mdd),LLOG_CHANGELOG_USER_ORIG_CTXT);
+ ctxt = llog_get_context(mdd2obd_dev(mdd),
+ LLOG_CHANGELOG_USER_ORIG_CTXT);
if (ctxt == NULL)
return -ENXIO;
LASSERT(ctxt->loc_handle->lgh_hdr->llh_flags & LLOG_F_IS_CAT);
- cfs_spin_lock(&mdd->mdd_cl.mc_lock);
- cur = mdd->mdd_cl.mc_index;
- cfs_spin_unlock(&mdd->mdd_cl.mc_lock);
+ rc = lu_env_init(&env, LCT_LOCAL);
+ if (rc) {
+ llog_ctxt_put(ctxt);
+ return rc;
+ }
+
+ spin_lock(&mdd->mdd_cl.mc_lock);
+ cur = mdd->mdd_cl.mc_index;
+ spin_unlock(&mdd->mdd_cl.mc_lock);
cucb.count = count;
cucb.page = page;
cucb.idx += snprintf(cucb.page + cucb.idx, cucb.count - cucb.idx,
"%-5s %s\n", "ID", "index");
- llog_cat_process(NULL, ctxt->loc_handle, lprocfs_changelog_users_cb,
+ llog_cat_process(&env, ctxt->loc_handle, lprocfs_changelog_users_cb,
&cucb, 0, 0);
- llog_ctxt_put(ctxt);
- return cucb.idx;
+ lu_env_fini(&env);
+ llog_ctxt_put(ctxt);
+ return cucb.idx;
}
static int lprocfs_rd_sync_perm(char *page, char **start, off_t off,