Whamcloud - gitweb
LU-4156 wireshark: Fix build against wireshark 1.10.x
[fs/lustre-release.git] / lustre / quota / lproc_quota.c
index 0d5e710..791f47d 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012 Intel, Inc.
+ * Copyright (c) 2011, 2013, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -34,8 +34,6 @@
 #include <lprocfs_status.h>
 #include <obd.h>
 #include <linux/seq_file.h>
-#include <lustre_fsfilt.h>
-
 #include "lquota_internal.h"
 
 #ifdef LPROCFS
@@ -272,26 +270,29 @@ static int lprocfs_quota_seq_open(struct inode *inode, struct file *file)
        /* Initialize the common environment to be used in the seq operations */
        rc = lu_env_init(&lqp->lqp_env, LCT_LOCAL);
        if (rc) {
+               char *obd_name = "quota";
+
+               if (lqp->lqp_obj != NULL)
+                       obd_name = lqp->lqp_obj->do_lu.lo_dev->ld_obd->obd_name;
+
                CERROR("%s: error initializing procfs quota env: rc = %d\n",
-                      lqp->lqp_obj->do_lu.lo_dev->ld_obd->obd_name, rc);
+                      obd_name, rc);
                goto out_lqp;
        }
 
-       if (LPROCFS_ENTRY_AND_CHECK(dp)) {
+       if (LPROCFS_ENTRY_CHECK(dp)) {
                rc = -ENOENT;
                goto out_env;
        }
 
        rc = seq_open(file, &lprocfs_quota_seq_sops);
        if (rc)
-               goto out_lprocfs;
+               goto out_env;
 
        seq = file->private_data;
        seq->private = lqp;
        return 0;
 
-out_lprocfs:
-       LPROCFS_EXIT();
 out_env:
        lu_env_fini(&lqp->lqp_env);
 out_lqp:
@@ -304,8 +305,6 @@ static int lprocfs_quota_seq_release(struct inode *inode, struct file *file)
        struct seq_file         *seq = file->private_data;
        struct lquota_procfs    *lqp = seq->private;
 
-       LPROCFS_EXIT();
-
        LASSERT(lqp);
        lu_env_fini(&lqp->lqp_env);
        OBD_FREE_PTR(lqp);