From 512b9d1d85eafb022ab761d8d1d6bbe1635207c4 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 30 Jun 2008 17:19:28 -0500 Subject: [PATCH 06/12] libfc: trivial fc_scsi cleanup Just mostly static stuff. 1. change allocation flag in fc_scsi_init to GFP_KERNEL since it has process context. 2. Make functions static when only used in this file. 3. Remove unncessary function declarations - it would be nice to remove all of them because they are such a pain in the ass to maintain. 4. rename openfc_io_compl to just fc_io_compl. Signed-off-by: Mike Christie --- drivers/scsi/libfc/fc_scsi.c | 36 ++++++++++++++++-------------------- 1 files changed, 16 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/libfc/fc_scsi.c b/drivers/scsi/libfc/fc_scsi.c index 0bb8802..a48c583 100644 --- a/drivers/scsi/libfc/fc_scsi.c +++ b/drivers/scsi/libfc/fc_scsi.c @@ -163,15 +163,12 @@ static void fc_scsi_timeout(struct fc_scsi_pkt *); static void fc_scsi_rec(struct fc_scsi_pkt *); static void fc_scsi_rec_error(struct fc_scsi_pkt *, struct fc_frame *); static void fc_scsi_rec_resp(struct fc_seq *, struct fc_frame *, void *); +static void fc_io_compl(struct fc_scsi_pkt *); static void fc_scsi_srr(struct fc_scsi_pkt *, enum fc_rctl, u32); static void fc_scsi_srr_resp(struct fc_seq *, struct fc_frame *, void *); static void fc_scsi_srr_error(struct fc_scsi_pkt *, struct fc_frame *); -static void fc_scsi_pkt_hold(struct fc_scsi_pkt *); -static void fc_scsi_pkt_release(struct fc_scsi_pkt *); -static int fc_destroy_scsi_slab(struct fc_lport *); - /* * command status codes */ @@ -199,8 +196,6 @@ static int fc_destroy_scsi_slab(struct fc_lport *); #define OPENFC_DFLT_QUEUE_DEPTH 32 -static void openfc_io_compl(struct fc_scsi_pkt *); - /* * function prototypes * FC scsi I/O related functions @@ -253,18 +248,18 @@ static int fc_scsi_pkt_free(struct fc_scsi_pkt *sp) return 0; } -void fc_scsi_pkt_hold(struct fc_scsi_pkt *sp) +static void fc_scsi_pkt_hold(struct fc_scsi_pkt *sp) { atomic_inc(&sp->ref_cnt); } -void fc_scsi_pkt_release(struct fc_scsi_pkt *sp) +static void fc_scsi_pkt_release(struct fc_scsi_pkt *sp) { fc_scsi_pkt_free(sp); } -int fc_destroy_scsi_slab(struct fc_lport *lp) +static int fc_destroy_scsi_slab(struct fc_lport *lp) { int rc = -1; struct fc_scsi_internal *si = fc_get_scsi_internal(lp); @@ -922,7 +917,7 @@ static void fc_scsi_abort_io(struct fc_lport *lp) * Context : called from process context or timer context * must not be called holding list lock */ -int fc_scsi_pkt_send(struct fc_lport *lp, struct fc_scsi_pkt *fsp) +static int fc_scsi_pkt_send(struct fc_lport *lp, struct fc_scsi_pkt *fsp) { u32 idx, i; unsigned long flags; @@ -1059,7 +1054,7 @@ static void fc_abort_internal(struct fc_scsi_pkt *fsp) * Scsi abort handler- calls fcs to send an abort * and then wait for abort completion */ -int fc_scsi_pkt_abort(struct fc_lport *lp, struct fc_scsi_pkt *fsp) +static int fc_scsi_pkt_abort(struct fc_lport *lp, struct fc_scsi_pkt *fsp) { int rc = FAILED; @@ -1222,7 +1217,7 @@ out: * this routine will assume that flogo has happened * end we are cleaning all the commands. */ -int fc_inf_reset(struct fc_lport *lp, struct fc_scsi_pkt *fsp) +static int fc_inf_reset(struct fc_lport *lp, struct fc_scsi_pkt *fsp) { int idx; unsigned long flags; @@ -1270,7 +1265,7 @@ static void fc_tm_done(struct fc_seq *sp, struct fc_frame *fp, void *arg) } } -void fc_scsi_cleanup(struct fc_lport *lp) +static void fc_scsi_cleanup(struct fc_lport *lp) { int idx; unsigned long flags; @@ -1335,7 +1330,7 @@ static void fc_scsi_timeout(struct fc_scsi_pkt *fsp) /* * Send a REC ELS request */ -void fc_scsi_rec(struct fc_scsi_pkt *fsp) +static void fc_scsi_rec(struct fc_scsi_pkt *fsp) { struct fc_lport *lp; struct fc_seq *sp; @@ -1775,7 +1770,7 @@ out: } /** - * fc_queuecommand: - The queuecommand function of the scsi template + * fc_queuecommand - The queuecommand function of the scsi template * @cmd: struct scsi_cmnd to be executed * @done: Callback function to be called when cmd is completed * @@ -1889,7 +1884,7 @@ int fc_queuecommand(struct scsi_cmnd *sc_cmd, void (*done)(struct scsi_cmnd *)) stats->ControlRequests++; } - sp->done = openfc_io_compl; + sp->done = fc_io_compl; sp->tgt_flags = rp->tgt_flags; init_timer(&sp->timer); @@ -1914,11 +1909,12 @@ out: EXPORT_SYMBOL(fc_queuecommand); /** - * openfc_io_compl: - Handle responses for completed commands + * fc_io_compl - Handle responses for completed commands + * @sp: scsi packet * * Translates a openfc error to a Linux SCSI error */ -static void openfc_io_compl(struct fc_scsi_pkt *sp) +static void fc_io_compl(struct fc_scsi_pkt *sp) { struct scsi_cmnd *sc_cmd; struct fc_lport *lp; @@ -2255,8 +2251,8 @@ EXPORT_SYMBOL(fc_change_queue_type); /** * fc_put_dev - dec the fc_lport ref count - * @dev: Pointer to fc_lport to dec. - **/ + * @lp: Pointer to fc_lport to dec. + */ void fc_put_dev(struct fc_lport *lp) { fc_destroy_scsi_slab(lp); -- 1.5.4.1