const struct attribute_group *attrs);
int lprocfs_obd_cleanup(struct obd_device *obd);
-int ldebugfs_seq_create(struct dentry *parent,
- const char *name,
- umode_t mode,
- const struct file_operations *seq_fops,
- void *data);
int ldebugfs_obd_seq_create(struct obd_device *dev,
const char *name,
umode_t mode,
struct obd_device *obd;
struct dentry *dir;
char name[MAX_STRING_SIZE + 1], *ptr;
- int err, id, len, rc;
+ int err, id, len;
name[MAX_STRING_SIZE] = '\0';
}
sbi->ll_debugfs_entry = dir;
- rc = ldebugfs_seq_create(sbi->ll_debugfs_entry, "dump_page_cache", 0444,
- &vvp_dump_pgcache_file_ops, sbi);
- if (rc)
- CWARN("Error adding the dump_page_cache file\n");
-
- rc = ldebugfs_seq_create(sbi->ll_debugfs_entry, "extents_stats", 0644,
- &ll_rw_extents_stats_fops, sbi);
- if (rc)
- CWARN("Error adding the extent_stats file\n");
-
- rc = ldebugfs_seq_create(sbi->ll_debugfs_entry,
- "extents_stats_per_process",
- 0644, &ll_rw_extents_stats_pp_fops, sbi);
- if (rc)
- CWARN("Error adding the extents_stats_per_process file\n");
-
- rc = ldebugfs_seq_create(sbi->ll_debugfs_entry, "offset_stats", 0644,
- &ll_rw_offset_stats_fops, sbi);
- if (rc)
- CWARN("Error adding the offset_stats file\n");
+ debugfs_create_file("dump_page_cache", 0444, dir, sbi,
+ &vvp_dump_pgcache_file_ops);
+ debugfs_create_file("extents_stats", 0644, dir, sbi,
+ &ll_rw_extents_stats_fops);
+ debugfs_create_file("extents_stats_per_process", 0644,
+ dir, sbi, &ll_rw_extents_stats_pp_fops);
+ debugfs_create_file("offset_stats", 0644, dir, sbi,
+ &ll_rw_offset_stats_fops);
/* File operations stats */
sbi->ll_stats = lprocfs_alloc_stats(LPROC_LL_FILE_OPCODES,
lprocfs_lmv_init_vars(&lvars);
lprocfs_obd_setup(obd, lvars.obd_vars, lvars.sysfs_vars);
- rc = ldebugfs_seq_create(obd->obd_debugfs_entry, "target_obd",
- 0444, &lmv_proc_target_fops, obd);
- if (rc)
- CWARN("%s: error adding LMV target_obd file: rc = %d\n",
- obd->obd_name, rc);
+ debugfs_create_file("target_obd", 0444, obd->obd_debugfs_entry, obd,
+ &lmv_proc_target_fops);
rc = fld_client_init(&lmv->lmv_fld, obd->obd_name,
LUSTRE_CLI_FLD_HASH_DHT);
if (rc) {
lprocfs_lov_init_vars(&lvars);
lprocfs_obd_setup(obd, lvars.obd_vars, lvars.sysfs_vars);
- rc = ldebugfs_seq_create(obd->obd_debugfs_entry, "target_obd",
- 0444, &lov_proc_target_fops, obd);
- if (rc)
- CWARN("Error adding the target_obd file\n");
+ debugfs_create_file("target_obd", 0444, obd->obd_debugfs_entry, obd,
+ &lov_proc_target_fops);
lov->lov_pool_debugfs_entry = ldebugfs_register("pools",
obd->obd_debugfs_entry,
}
EXPORT_SYMBOL(lprocfs_find_named_value);
-int ldebugfs_seq_create(struct dentry *parent, const char *name,
- umode_t mode, const struct file_operations *seq_fops,
- void *data)
-{
- struct dentry *entry;
-
- /* Disallow secretly (un)writable entries. */
- LASSERT((!seq_fops->write) == ((mode & 0222) == 0));
-
- entry = debugfs_create_file(name, mode, parent, data, seq_fops);
-
- return 0;
-}
-EXPORT_SYMBOL_GPL(ldebugfs_seq_create);
-
int ldebugfs_obd_seq_create(struct obd_device *dev,
const char *name,
umode_t mode,
const struct file_operations *seq_fops,
void *data)
{
- return ldebugfs_seq_create(dev->obd_debugfs_entry, name,
- mode, seq_fops, data);
+ debugfs_create_file(name, mode, dev->obd_debugfs_entry, data, seq_fops);
+ return 0;
}
EXPORT_SYMBOL_GPL(ldebugfs_obd_seq_create);
{
int rc;
- rc = ldebugfs_seq_create(dev->obd_debugfs_entry, "osc_stats", 0644,
- &osc_stats_fops, dev);
- if (rc == 0)
- rc = ldebugfs_obd_seq_create(dev, "rpc_stats", 0644,
- &osc_rpc_stats_fops, dev);
+ debugfs_create_file("osc_stats", 0644, dev->obd_debugfs_entry, dev,
+ &osc_stats_fops);
+ rc = ldebugfs_obd_seq_create(dev, "rpc_stats", 0644,
+ &osc_rpc_stats_fops, dev);
return rc;
}
.release = lprocfs_seq_release,
};
- int rc;
-
ptlrpc_ldebugfs_register(entry, svc->srv_name,
"stats", &svc->srv_debugfs_entry,
&svc->srv_stats);
ldebugfs_add_vars(svc->srv_debugfs_entry, lproc_vars, NULL);
- rc = ldebugfs_seq_create(svc->srv_debugfs_entry, "req_history",
- 0400, &req_history_fops, svc);
- if (rc)
- CWARN("Error adding the req_history file\n");
+ debugfs_create_file("req_history", 0400, svc->srv_debugfs_entry, svc,
+ &req_history_fops);
}
void ptlrpc_lprocfs_register_obd(struct obd_device *obddev)