LPROC_SEQ_FOPS_RO(mgs_fs);
static void seq_show_srpc_rules(struct seq_file *seq, const char *tgtname,
- struct sptlrpc_rule_set *rset)
+ struct sptlrpc_rule_set *rset)
{
- struct sptlrpc_rule *r;
- char dirbuf[10];
- char flvrbuf[40];
- char net[LNET_NIDSTR_SIZE] = "default";
- int i;
+ struct sptlrpc_rule *r;
+ char dirbuf[10];
+ char flvrbuf[40];
+ char net_buf[LNET_NIDSTR_SIZE];
+ const char *net;
+ int i;
- for (i = 0; i < rset->srs_nrule; i++) {
- r = &rset->srs_rules[i];
+ for (i = 0; i < rset->srs_nrule; i++) {
+ r = &rset->srs_rules[i];
- if (r->sr_netid != LNET_NIDNET(LNET_NID_ANY))
- libcfs_net2str_r(r->sr_netid, net, sizeof(net));
+ if (r->sr_netid == LNET_NIDNET(LNET_NID_ANY))
+ net = "default";
+ else
+ net = libcfs_net2str_r(r->sr_netid, net_buf,
+ sizeof(net_buf));
if (r->sr_from == LUSTRE_SP_ANY && r->sr_to == LUSTRE_SP_ANY)
dirbuf[0] = '\0';
int lproc_mgs_add_live(struct mgs_device *mgs, struct fs_db *fsdb)
{
- int rc;
-
if (!mgs->mgs_proc_live)
return 0;
- rc = lprocfs_seq_create(mgs->mgs_proc_live, fsdb->fsdb_name, 0644,
- &mgs_live_fops, fsdb);
-
- return 0;
+ return lprocfs_seq_create(mgs->mgs_proc_live, fsdb->fsdb_name, 0644,
+ &mgs_live_fops, fsdb);
}
int lproc_mgs_del_live(struct mgs_device *mgs, struct fs_db *fsdb)