X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fquota%2Flproc_quota.c;h=010a8d2c4bf4c0108cfc62d454edcfb76d7cd019;hb=HEAD;hp=4ecbaa798264e5098cc2e0fb9b0de20b56ddc051;hpb=cf539e343d3f91df7973720c26a07560a7f7904d;p=fs%2Flustre-release.git diff --git a/lustre/quota/lproc_quota.c b/lustre/quota/lproc_quota.c index 4ecbaa7..11566ac 100644 --- a/lustre/quota/lproc_quota.c +++ b/lustre/quota/lproc_quota.c @@ -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 @@ -212,13 +212,14 @@ 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; + enum lquota_res_type rtype; + enum lquota_type 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 +250,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 +264,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 +286,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 +301,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 +353,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 */