From e5b6b5d48fa26dd5bb1ec8d6829d318ef4c8585b Mon Sep 17 00:00:00 2001 From: Ksenija Stanojevic Date: Wed, 28 Oct 2015 17:30:43 -0700 Subject: [PATCH] Staging: lustre: Replace LPROCFS_CLIMP_EXIT with up_read In all call sites type of argument that macro LPROCFS_CLIMP_EXIT use is the same, so replace it with up_read function. Also remove the macro since it's no longer used. Signed-off-by: Ksenija Stanojevic Signed-off-by: Greg Kroah-Hartman --- .../staging/lustre/lustre/include/lprocfs_status.h | 3 --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- .../staging/lustre/lustre/obdclass/lprocfs_status.c | 12 ++++++------ drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 6 +++--- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index 9e654b218ca3..f18c0c75ef1e 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -624,9 +624,6 @@ void lprocfs_stats_collect(struct lprocfs_stats *stats, int idx, int lprocfs_single_release(struct inode *, struct file *); int lprocfs_seq_release(struct inode *, struct file *); -#define LPROCFS_CLIMP_EXIT(obd) \ - up_read(&(obd)->u.cli.cl_sem) - /* write the name##_seq_show function, call LPROC_SEQ_FOPS_RO for read-only proc entries; otherwise, you will define name##_seq_write function also for a read-write proc entry, and then call LPROC_SEQ_SEQ instead. Finally, diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 5f53f3b7ceff..2d6de6c19b9f 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -463,7 +463,7 @@ int lprocfs_mgc_rd_ir_state(struct seq_file *m, void *data) } spin_unlock(&config_list_lock); - LPROCFS_CLIMP_EXIT(obd); + up_read(&obd->u.cli.cl_sem); return 0; } diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index 333ac7d269b7..2de3c1b6fa49 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -502,7 +502,7 @@ int lprocfs_rd_server_uuid(struct seq_file *m, void *data) obd2cli_tgt(obd), imp_state_name, imp->imp_deactive ? "\tDEACTIVATED" : ""); - LPROCFS_CLIMP_EXIT(obd); + up_read(&obd->u.cli.cl_sem); return 0; } @@ -526,7 +526,7 @@ int lprocfs_rd_conn_uuid(struct seq_file *m, void *data) else seq_puts(m, "\n"); - LPROCFS_CLIMP_EXIT(obd); + up_read(&obd->u.cli.cl_sem); return 0; } @@ -765,7 +765,7 @@ int lprocfs_rd_import(struct seq_file *m, void *data) } out_climp: - LPROCFS_CLIMP_EXIT(obd); + up_read(&obd->u.cli.cl_sem); return 0; } EXPORT_SYMBOL(lprocfs_rd_import); @@ -796,7 +796,7 @@ int lprocfs_rd_state(struct seq_file *m, void *data) ptlrpc_import_state_name(ish->ish_state)); } - LPROCFS_CLIMP_EXIT(obd); + up_read(&obd->u.cli.cl_sem); return 0; } EXPORT_SYMBOL(lprocfs_rd_state); @@ -857,7 +857,7 @@ int lprocfs_rd_timeouts(struct seq_file *m, void *data) lprocfs_at_hist_helper(m, &imp->imp_at.iat_service_estimate[i]); } - LPROCFS_CLIMP_EXIT(obd); + up_read(&obd->u.cli.cl_sem); return 0; } EXPORT_SYMBOL(lprocfs_rd_timeouts); @@ -876,7 +876,7 @@ int lprocfs_rd_connect_flags(struct seq_file *m, void *data) seq_printf(m, "flags=%#llx\n", flags); obd_connect_seq_flags2str(m, flags, "\n"); seq_printf(m, "\n"); - LPROCFS_CLIMP_EXIT(obd); + up_read(&obd->u.cli.cl_sem); return 0; } EXPORT_SYMBOL(lprocfs_rd_connect_flags); diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c index afab0dee7a5c..2aecab21e3e1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c @@ -1197,7 +1197,7 @@ int lprocfs_wr_ping(struct file *file, const char __user *buffer, return rc; req = ptlrpc_prep_ping(obd->u.cli.cl_import); - LPROCFS_CLIMP_EXIT(obd); + up_read(&obd->u.cli.cl_sem); if (req == NULL) return -ENOMEM; @@ -1291,7 +1291,7 @@ int lprocfs_rd_pinger_recov(struct seq_file *m, void *n) return rc; seq_printf(m, "%d\n", !imp->imp_no_pinger_recover); - LPROCFS_CLIMP_EXIT(obd); + up_read(&obd->u.cli.cl_sem); return 0; } @@ -1319,7 +1319,7 @@ int lprocfs_wr_pinger_recov(struct file *file, const char __user *buffer, spin_lock(&imp->imp_lock); imp->imp_no_pinger_recover = !val; spin_unlock(&imp->imp_lock); - LPROCFS_CLIMP_EXIT(obd); + up_read(&obd->u.cli.cl_sem); return count; -- 2.34.1