From: bobijam Date: Wed, 10 Sep 2008 02:52:15 +0000 (+0000) Subject: Branch b1_8_gate X-Git-Tag: v1_7_100~1^290 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=94ebb9025d3aabc44a38fb7259b471bb94a09288;p=fs%2Flustre-release.git Branch b1_8_gate b=16643 o=Herb Wartens (hwartens@llnl.gov) i=adilger i=johann Description: Generic /proc file permissions Details : Set /Proc file permissions in a more generic way to enable non- root users operate on some /proc files. --- diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c index db3bc72..508bae5 100644 --- a/lustre/osc/lproc_osc.c +++ b/lustre/osc/lproc_osc.c @@ -71,7 +71,7 @@ static int osc_wr_active(struct file *file, const char *buffer, LPROCFS_CLIMP_CHECK(dev); /* opposite senses */ - if (dev->u.cli.cl_import->imp_deactive == val) + if (dev->u.cli.cl_import->imp_deactive == val) rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val); else CDEBUG(D_CONFIG, "activate %d: ignoring repeat request\n", val); @@ -425,7 +425,7 @@ static int osc_rd_resend_count(char *page, char **start, off_t off, int count, { struct obd_device *obd = data; - return snprintf(page, count, "%u\n", atomic_read(&obd->u.cli.cl_resends)); + return snprintf(page, count, "%u\n", atomic_read(&obd->u.cli.cl_resends)); } static int osc_wr_resend_count(struct file *file, const char *buffer, @@ -448,7 +448,7 @@ static int osc_wr_resend_count(struct file *file, const char *buffer, static struct lprocfs_vars lprocfs_osc_obd_vars[] = { { "uuid", lprocfs_rd_uuid, 0, 0 }, - { "ping", 0, lprocfs_wr_ping, 0 }, + { "ping", 0, lprocfs_wr_ping, 0, 0, 0222 }, { "connect_flags", lprocfs_rd_connect_flags, 0, 0 }, { "blocksize", lprocfs_rd_blksize, 0, 0 }, { "kbytestotal", lprocfs_rd_kbytestotal, 0, 0 }, @@ -459,7 +459,7 @@ static struct lprocfs_vars lprocfs_osc_obd_vars[] = { //{ "filegroups", lprocfs_rd_filegroups, 0, 0 }, { "ost_server_uuid", lprocfs_rd_server_uuid, 0, 0 }, { "ost_conn_uuid", lprocfs_rd_conn_uuid, 0, 0 }, - { "active", osc_rd_active, + { "active", osc_rd_active, osc_wr_active, 0 }, { "max_pages_per_rpc", osc_rd_max_pages_per_rpc, osc_wr_max_pages_per_rpc, 0 }, @@ -572,7 +572,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v) write_cum += w; seq_printf(seq, "%d:\t\t%10lu %3lu %3lu | %10lu %3lu %3lu\n", (i == 0) ? 0 : 1 << (i - 1), - r, pct(r, read_tot), pct(read_cum, read_tot), + r, pct(r, read_tot), pct(read_cum, read_tot), w, pct(w, write_tot), pct(write_cum, write_tot)); if (read_cum == read_tot && write_cum == write_tot) break;