staging: lustre: ptlrpc: clean up whitespace and align function params
PATCH 1/1 staging: lustre: ptlrpc: clean up whitespace and align function params
Minor changes to remove excessive whitespace and improve readability of ptlrpc functions.
Signed-off-by Chris Hanna <[email protected]>
--- drivers/staging/lustre/lustre/ptlrpc/client.c | 90 ++++---- drivers/staging/lustre/lustre/ptlrpc/events.c | 60 +++--- drivers/staging/lustre/lustre/ptlrpc/import.c | 8 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 70 +++--- drivers/staging/lustre/lustre/ptlrpc/llog_client.c | 82 ++++---- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 104 +++++----- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 62 +++--- drivers/staging/lustre/lustre/ptlrpc/nrs.c | 146 ++++++------ drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c | 4 +- .../staging/lustre/lustre/ptlrpc/pack_generic.c | 18 +- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 4 +- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 6 +- drivers/staging/lustre/lustre/ptlrpc/sec.c | 96 ++++---- drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 48 ++-- drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 60 +++--- drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c | 4 +- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 8 +- drivers/staging/lustre/lustre/ptlrpc/sec_plain.c | 78 ++++---- drivers/staging/lustre/lustre/ptlrpc/service.c | 238 ++++++++++---------- 20 files changed, 594 insertions(+), 594 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/client.c +45 -45
@@ -57,8 +57,8 @@ void ptlrpc_init_client(int req_portal, int rep_portal, char *name, struct ptlrpc_client *cl) { cl->cli_request_portal = req_portal; - cl->cli_reply_portal = rep_portal; - cl->cli_name = name; + cl->cli_reply_portal = rep_portal; + cl->cli_name = name; }EXPORT_SYMBOL (ptlrpc_init_client);
@@ -68,9 +68,9 @@ EXPORT_SYMBOL(ptlrpc_init_client);struct ptlrpc_connection *ptlrpc_uuid_to_connection (struct obd_uuid *uuid) {struct ptlrpc_connection *c; -lnet_nid_t self; -lnet_process_id_t peer; -int err; +lnet_nid_t self; +lnet_process_id_t peer; +int err;/* ptlrpc_uuid_to_peer() initializes its 2nd parameter * before accessing its values. */
@@ -148,7 +148,7 @@ struct ptlrpc_bulk_desc *ptlrpc_prep_bulk_imp(struct ptlrpc_request *req, desc->bd_import =class_import_get (imp); desc->bd_req = req; - desc->bd_cbid.cbid_fn = client_bulk_callback; + desc->bd_cbid.cbid_fn = client_bulk_callback; desc->bd_cbid.cbid_arg = desc;/* This makes req own desc, and free it when she frees herself */
@@ -343,8 +343,8 @@ static int unpack_reply(struct ptlrpc_request *req)static int ptlrpc_at_recv_early_reply (struct ptlrpc_request *req) {struct ptlrpc_request *early_req; -time_t olddl; -int rc; +time_t olddl; +int rc; req->rq_early =0 ;spin_unlock (&req->rq_lock);
@@ -580,8 +580,8 @@ static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request, int count, __u32 *lengths, char **bufs, struct ptlrpc_cli_ctx *ctx) { - struct obd_import *imp = request->rq_import; -int rc; + struct obd_import *imp = request->rq_import; +int rc;if (unlikely (ctx)) request->rq_cli_ctx =sptlrpc_cli_ctx_get (ctx);
@@ -605,10 +605,10 @@ static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request, request->rq_type =PTL_RPC_MSG_REQUEST ; request->rq_export =NULL ; - request->rq_req_cbid.cbid_fn = request_out_callback; + request->rq_req_cbid.cbid_fn = request_out_callback; request->rq_req_cbid.cbid_arg = request; - request->rq_reply_cbid.cbid_fn = reply_in_callback; + request->rq_reply_cbid.cbid_fn = reply_in_callback; request->rq_reply_cbid.cbid_arg = request; request->rq_reply_deadline =0 ;
@@ -761,8 +761,8 @@ EXPORT_SYMBOL(ptlrpc_request_alloc);* initialize its buffer structure according to capsule template \a format. */ struct ptlrpc_request *ptlrpc_request_alloc_pool (struct obd_import *imp, -struct ptlrpc_request_pool *pool, -const struct req_format *format) +struct ptlrpc_request_pool *pool, +const struct req_format *format) {return ptlrpc_request_alloc_internal (imp, pool, format); }
@@ -789,11 +789,11 @@ EXPORT_SYMBOL(ptlrpc_request_free);* Returns allocated request or NULL on error. */ struct ptlrpc_request *ptlrpc_request_alloc_pack (struct obd_import *imp, -const struct req_format *format, -__u32 version,int opcode) +const struct req_format *format, +__u32 version,int opcode) {struct ptlrpc_request *req =ptlrpc_request_alloc (imp, format); -int rc; +int rc;if (req) { rc =ptlrpc_request_pack (req, version, opcode);
@@ -820,7 +820,7 @@ ptlrpc_prep_req_pool(struct obd_import *imp, struct ptlrpc_request_pool *pool) {struct ptlrpc_request *request; -int rc; +int rc; request =__ptlrpc_request_alloc (imp, pool);if (!request)
@@ -868,9 +868,9 @@ struct ptlrpc_request_set *ptlrpc_prep_set(void)INIT_LIST_HEAD (&set->set_new_requests);INIT_LIST_HEAD (&set->set_cblist); set->set_max_inflight =UINT_MAX ; - set->set_producer =NULL ; + set->set_producer =NULL ; set->set_producer_arg =NULL ; - set->set_rc =0 ; + set->set_rc =0 ;return set; }
@@ -894,9 +894,9 @@ struct ptlrpc_request_set *ptlrpc_prep_fcset(int max, set_producer_func func,if (!set)return NULL ; - set->set_max_inflight = max; - set->set_producer = func; - set->set_producer_arg = arg; + set->set_max_inflight = max; + set->set_producer = func; + set->set_producer_arg = arg;return set; }
@@ -912,10 +912,10 @@ EXPORT_SYMBOL(ptlrpc_prep_fcset);*/ void ptlrpc_set_destroy (struct ptlrpc_request_set *set) { -struct list_head *tmp; -struct list_head *next; -int expected_phase; -int n =0 ; +struct list_head *tmp; +struct list_head *next; +int expected_phase; +int n =0 ;/* Requests on the set should either all be completed, or all be new */ expected_phase = (atomic_read(&set->set_remaining) == 0) ?
@@ -1013,7 +1013,7 @@ EXPORT_SYMBOL(ptlrpc_set_add_req);* Currently only used for ptlrpcd. */ void ptlrpc_set_add_new_req (struct ptlrpcd_ctl *pc, -struct ptlrpc_request *req) +struct ptlrpc_request *req) {struct ptlrpc_request_set *set = pc->pc_set;int count, i;
@@ -1400,7 +1400,7 @@ static int after_reply(struct ptlrpc_request *req)*/ static int ptlrpc_send_new_req (struct ptlrpc_request *req) { -struct obd_import *imp = req->rq_import; +struct obd_import *imp = req->rq_import;int rc;LASSERT (req->rq_phase ==RQ_PHASE_NEW );
@@ -1669,7 +1669,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)continue ; } -if (status !=0 ) { +if (status !=0 ) { req->rq_status = status;ptlrpc_rqphase_move (req,RQ_PHASE_INTERPRET );
@@ -1969,8 +1969,8 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req, int async_unlink)int ptlrpc_expired_set (void *data) {struct ptlrpc_request_set *set = data; -struct list_head *tmp; -time_t now =get_seconds (); +struct list_head *tmp; +time_t now =get_seconds ();LASSERT (set !=NULL );
@@ -2052,11 +2052,11 @@ EXPORT_SYMBOL(ptlrpc_interrupted_set);*/ int ptlrpc_set_next_timeout (struct ptlrpc_request_set *set) { -struct list_head *tmp; -time_t now =get_seconds (); -int timeout =0 ; +struct list_head *tmp; +time_t now =get_seconds (); +int timeout =0 ;struct ptlrpc_request *req; -int deadline; +int deadline;list_for_each (tmp, &set->set_requests) { req = list_entry(tmp, struct ptlrpc_request, rq_set_chain);
@@ -2105,10 +2105,10 @@ EXPORT_SYMBOL(ptlrpc_set_next_timeout);*/ int ptlrpc_set_wait (struct ptlrpc_request_set *set) { -struct list_head *tmp; +struct list_head *tmp;struct ptlrpc_request *req; -struct l_wait_info lwi; -int rc, timeout; +struct l_wait_info lwi; +int rc, timeout;if (set->set_producer) (void )ptlrpc_set_producer (set);
@@ -2353,8 +2353,8 @@ EXPORT_SYMBOL(ptlrpc_req_xid);*/ int ptlrpc_unregister_reply (struct ptlrpc_request *request,int async) { -int rc; -wait_queue_head_t *wq; +int rc; +wait_queue_head_t *wq;struct l_wait_info lwi;/*
@@ -2471,7 +2471,7 @@ void ptlrpc_free_committed(struct obd_import *imp) {struct ptlrpc_request *req, *saved;struct ptlrpc_request *last_req =NULL ;/* temporary fire escape */ -bool skip_committed_list = true; +bool skip_committed_list = true;LASSERT (imp !=NULL );assert_spin_locked (&imp->imp_lock);
@@ -3023,8 +3023,8 @@ EXPORT_SYMBOL(ptlrpc_sample_next_xid);* have delay before it really runs by ptlrpcd thread. */ struct ptlrpc_work_async_args { -int (*cb)(const struct lu_env *,void *); -void *cbdata; +int (*cb)(const struct lu_env *,void *); +void *cbdata; };static void ptlrpcd_add_work_req (struct ptlrpc_request *req)
@@ -3113,7 +3113,7 @@ void *ptlrpcd_alloc_work(struct obd_import *imp,CLASSERT (sizeof (*args) <=sizeof (req->rq_async_args)); args =ptlrpc_req_async_args (req); - args->cb = cb; + args->cb = cb; args->cbdata = cbdata;return req;
drivers/staging/lustre/lustre/ptlrpc/events.c +30 -30
129 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/import.c +4 -4
@@ -119,7 +119,7 @@ int ptlrpc_init_import(struct obd_import *imp)spin_lock (&imp->imp_lock); imp->imp_generation++; - imp->imp_state =LUSTRE_IMP_NEW ; + imp->imp_state =LUSTRE_IMP_NEW ;spin_unlock (&imp->imp_lock);
@@ -369,7 +369,7 @@ void ptlrpc_invalidate_import(struct obd_import *imp) imp_unregistering)); }spin_unlock (&imp->imp_lock); - } + } }while (rc !=0 );/*
@@ -559,7 +559,7 @@ static int import_select_connection(struct obd_import *imp)ptlrpc_connection_put (imp->imp_connection); imp->imp_connection =ptlrpc_connection_addref (imp_conn->oic_conn); - dlmexp =class_conn2export (&imp->imp_dlm_handle); + dlmexp =class_conn2export (&imp->imp_dlm_handle);LASSERT (dlmexp !=NULL );if (dlmexp->exp_connection)ptlrpc_connection_put (dlmexp->exp_connection);
@@ -1490,7 +1490,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose) INITIAL_CONNECT_TIMEOUT);IMPORT_SET_STATE (imp,LUSTRE_IMP_CONNECTING ); - req->rq_send_state =LUSTRE_IMP_CONNECTING ; + req->rq_send_state =LUSTRE_IMP_CONNECTING ;ptlrpc_request_set_replen (req); rc =ptlrpc_queue_wait (req);ptlrpc_req_finished (req);
drivers/staging/lustre/lustre/ptlrpc/layout.c +35 -35
129 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/llog_client.c +41 -41
125 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +52 -52
180 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/niobuf.c +31 -31
127 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/nrs.c +73 -73
328 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c +2 -2
@@ -160,9 +160,9 @@ static int nrs_fifo_res_get(struct ptlrpc_nrs_policy *policy,*/ static struct ptlrpc_nrs_request *nrs_fifo_req_get (struct ptlrpc_nrs_policy *policy, -bool peek,bool force) +bool peek,bool force) { -struct nrs_fifo_head *head = policy->pol_private; +struct nrs_fifo_head *head = policy->pol_private;struct ptlrpc_nrs_request *nrq; nrq = unlikely(list_empty(&head->fh_list)) ? NULL :
drivers/staging/lustre/lustre/ptlrpc/pack_generic.c +9 -9
@@ -279,8 +279,8 @@ lustre_get_emerg_rs(struct ptlrpc_service_part *svcpt)/* See if we have anything in a pool, and wait if nothing */ while (list_empty (&svcpt->scp_rep_idle)) { -struct l_wait_info lwi; -int rc; +struct l_wait_info lwi; +int rc;spin_unlock (&svcpt->scp_rep_lock);/* If we cannot get anything for some long time, we better
@@ -321,7 +321,7 @@ int lustre_pack_reply_v2(struct ptlrpc_request *req, int count, __u32 *lens, char **bufs, int flags) {struct ptlrpc_reply_state *rs; -int msg_len, rc; +int msg_len, rc;LASSERT (req->rq_reply_state ==NULL );
@@ -440,8 +440,8 @@ EXPORT_SYMBOL(lustre_msg_buf);int lustre_shrink_msg_v2 (struct lustre_msg_v2 *msg,int segment,unsigned int newlen,int move_data) { -char *tail =NULL , *newpos; -int tail_len =0 , n; +char *tail =NULL , *newpos; +int tail_len =0 , n;LASSERT (msg);LASSERT (msg->lm_bufcount > segment);
@@ -1577,8 +1577,8 @@ int do_set_info_async(struct obd_import *imp, struct ptlrpc_request_set *set) {struct ptlrpc_request *req; -char *tmp; -int rc; +char *tmp; +int rc; req =ptlrpc_request_alloc (imp, &RQF_OBD_SET_INFO );if (req ==NULL )
@@ -1688,7 +1688,7 @@ void lustre_swab_connect(struct obd_connect_data *ocd) CLASSERT(offsetof(typeof(*ocd), paddingF) != 0); } -void lustre_swab_obdo (struct obdo *o) +void lustre_swab_obdo (struct obdo *o) {__swab64s (&o->o_valid);lustre_swab_ost_id (&o->o_oi);
@@ -2179,7 +2179,7 @@ EXPORT_SYMBOL(lustre_swab_lov_user_md_objects);void lustre_swab_ldlm_res_id (struct ldlm_res_id *id) { -int i; +int i;for (i =0 ; i <RES_NAME_SIZE ; i++)__swab64s (&id->name[i]);
drivers/staging/lustre/lustre/ptlrpc/pinger.c +2 -2
@@ -546,8 +546,8 @@ void ptlrpc_pinger_wake_up(void)#define PET_TERMINATE 2static int pet_refcount; -static int pet_state; -static wait_queue_head_t pet_waitq; +static int pet_state; +static wait_queue_head_t pet_waitq;static LIST_HEAD (pet_list);static DEFINE_SPINLOCK (pet_lock);
drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +3 -3
@@ -68,9 +68,9 @@#include "ptlrpc_internal.h" struct ptlrpcd { -int pd_size; -int pd_index; -int pd_nthreads; +int pd_size; +int pd_index; +int pd_nthreads;struct ptlrpcd_ctl pd_thread_rcv;struct ptlrpcd_ctl pd_threads[0 ]; };
drivers/staging/lustre/lustre/ptlrpc/sec.c +48 -48
225 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +24 -24
102 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/sec_config.c +30 -30
163 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/sec_gc.c +1 -1
@@ -164,7 +164,7 @@ static void sec_do_gc(struct ptlrpc_sec *sec)static int sec_gc_main (void *arg) {struct ptlrpc_thread *thread = (struct ptlrpc_thread *) arg; -struct l_wait_info lwi; +struct l_wait_info lwi;unshare_fs_struct ();
drivers/staging/lustre/lustre/ptlrpc/sec_lproc.c +2 -2
@@ -74,7 +74,7 @@ static int sptlrpc_info_lprocfs_seq_show(struct seq_file *seq, void *v)struct obd_device *dev = seq->private;struct client_obd *cli = &dev->u.cli;struct ptlrpc_sec *sec =NULL ; -char str[32 ]; +char str[32 ]; LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 || strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
@@ -134,7 +134,7 @@ LPROC_SEQ_FOPS_RO(sptlrpc_ctxs_lprocfs);int sptlrpc_lprocfs_cliobd_attach (struct obd_device *dev) { -int rc; +int rc; if (strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) != 0 && strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) != 0 &&
drivers/staging/lustre/lustre/ptlrpc/sec_null.c +4 -4
@@ -92,7 +92,7 @@ int null_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)static int null_ctx_verify (struct ptlrpc_cli_ctx *ctx,struct ptlrpc_request *req) { -__u32 cksums, cksumc; +__u32 cksums, cksumc;LASSERT (req->rq_repdata);
@@ -226,9 +226,9 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec,struct ptlrpc_request *req, int segment, int newsize) { - struct lustre_msg *newbuf; -struct lustre_msg *oldbuf = req->rq_reqmsg; -int oldsize, newmsg_size, alloc_size; + struct lustre_msg *newbuf; +struct lustre_msg *oldbuf = req->rq_reqmsg; +int oldsize, newmsg_size, alloc_size;LASSERT (req->rq_reqbuf);LASSERT (req->rq_reqbuf == req->rq_reqmsg);
drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +39 -39
190 lines not on this page · raw message
drivers/staging/lustre/lustre/ptlrpc/service.c +119 -119
469 lines not on this page · raw message
Signature · 1 line
1.7.1