Whamcloud - gitweb
LU-6047 mdt: remove Size on MDS support
[fs/lustre-release.git] / lustre / mdt / mdt_lproc.c
index ff7a260..8cdae12 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -45,7 +45,7 @@
 #include <asm/statfs.h>
 
 #include <linux/module.h>
-
+#include <lnet/nidstr.h>
 /* LUSTRE_VERSION_CODE */
 #include <lustre_ver.h>
 /*
@@ -61,7 +61,6 @@
 #include <lustre_mds.h>
 #include <lprocfs_status.h>
 #include "mdt_internal.h"
-#include <lnet/lib-lnet.h>
 
 /**
  * The rename stats output would be YAML formats, like
@@ -694,68 +693,6 @@ mdt_nosquash_nids_seq_write(struct file *file, const char __user *buffer,
 }
 LPROC_SEQ_FOPS(mdt_nosquash_nids);
 
-static int mdt_som_seq_show(struct seq_file *m, void *data)
-{
-       struct obd_device *obd = m->private;
-       struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-
-       return seq_printf(m, "%sabled\n",
-                         mdt->mdt_som_conf ? "en" : "dis");
-}
-
-static ssize_t
-mdt_som_seq_write(struct file *file, const char __user *buffer,
-                 size_t count, loff_t *off)
-{
-       struct seq_file   *m = file->private_data;
-       struct obd_device *obd = m->private;
-       struct mdt_device *mdt = mdt_dev(obd->obd_lu_dev);
-       struct obd_export *exp;
-       char kernbuf[16];
-       unsigned long val = 0;
-
-        if (count > (sizeof(kernbuf) - 1))
-                return -EINVAL;
-
-       if (copy_from_user(kernbuf, buffer, count))
-                return -EFAULT;
-
-        kernbuf[count] = '\0';
-
-        if (!strcmp(kernbuf, "enabled"))
-                val = 1;
-        else if (strcmp(kernbuf, "disabled"))
-                return -EINVAL;
-
-        if (mdt->mdt_som_conf == val)
-                return count;
-
-        if (!obd->obd_process_conf) {
-                CERROR("Temporary SOM change is not supported, use lctl "
-                       "conf_param for permanent setting\n");
-                return count;
-        }
-
-        /* 1 stands for self export. */
-        cfs_list_for_each_entry(exp, &obd->obd_exports, exp_obd_chain) {
-                if (exp == obd->obd_self_export)
-                        continue;
-               if (exp_connect_flags(exp) & OBD_CONNECT_MDS_MDS)
-                       continue;
-                /* Some clients are already connected, skip the change */
-                LCONSOLE_INFO("%s is already connected, SOM will be %s on "
-                              "the next mount\n", exp->exp_client_uuid.uuid,
-                              val ? "enabled" : "disabled");
-                return count;
-        }
-
-        mdt->mdt_som_conf = val;
-        LCONSOLE_INFO("Enabling SOM\n");
-
-        return count;
-}
-LPROC_SEQ_FOPS(mdt_som);
-
 static int mdt_enable_remote_dir_seq_show(struct seq_file *m, void *data)
 {
        struct obd_device *obd = m->private;
@@ -826,7 +763,7 @@ LPROC_SEQ_FOPS_RW_TYPE(mdt, ir_factor);
 LPROC_SEQ_FOPS_RW_TYPE(mdt, nid_stats_clear);
 LPROC_SEQ_FOPS(mdt_hsm_cdt_control);
 
-static struct lprocfs_seq_vars lprocfs_mdt_obd_vars[] = {
+static struct lprocfs_vars lprocfs_mdt_obd_vars[] = {
        { .name =       "uuid",
          .fops =       &mdt_uuid_fops                          },
        { .name =       "recovery_status",
@@ -865,8 +802,6 @@ static struct lprocfs_seq_vars lprocfs_mdt_obd_vars[] = {
          .fops =       &mdt_root_squash_fops                   },
        { .name =       "nosquash_nids",
          .fops =       &mdt_nosquash_nids_fops                 },
-       { .name =       "som",
-         .fops =       &mdt_som_fops                           },
        { .name =       "instance",
          .fops =       &mdt_target_instance_fops               },
        { .name =       "ir_factor",
@@ -879,11 +814,11 @@ static struct lprocfs_seq_vars lprocfs_mdt_obd_vars[] = {
          .fops =       &mdt_enable_remote_dir_gid_fops         },
        { .name =       "hsm_control",
          .fops =       &mdt_hsm_cdt_control_fops               },
-       { 0 }
+       { NULL }
 };
 
-int lprocfs_mdt_print_open_files(cfs_hash_t *hs, cfs_hash_bd_t *bd,
-                                cfs_hlist_node_t *hnode, void *v)
+static int lprocfs_mdt_print_open_files(cfs_hash_t *hs, cfs_hash_bd_t *bd,
+                                       struct hlist_node *hnode, void *v)
 {
        struct obd_export       *exp = cfs_hash_object(hs, hnode);
        struct seq_file         *seq = v;
@@ -893,7 +828,7 @@ int lprocfs_mdt_print_open_files(cfs_hash_t *hs, cfs_hash_bd_t *bd,
                struct mdt_file_data    *mfd;
 
                spin_lock(&med->med_open_lock);
-               cfs_list_for_each_entry(mfd, &med->med_open_head, mfd_list) {
+               list_for_each_entry(mfd, &med->med_open_head, mfd_list) {
                        seq_printf(seq, DFID"\n",
                                   PFID(mdt_object_fid(mfd->mfd_object)));
                }
@@ -903,7 +838,7 @@ int lprocfs_mdt_print_open_files(cfs_hash_t *hs, cfs_hash_bd_t *bd,
        return 0;
 }
 
-int lprocfs_mdt_open_files_seq_show(struct seq_file *seq, void *v)
+static int lprocfs_mdt_open_files_seq_show(struct seq_file *seq, void *v)
 {
        struct nid_stat *stats = seq->private;
        struct obd_device *obd = stats->nid_obd;
@@ -975,7 +910,7 @@ int mdt_procfs_init(struct mdt_device *mdt, const char *name)
        LASSERT(name != NULL);
 
        obd->obd_vars = lprocfs_mdt_obd_vars;
-       rc = lprocfs_seq_obd_setup(obd);
+       rc = lprocfs_obd_setup(obd);
        if (rc) {
                CERROR("%s: cannot create proc entries: rc = %d\n",
                       mdt_obd_name(mdt), rc);
@@ -993,9 +928,6 @@ int mdt_procfs_init(struct mdt_device *mdt, const char *name)
                                                 obd->obd_proc_entry);
        if (obd->obd_proc_exports_entry)
                lprocfs_add_simple(obd->obd_proc_exports_entry, "clear",
-#ifndef HAVE_ONLY_PROCFS_SEQ
-                                  NULL, NULL,
-#endif
                                   obd, &mdt_nid_stats_clear_fops);
        rc = lprocfs_alloc_md_stats(obd, LPROC_MDT_LAST);
        if (rc)