X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fquota%2Flproc_quota.c;h=1102d6ed4e43e8de54ff17e5269d95710903c525;hb=f9920b4924edce1bd341622eee4281fdcd41845a;hp=9c655262461dc3af4556a9ca1b92058d889c06a2;hpb=294aa9cb666c48e02da1057c222fe5f206ce38fc;p=fs%2Flustre-release.git diff --git a/lustre/quota/lproc_quota.c b/lustre/quota/lproc_quota.c index 9c65526..1102d6e 100644 --- a/lustre/quota/lproc_quota.c +++ b/lustre/quota/lproc_quota.c @@ -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 @@ -34,8 +34,6 @@ #include #include #include -#include - #include "lquota_internal.h" #ifdef LPROCFS @@ -201,6 +199,9 @@ static int lprocfs_quota_seq_show(struct seq_file *p, void *v) seq_printf(p, "global_pool%d_%s_%s\n", poolid, RES_NAME(rtype), QTYPE_NAME(qtype)); + } else if (fid_seq(fid) == FID_SEQ_LOCAL_NAME) { + /* global index copy object */ + seq_printf(p, "global_index_copy:\n"); } else { return -ENOTSUPP; } @@ -231,7 +232,8 @@ static int lprocfs_quota_seq_show(struct seq_file *p, void *v) "u }\n", "usage:", ((struct lquota_acct_rec *)rec)->ispace, toqb(((struct lquota_acct_rec *)rec)->bspace)); - else if (fid_seq(fid) == FID_SEQ_QUOTA_GLB) + 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", "limits:", @@ -251,7 +253,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; @@ -263,31 +264,33 @@ 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); 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)) { - rc = -ENOENT; + rc = LPROCFS_ENTRY_CHECK(inode); + if (rc < 0) 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: @@ -300,8 +303,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);