Whamcloud - gitweb
LU-17662 osd-zfs: Support for ZFS 2.2.3
[fs/lustre-release.git] / lustre / quota / lproc_quota.c
index 4ecbaa7..28bbff8 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2011, 2015, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -212,13 +212,13 @@ static int lprocfs_quota_seq_show(struct seq_file *p, void *v)
                if (fid_is_acct(fid)) {
                        seq_printf(p, "%s:\n", oid2name(fid_oid(fid)));
                } else if (fid_seq(fid) == FID_SEQ_QUOTA_GLB) {
-                       int     poolid, rtype, qtype;
+                       int     rtype, qtype;
 
-                       rc = lquota_extract_fid(fid, &poolid, &rtype, &qtype);
+                       rc = lquota_extract_fid(fid, &rtype, &qtype);
                        if (rc)
                                return rc;
 
-                       seq_printf(p, "global_pool%d_%s_%s\n", poolid,
+                       seq_printf(p, "global_pool%d_%s_%s\n", 0,
                                   RES_NAME(rtype), qtype_name(qtype));
                } else if (fid_seq(fid) == FID_SEQ_LOCAL_NAME) {
                        /* global index copy object */
@@ -249,12 +249,12 @@ static int lprocfs_quota_seq_show(struct seq_file *p, void *v)
 
        seq_printf(p, "- %-8s %llu\n", "id:", *((__u64 *)key));
        if (fid_is_acct(fid))
-               seq_printf(p, "  %-8s { inodes: %20llu, kbytes: %20llu }\n", "usage:",
-                          ((struct lquota_acct_rec *)rec)->ispace,
+               seq_printf(p, "  %-8s { inodes: %12llu, kbytes: %12llu }\n",
+                          "usage:", ((struct lquota_acct_rec *)rec)->ispace,
                           toqb(((struct lquota_acct_rec *)rec)->bspace));
        else if (fid_seq(fid) == FID_SEQ_QUOTA_GLB ||
                 fid_seq(fid) == FID_SEQ_LOCAL_NAME)
-               seq_printf(p, "  %-8s { hard: %20llu, soft: %20llu, granted: %20llu, time: %20llu }\n",
+               seq_printf(p, "  %-8s { hard: %12llu, soft: %12llu, granted: %12llu, time: %15llu }\n",
                           "limits:",
                           ((struct lquota_glb_rec *)rec)->qbr_hardlimit,
                           ((struct lquota_glb_rec *)rec)->qbr_softlimit,
@@ -263,7 +263,7 @@ static int lprocfs_quota_seq_show(struct seq_file *p, void *v)
        return 0;
 }
 
-struct seq_operations lprocfs_quota_seq_sops = {
+static const struct seq_operations lprocfs_quota_seq_sops = {
        .start  = lprocfs_quota_seq_start,
        .stop   = lprocfs_quota_seq_stop,
        .next   = lprocfs_quota_seq_next,
@@ -285,7 +285,7 @@ static int lprocfs_quota_seq_open(struct inode *inode, struct file *file)
                return -ENOMEM;
 
        /* store pointer to object we would like to iterate over */
-       lqp->lqp_obj = (struct dt_object *)PDE_DATA(inode);
+       lqp->lqp_obj = (struct dt_object *)pde_data(inode);
 
        /* Initialize the common environment to be used in the seq operations */
        rc = lu_env_init(&lqp->lqp_env, LCT_LOCAL);
@@ -300,10 +300,6 @@ static int lprocfs_quota_seq_open(struct inode *inode, struct file *file)
                goto out_lqp;
        }
 
-       rc = LPROCFS_ENTRY_CHECK(inode);
-       if (rc < 0)
-               goto out_env;
-
        rc = seq_open(file, &lprocfs_quota_seq_sops);
        if (rc)
                goto out_env;
@@ -356,11 +352,11 @@ static int lprocfs_quota_seq_release(struct inode *inode, struct file *file)
        return seq_release(inode, file);
 }
 
-struct file_operations lprocfs_quota_seq_fops = {
-       .owner          = THIS_MODULE,
-       .open           = lprocfs_quota_seq_open,
-       .read           = seq_read,
-       .llseek         = seq_lseek,
-       .release        = lprocfs_quota_seq_release,
+const struct proc_ops lprocfs_quota_seq_fops = {
+       PROC_OWNER(THIS_MODULE)
+       .proc_open      = lprocfs_quota_seq_open,
+       .proc_read      = seq_read,
+       .proc_lseek     = seq_lseek,
+       .proc_release   = lprocfs_quota_seq_release,
 };
 #endif /* CONFIG_PROC_FS */