Whamcloud - gitweb
b=16098
[fs/lustre-release.git] / lustre / quota / quotacheck_test.c
index e42a167..3278417 100644 (file)
@@ -1,14 +1,41 @@
 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
  * vim:expandtab:shiftwidth=8:tabstop=8:
  *
- *  Copyright (C) 2005 Cluster File Systems, Inc.
- *   Author: Lai Siyao <lsy@clusterfs.com>
+ * GPL HEADER START
  *
- *   This file is part of Lustre, http://www.lustre.org/
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *   No redistribution or use is permitted outside of Cluster File Systems, Inc.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
  *
- * A kernel module which tests the fsfilt quotacheck API from the OBD setup function.
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see [sun.com URL with a
+ * copy of GPLv2].
+ *
+ * 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.
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Use is subject to license terms.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
+ *
+ * lustre/quota/quotacheck_test.c
+ *
+ * Author: Lai Siyao <lsy@clusterfs.com>
  */
 
 #ifndef EXPORT_SYMTAB
@@ -85,9 +112,9 @@ static void print_inode(struct inode *inode)
             S_ISLNK(inode->i_mode))
                 size = inode_get_bytes(inode);
 
-         CERROR("%lu: uid: %u, size: %llu, blocks: %lu, real size: %llu\n",
+         CERROR("%lu: uid: %u, size: %llu, blocks: %llu, real size: %llu\n",
                 inode->i_ino, inode->i_uid, i_size_read(inode),
-                inode->i_blocks, size);
+                (unsigned long long)inode->i_blocks, size);
 }
 
 /* Test quotaon */
@@ -148,6 +175,17 @@ static int quotacheck_run_tests(struct obd_device *obd, struct obd_device *tgt)
         return rc;
 }
 
+#ifdef LPROCFS
+static struct lprocfs_vars lprocfs_quotacheck_test_obd_vars[] = { {0} };
+static struct lprocfs_vars lprocfs_quotacheck_test_module_vars[] = { {0} };
+
+void lprocfs_quotacheck_test_init_vars(struct lprocfs_static_vars *lvars)
+{
+    lvars->module_vars  = lprocfs_quotacheck_test_module_vars;
+    lvars->obd_vars     = lprocfs_quotacheck_test_obd_vars;
+}
+#endif
+
 static int quotacheck_test_cleanup(struct obd_device *obd)
 {
         lprocfs_obd_cleanup(obd);
@@ -156,7 +194,7 @@ static int quotacheck_test_cleanup(struct obd_device *obd)
 
 static int quotacheck_test_setup(struct obd_device *obd, struct lustre_cfg* lcfg)
 {
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
         struct obd_device *tgt;
         int rc;
         ENTRY;
@@ -177,7 +215,7 @@ static int quotacheck_test_setup(struct obd_device *obd, struct lustre_cfg* lcfg
         if (rc)
                 quotacheck_test_cleanup(obd);
 
-        lprocfs_init_vars(quotacheck_test, &lvars);
+        lprocfs_quotacheck_test_init_vars(&lvars);
         lprocfs_obd_setup(obd, lvars.obd_vars);
 
         RETURN(rc);
@@ -189,17 +227,11 @@ static struct obd_ops quotacheck_obd_ops = {
         .o_cleanup     = quotacheck_test_cleanup,
 };
 
-#ifdef LPROCFS
-static struct lprocfs_vars lprocfs_obd_vars[] = { {0} };
-static struct lprocfs_vars lprocfs_module_vars[] = { {0} };
-LPROCFS_INIT_VARS(quotacheck_test, lprocfs_module_vars, lprocfs_obd_vars)
-#endif
-
 static int __init quotacheck_test_init(void)
 {
-        struct lprocfs_static_vars lvars;
+        struct lprocfs_static_vars lvars = { 0 };
 
-        lprocfs_init_vars(quotacheck_test, &lvars);
+        lprocfs_quotacheck_test_init_vars(&lvars);
         return class_register_type(&quotacheck_obd_ops, NULL, lvars.module_vars,
                                    "quotacheck_test", NULL);
 }
@@ -209,7 +241,7 @@ static void __exit quotacheck_test_exit(void)
         class_unregister_type("quotacheck_test");
 }
 
-MODULE_AUTHOR("Cluster File Systems, Inc. <info@clusterfs.com>");
+MODULE_AUTHOR("Sun Microsystems, Inc. <http://www.lustre.org/>");
 MODULE_DESCRIPTION("quotacheck test module");
 MODULE_LICENSE("GPL");