#endif
extern struct proc_dir_entry *
lprocfs_add_simple(struct proc_dir_entry *root, char *name,
-#ifndef HAVE_ONLY_PROCFS_SEQ
- read_proc_t *read_proc, write_proc_t *write_proc,
-#endif
void *data, const struct file_operations *fops);
extern struct proc_dir_entry *
lprocfs_add_symlink(const char *name, struct proc_dir_entry *parent,
{ return 0; }
static inline struct proc_dir_entry *
lprocfs_add_simple(struct proc_dir_entry *root, char *name,
-#ifndef HAVE_ONLY_PROCFS_SEQ
- read_proc_t *read_proc, write_proc_t *write_proc,
-#endif
void *data, const struct file_operations *fops)
{return 0; }
static inline struct proc_dir_entry *
#ifdef LPROCFS
pool_getref(new_pool);
new_pool->pool_proc_entry = lprocfs_add_simple(lod->lod_pool_proc_entry,
- poolname,
-#ifndef HAVE_ONLY_PROCFS_SEQ
- NULL, NULL,
-#endif
- new_pool,
+ poolname, new_pool,
&pool_proc_operations);
if (IS_ERR(new_pool->pool_proc_entry)) {
CDEBUG(D_CONFIG, "%s: cannot add proc entry "LOV_POOLNAMEF"\n",
/* get ref for /proc file */
lov_pool_getref(new_pool);
new_pool->pool_proc_entry = lprocfs_add_simple(lov->lov_pool_proc_entry,
- poolname,
-#ifndef HAVE_ONLY_PROCFS_SEQ
- NULL, NULL,
-#endif
- new_pool,
+ poolname, new_pool,
&pool_proc_operations);
if (IS_ERR(new_pool->pool_proc_entry)) {
CWARN("Cannot add proc pool entry "LOV_POOLNAMEF"\n", poolname);
obd->obd_proc_entry);
if (obd->obd_proc_exports_entry)
lprocfs_add_simple(obd->obd_proc_exports_entry, "clear",
-#ifndef HAVE_ONLY_PROCFS_SEQ
- NULL, NULL,
-#endif
obd, &mdt_nid_stats_clear_fops);
rc = lprocfs_alloc_md_stats(obd, LPROC_MDT_LAST);
if (rc)
struct proc_dir_entry *
lprocfs_add_simple(struct proc_dir_entry *root, char *name,
-#ifndef HAVE_ONLY_PROCFS_SEQ
- read_proc_t *read_proc, write_proc_t *write_proc,
-#endif
void *data, const struct file_operations *fops)
{
struct proc_dir_entry *proc;
mode_t mode = 0;
- if (root == NULL || name == NULL)
+ if (root == NULL || name == NULL || fops == NULL)
return ERR_PTR(-EINVAL);
- if (!fops) {
-#ifndef HAVE_ONLY_PROCFS_SEQ
- if (read_proc)
- mode = 0444;
- if (write_proc)
- mode |= 0200;
-
- LPROCFS_WRITE_ENTRY();
- proc = create_proc_entry(name, mode, root);
- if (!proc) {
- CERROR("LprocFS: No memory to create /proc entry %s\n",
- name);
- LPROCFS_WRITE_EXIT();
- return ERR_PTR(-ENOMEM);
- }
- proc->read_proc = read_proc;
- proc->write_proc = write_proc;
- proc->data = data;
- LPROCFS_WRITE_EXIT();
-#else
- return ERR_PTR(-EINVAL);
-#endif
- } else {
- if (fops->read)
- mode = 0444;
- if (fops->write)
- mode |= 0200;
- proc = proc_create_data(name, mode, root, fops, data);
- if (!proc) {
- CERROR("LprocFS: No memory to create /proc entry %s\n",
- name);
- return ERR_PTR(-ENOMEM);
- }
+ if (fops->read)
+ mode = 0444;
+ if (fops->write)
+ mode |= 0200;
+ proc = proc_create_data(name, mode, root, fops, data);
+ if (!proc) {
+ CERROR("LprocFS: No memory to create /proc entry %s\n",
+ name);
+ return ERR_PTR(-ENOMEM);
}
return proc;
}
GOTO(destroy_new_ns, rc);
}
- entry = lprocfs_add_simple(new_stat->nid_proc, "uuid",
-#ifndef HAVE_ONLY_PROCFS_SEQ
- NULL, NULL,
-#endif
- new_stat, &lprocfs_exp_uuid_fops);
+ entry = lprocfs_add_simple(new_stat->nid_proc, "uuid", new_stat,
+ &lprocfs_exp_uuid_fops);
if (IS_ERR(entry)) {
CWARN("Error adding the NID stats file\n");
rc = PTR_ERR(entry);
GOTO(destroy_new_ns, rc);
}
- entry = lprocfs_add_simple(new_stat->nid_proc, "hash",
-#ifndef HAVE_ONLY_PROCFS_SEQ
- NULL, NULL,
-#endif
- new_stat, &lprocfs_exp_hash_fops);
+ entry = lprocfs_add_simple(new_stat->nid_proc, "hash", new_stat,
+ &lprocfs_exp_hash_fops);
if (IS_ERR(entry)) {
CWARN("Error adding the hash file\n");
rc = PTR_ERR(entry);
obd->obd_proc_exports_entry = entry;
entry = lprocfs_add_simple(obd->obd_proc_exports_entry, "clear",
-#ifndef HAVE_ONLY_PROCFS_SEQ
- NULL, NULL,
-#endif
obd, &lprocfs_nid_stats_clear_fops);
if (IS_ERR(entry)) {
rc = PTR_ERR(entry);