Whamcloud - gitweb
b=24037 Changes of 2.6.32 kernel.
[fs/lustre-release.git] / lustre / mds / lproc_mds.c
index 58aac97..343d3fe 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
 #include "mds_internal.h"
 
 #ifdef LPROCFS
-static int lprocfs_mds_rd_mntdev(char *page, char **start, off_t off, int count,
-                                 int *eof, void *data)
-{
-        struct obd_device* obd = (struct obd_device *)data;
-
-        LASSERT(obd != NULL);
-        LASSERT(obd->u.mds.mds_vfsmnt->mnt_devname);
-        *eof = 1;
-
-        return snprintf(page, count, "%s\n",obd->u.mds.mds_vfsmnt->mnt_devname);
-}
-
 static int lprocfs_mds_rd_evictostnids(char *page, char **start, off_t off,
                                        int count, int *eof, void *data)
 {
@@ -99,7 +87,7 @@ static int lprocfs_mds_wr_evict_client(struct file *file, const char *buffer,
                 return -ENOMEM;
 
         if (obd->u.mds.mds_evict_ost_nids) {
-                rc = obd_set_info_async(mds->mds_osc_exp,
+                rc = obd_set_info_async(mds->mds_lov_exp,
                                         sizeof(KEY_EVICT_BY_NID),
                                         KEY_EVICT_BY_NID, strlen(tmpbuf + 4) + 1,
                                         tmpbuf + 4, set);
@@ -141,7 +129,7 @@ static int lprocfs_wr_atime_diff(struct file *file, const char *buffer,
         if (count > (sizeof(kernbuf) - 1))
                 return -EINVAL;
 
-        if (copy_from_user(kernbuf, buffer, count))
+        if (cfs_copy_from_user(kernbuf, buffer, count))
                 return -EFAULT;
 
         kernbuf[count] = '\0';
@@ -173,7 +161,7 @@ struct lprocfs_vars lprocfs_mds_obd_vars[] = {
         { "filestotal",      lprocfs_rd_filestotal,  0, 0 },
         { "filesfree",       lprocfs_rd_filesfree,   0, 0 },
         { "fstype",          lprocfs_rd_fstype,      0, 0 },
-        { "mntdev",          lprocfs_mds_rd_mntdev,  0, 0 },
+        { "mntdev",          lprocfs_obd_rd_mntdev,  0, 0 },
         { "recovery_status", lprocfs_obd_rd_recovery_status, 0, 0 },
         { "hash_stats",      lprocfs_obd_rd_hash,    0, 0 },
         { "evict_client",    0,                lprocfs_mds_wr_evict_client, 0 },
@@ -194,43 +182,10 @@ struct lprocfs_vars lprocfs_mdt_obd_vars[] = {
         { 0 }
 };
 
-struct lprocfs_vars lprocfs_mdt_module_vars[] = {
-        { "num_refs",     lprocfs_rd_numrefs,     0, 0 },
-        { 0 }
-};
-
-void mds_counter_incr(struct obd_export *exp, int opcode)
-{
-        if (exp->exp_obd && exp->exp_obd->obd_stats)
-                lprocfs_counter_incr(exp->exp_obd->obd_stats, opcode);
-        if (exp->exp_nid_stats && exp->exp_nid_stats->nid_stats != NULL)
-                lprocfs_counter_incr(exp->exp_nid_stats->nid_stats, opcode);
-
-}
-
-void mds_stats_counter_init(struct lprocfs_stats *stats)
-{
-        lprocfs_counter_init(stats, LPROC_MDS_OPEN, 0, "open", "reqs");
-        lprocfs_counter_init(stats, LPROC_MDS_CLOSE, 0, "close", "reqs");
-        lprocfs_counter_init(stats, LPROC_MDS_MKNOD, 0, "mknod", "reqs");
-        lprocfs_counter_init(stats, LPROC_MDS_LINK, 0, "link", "reqs");
-        lprocfs_counter_init(stats, LPROC_MDS_UNLINK, 0, "unlink", "reqs");
-        lprocfs_counter_init(stats, LPROC_MDS_MKDIR, 0, "mkdir", "reqs");
-        lprocfs_counter_init(stats, LPROC_MDS_RMDIR, 0, "rmdir", "reqs");
-        lprocfs_counter_init(stats, LPROC_MDS_RENAME, 0, "rename", "reqs");
-        lprocfs_counter_init(stats, LPROC_MDS_GETXATTR, 0, "getxattr", "reqs");
-        lprocfs_counter_init(stats, LPROC_MDS_SETXATTR, 0, "setxattr", "reqs");
-}
-
 void lprocfs_mds_init_vars(struct lprocfs_static_vars *lvars)
 {
     lvars->module_vars = lprocfs_mds_module_vars;
     lvars->obd_vars = lprocfs_mds_obd_vars;
 }
 
-void lprocfs_mdt_init_vars(struct lprocfs_static_vars *lvars)
-{
-    lvars->module_vars = lprocfs_mdt_module_vars;
-    lvars->obd_vars = lprocfs_mdt_obd_vars;
-}
 #endif