#include <linux/seq_file.h>
#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 */
/* 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,
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;
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);
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:
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);
.llseek = seq_lseek,
.release = lprocfs_quota_seq_release,
};
-#endif /* LPROCFS */
+#endif /* CONFIG_PROC_FS */