X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fquota%2Flproc_quota.c;h=8c8ad6549ace5c61b57da8a0115176acf2e0a853;hb=676c2fe47c8de0825db3001f1e964347be3dc479;hp=791f47ddd9b52d4e28e7423c2c0f20fe6cb8dc36;hpb=3a6a4195b1e268750291745d5241389e48ff730b;p=fs%2Flustre-release.git diff --git a/lustre/quota/lproc_quota.c b/lustre/quota/lproc_quota.c index 791f47d..8c8ad65 100644 --- a/lustre/quota/lproc_quota.c +++ b/lustre/quota/lproc_quota.c @@ -21,7 +21,7 @@ * GPL HEADER END */ /* - * Copyright (c) 2011, 2013, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. * Use is subject to license terms. * * Author: Johann Lombardi @@ -36,7 +36,7 @@ #include #include "lquota_internal.h" -#ifdef LPROCFS +#ifdef CONFIG_PROC_FS /* structure allocated at seq_open time and release when seq_release is called. * It is passed to seq_start/stop/next/show which can thus use the same lu_env * to be used with the iterator API */ @@ -66,7 +66,7 @@ static void *lprocfs_quota_seq_start(struct seq_file *p, loff_t *pos) /* initialize iterator */ iops = &lqp->lqp_obj->do_index_ops->dio_it; - it = iops->init(&lqp->lqp_env, lqp->lqp_obj, 0, BYPASS_CAPA); + it = iops->init(&lqp->lqp_env, lqp->lqp_obj, 0); if (IS_ERR(it)) { CERROR("%s: failed to initialize iterator: rc = %ld\n", lqp->lqp_obj->do_lu.lo_dev->ld_obd->obd_name, @@ -228,14 +228,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: %20"LPF64"u, kbytes: %20"LPF64 - "u }\n", "usage:", + seq_printf(p, " %-8s { inodes: %20llu, kbytes: %20llu }\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: %20"LPF64"u, soft: %20"LPF64 - "u, granted: %20"LPF64"u, time: %20"LPF64"u }\n", + seq_printf(p, " %-8s { hard: %20llu, soft: %20llu, granted: %20llu, time: %20llu }\n", "limits:", ((struct lquota_glb_rec *)rec)->qbr_hardlimit, ((struct lquota_glb_rec *)rec)->qbr_softlimit, @@ -253,7 +251,6 @@ struct seq_operations lprocfs_quota_seq_sops = { static int lprocfs_quota_seq_open(struct inode *inode, struct file *file) { - struct proc_dir_entry *dp = PDE(inode); struct seq_file *seq; int rc; struct lquota_procfs *lqp; @@ -265,7 +262,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 *)dp->data; + 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); @@ -280,10 +277,9 @@ static int lprocfs_quota_seq_open(struct inode *inode, struct file *file) goto out_lqp; } - if (LPROCFS_ENTRY_CHECK(dp)) { - rc = -ENOENT; + rc = LPROCFS_ENTRY_CHECK(inode); + if (rc < 0) goto out_env; - } rc = seq_open(file, &lprocfs_quota_seq_sops); if (rc) @@ -319,4 +315,4 @@ struct file_operations lprocfs_quota_seq_fops = { .llseek = seq_lseek, .release = lprocfs_quota_seq_release, }; -#endif /* LPROCFS */ +#endif /* CONFIG_PROC_FS */