Whamcloud - gitweb
LU-17566 mdt: move squash code in new/old_init_ucred
[fs/lustre-release.git] / lustre / mdt / mdt_fs.c
index 4710c30..2335524 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -31,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/mdt/mdt_fs.c
  *
 
 #define DEBUG_SUBSYSTEM S_MDS
 
+#include <linux/fs.h>
+#include <libcfs/linux/linux-fs.h>
 #include "mdt_internal.h"
 
-static const struct file_operations mdt_open_files_seq_fops = {
-       .owner   = THIS_MODULE,
-       .open    = lprocfs_mdt_open_files_seq_open,
-       .read    = seq_read,
-       .llseek  = seq_lseek,
-       .release = seq_release,
+static const struct proc_ops mdt_open_files_seq_fops = {
+       PROC_OWNER(THIS_MODULE)
+       .proc_open              = lprocfs_mdt_open_files_seq_open,
+       .proc_read              = seq_read,
+       .proc_lseek             = seq_lseek,
+       .proc_release           = seq_release,
 };
 
 /**
@@ -66,29 +63,28 @@ static const struct file_operations mdt_open_files_seq_fops = {
 int mdt_export_stats_init(struct obd_device *obd, struct obd_export *exp,
                          void *localdata)
 {
-       lnet_nid_t *client_nid = localdata;
+       struct lnet_nid *client_nid = localdata;
        struct nid_stat *stats;
        int rc;
        ENTRY;
 
-       LASSERT(!obd->obd_uses_nid_stats);
-
        rc = lprocfs_exp_setup(exp, client_nid);
+
        if (rc != 0)
                /* Mask error for already created /proc entries */
                RETURN(rc == -EALREADY ? 0 : rc);
 
        stats = exp->exp_nid_stats;
-       stats->nid_stats = lprocfs_alloc_stats(LPROC_MDT_LAST,
+       stats->nid_stats = lprocfs_stats_alloc(LPROC_MDT_LAST,
                                                LPROCFS_STATS_FLAG_NOPERCPU);
        if (stats->nid_stats == NULL)
                RETURN(-ENOMEM);
 
-       mdt_stats_counter_init(stats->nid_stats);
+       mdt_stats_counter_init(stats->nid_stats, 0, LPROCFS_CNTR_HISTOGRAM);
 
-       rc = lprocfs_register_stats(stats->nid_proc, "stats", stats->nid_stats);
+       rc = lprocfs_stats_register(stats->nid_proc, "stats", stats->nid_stats);
        if (rc != 0) {
-               lprocfs_free_stats(&stats->nid_stats);
+               lprocfs_stats_free(&stats->nid_stats);
                GOTO(out, rc);
        }