Commit d0bfef31 authored by Chris Hanna's avatar Chris Hanna Committed by Greg Kroah-Hartman

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: default avatarChris Hanna <hannac@iu.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 29ac6840
...@@ -57,8 +57,8 @@ void ptlrpc_init_client(int req_portal, int rep_portal, char *name, ...@@ -57,8 +57,8 @@ void ptlrpc_init_client(int req_portal, int rep_portal, char *name,
struct ptlrpc_client *cl) struct ptlrpc_client *cl)
{ {
cl->cli_request_portal = req_portal; cl->cli_request_portal = req_portal;
cl->cli_reply_portal = rep_portal; cl->cli_reply_portal = rep_portal;
cl->cli_name = name; cl->cli_name = name;
} }
EXPORT_SYMBOL(ptlrpc_init_client); EXPORT_SYMBOL(ptlrpc_init_client);
...@@ -68,9 +68,9 @@ 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 *ptlrpc_uuid_to_connection(struct obd_uuid *uuid)
{ {
struct ptlrpc_connection *c; struct ptlrpc_connection *c;
lnet_nid_t self; lnet_nid_t self;
lnet_process_id_t peer; lnet_process_id_t peer;
int err; int err;
/* ptlrpc_uuid_to_peer() initializes its 2nd parameter /* ptlrpc_uuid_to_peer() initializes its 2nd parameter
* before accessing its values. */ * before accessing its values. */
...@@ -148,7 +148,7 @@ struct ptlrpc_bulk_desc *ptlrpc_prep_bulk_imp(struct ptlrpc_request *req, ...@@ -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_import = class_import_get(imp);
desc->bd_req = req; 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; desc->bd_cbid.cbid_arg = desc;
/* This makes req own desc, and free it when she frees herself */ /* This makes req own desc, and free it when she frees herself */
...@@ -343,8 +343,8 @@ static int unpack_reply(struct ptlrpc_request *req) ...@@ -343,8 +343,8 @@ static int unpack_reply(struct ptlrpc_request *req)
static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req) static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)
{ {
struct ptlrpc_request *early_req; struct ptlrpc_request *early_req;
time_t olddl; time_t olddl;
int rc; int rc;
req->rq_early = 0; req->rq_early = 0;
spin_unlock(&req->rq_lock); spin_unlock(&req->rq_lock);
...@@ -580,8 +580,8 @@ static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request, ...@@ -580,8 +580,8 @@ static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
int count, __u32 *lengths, char **bufs, int count, __u32 *lengths, char **bufs,
struct ptlrpc_cli_ctx *ctx) struct ptlrpc_cli_ctx *ctx)
{ {
struct obd_import *imp = request->rq_import; struct obd_import *imp = request->rq_import;
int rc; int rc;
if (unlikely(ctx)) if (unlikely(ctx))
request->rq_cli_ctx = sptlrpc_cli_ctx_get(ctx); request->rq_cli_ctx = sptlrpc_cli_ctx_get(ctx);
...@@ -605,10 +605,10 @@ static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request, ...@@ -605,10 +605,10 @@ static int __ptlrpc_request_bufs_pack(struct ptlrpc_request *request,
request->rq_type = PTL_RPC_MSG_REQUEST; request->rq_type = PTL_RPC_MSG_REQUEST;
request->rq_export = NULL; 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_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_cbid.cbid_arg = request;
request->rq_reply_deadline = 0; request->rq_reply_deadline = 0;
...@@ -761,8 +761,8 @@ EXPORT_SYMBOL(ptlrpc_request_alloc); ...@@ -761,8 +761,8 @@ EXPORT_SYMBOL(ptlrpc_request_alloc);
* initialize its buffer structure according to capsule template \a format. * initialize its buffer structure according to capsule template \a format.
*/ */
struct ptlrpc_request *ptlrpc_request_alloc_pool(struct obd_import *imp, struct ptlrpc_request *ptlrpc_request_alloc_pool(struct obd_import *imp,
struct ptlrpc_request_pool *pool, struct ptlrpc_request_pool *pool,
const struct req_format *format) const struct req_format *format)
{ {
return ptlrpc_request_alloc_internal(imp, pool, format); return ptlrpc_request_alloc_internal(imp, pool, format);
} }
...@@ -789,11 +789,11 @@ EXPORT_SYMBOL(ptlrpc_request_free); ...@@ -789,11 +789,11 @@ EXPORT_SYMBOL(ptlrpc_request_free);
* Returns allocated request or NULL on error. * Returns allocated request or NULL on error.
*/ */
struct ptlrpc_request *ptlrpc_request_alloc_pack(struct obd_import *imp, struct ptlrpc_request *ptlrpc_request_alloc_pack(struct obd_import *imp,
const struct req_format *format, const struct req_format *format,
__u32 version, int opcode) __u32 version, int opcode)
{ {
struct ptlrpc_request *req = ptlrpc_request_alloc(imp, format); struct ptlrpc_request *req = ptlrpc_request_alloc(imp, format);
int rc; int rc;
if (req) { if (req) {
rc = ptlrpc_request_pack(req, version, opcode); rc = ptlrpc_request_pack(req, version, opcode);
...@@ -820,7 +820,7 @@ ptlrpc_prep_req_pool(struct obd_import *imp, ...@@ -820,7 +820,7 @@ ptlrpc_prep_req_pool(struct obd_import *imp,
struct ptlrpc_request_pool *pool) struct ptlrpc_request_pool *pool)
{ {
struct ptlrpc_request *request; struct ptlrpc_request *request;
int rc; int rc;
request = __ptlrpc_request_alloc(imp, pool); request = __ptlrpc_request_alloc(imp, pool);
if (!request) if (!request)
...@@ -868,9 +868,9 @@ struct ptlrpc_request_set *ptlrpc_prep_set(void) ...@@ -868,9 +868,9 @@ struct ptlrpc_request_set *ptlrpc_prep_set(void)
INIT_LIST_HEAD(&set->set_new_requests); INIT_LIST_HEAD(&set->set_new_requests);
INIT_LIST_HEAD(&set->set_cblist); INIT_LIST_HEAD(&set->set_cblist);
set->set_max_inflight = UINT_MAX; set->set_max_inflight = UINT_MAX;
set->set_producer = NULL; set->set_producer = NULL;
set->set_producer_arg = NULL; set->set_producer_arg = NULL;
set->set_rc = 0; set->set_rc = 0;
return set; return set;
} }
...@@ -894,9 +894,9 @@ struct ptlrpc_request_set *ptlrpc_prep_fcset(int max, set_producer_func func, ...@@ -894,9 +894,9 @@ struct ptlrpc_request_set *ptlrpc_prep_fcset(int max, set_producer_func func,
if (!set) if (!set)
return NULL; return NULL;
set->set_max_inflight = max; set->set_max_inflight = max;
set->set_producer = func; set->set_producer = func;
set->set_producer_arg = arg; set->set_producer_arg = arg;
return set; return set;
} }
...@@ -912,10 +912,10 @@ EXPORT_SYMBOL(ptlrpc_prep_fcset); ...@@ -912,10 +912,10 @@ EXPORT_SYMBOL(ptlrpc_prep_fcset);
*/ */
void ptlrpc_set_destroy(struct ptlrpc_request_set *set) void ptlrpc_set_destroy(struct ptlrpc_request_set *set)
{ {
struct list_head *tmp; struct list_head *tmp;
struct list_head *next; struct list_head *next;
int expected_phase; int expected_phase;
int n = 0; int n = 0;
/* Requests on the set should either all be completed, or all be new */ /* Requests on the set should either all be completed, or all be new */
expected_phase = (atomic_read(&set->set_remaining) == 0) ? expected_phase = (atomic_read(&set->set_remaining) == 0) ?
...@@ -1013,7 +1013,7 @@ EXPORT_SYMBOL(ptlrpc_set_add_req); ...@@ -1013,7 +1013,7 @@ EXPORT_SYMBOL(ptlrpc_set_add_req);
* Currently only used for ptlrpcd. * Currently only used for ptlrpcd.
*/ */
void ptlrpc_set_add_new_req(struct ptlrpcd_ctl *pc, 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; struct ptlrpc_request_set *set = pc->pc_set;
int count, i; int count, i;
...@@ -1400,7 +1400,7 @@ static int after_reply(struct ptlrpc_request *req) ...@@ -1400,7 +1400,7 @@ static int after_reply(struct ptlrpc_request *req)
*/ */
static int ptlrpc_send_new_req(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; int rc;
LASSERT(req->rq_phase == RQ_PHASE_NEW); 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) ...@@ -1669,7 +1669,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
continue; continue;
} }
if (status != 0) { if (status != 0) {
req->rq_status = status; req->rq_status = status;
ptlrpc_rqphase_move(req, ptlrpc_rqphase_move(req,
RQ_PHASE_INTERPRET); RQ_PHASE_INTERPRET);
...@@ -1969,8 +1969,8 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req, int async_unlink) ...@@ -1969,8 +1969,8 @@ int ptlrpc_expire_one_request(struct ptlrpc_request *req, int async_unlink)
int ptlrpc_expired_set(void *data) int ptlrpc_expired_set(void *data)
{ {
struct ptlrpc_request_set *set = data; struct ptlrpc_request_set *set = data;
struct list_head *tmp; struct list_head *tmp;
time_t now = get_seconds(); time_t now = get_seconds();
LASSERT(set != NULL); LASSERT(set != NULL);
...@@ -2052,11 +2052,11 @@ EXPORT_SYMBOL(ptlrpc_interrupted_set); ...@@ -2052,11 +2052,11 @@ EXPORT_SYMBOL(ptlrpc_interrupted_set);
*/ */
int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set) int ptlrpc_set_next_timeout(struct ptlrpc_request_set *set)
{ {
struct list_head *tmp; struct list_head *tmp;
time_t now = get_seconds(); time_t now = get_seconds();
int timeout = 0; int timeout = 0;
struct ptlrpc_request *req; struct ptlrpc_request *req;
int deadline; int deadline;
list_for_each(tmp, &set->set_requests) { list_for_each(tmp, &set->set_requests) {
req = list_entry(tmp, struct ptlrpc_request, rq_set_chain); req = list_entry(tmp, struct ptlrpc_request, rq_set_chain);
...@@ -2105,10 +2105,10 @@ EXPORT_SYMBOL(ptlrpc_set_next_timeout); ...@@ -2105,10 +2105,10 @@ EXPORT_SYMBOL(ptlrpc_set_next_timeout);
*/ */
int ptlrpc_set_wait(struct ptlrpc_request_set *set) int ptlrpc_set_wait(struct ptlrpc_request_set *set)
{ {
struct list_head *tmp; struct list_head *tmp;
struct ptlrpc_request *req; struct ptlrpc_request *req;
struct l_wait_info lwi; struct l_wait_info lwi;
int rc, timeout; int rc, timeout;
if (set->set_producer) if (set->set_producer)
(void)ptlrpc_set_producer(set); (void)ptlrpc_set_producer(set);
...@@ -2353,8 +2353,8 @@ EXPORT_SYMBOL(ptlrpc_req_xid); ...@@ -2353,8 +2353,8 @@ EXPORT_SYMBOL(ptlrpc_req_xid);
*/ */
int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async) int ptlrpc_unregister_reply(struct ptlrpc_request *request, int async)
{ {
int rc; int rc;
wait_queue_head_t *wq; wait_queue_head_t *wq;
struct l_wait_info lwi; struct l_wait_info lwi;
/* /*
...@@ -2471,7 +2471,7 @@ void ptlrpc_free_committed(struct obd_import *imp) ...@@ -2471,7 +2471,7 @@ void ptlrpc_free_committed(struct obd_import *imp)
{ {
struct ptlrpc_request *req, *saved; struct ptlrpc_request *req, *saved;
struct ptlrpc_request *last_req = NULL; /* temporary fire escape */ struct ptlrpc_request *last_req = NULL; /* temporary fire escape */
bool skip_committed_list = true; bool skip_committed_list = true;
LASSERT(imp != NULL); LASSERT(imp != NULL);
assert_spin_locked(&imp->imp_lock); assert_spin_locked(&imp->imp_lock);
...@@ -3023,8 +3023,8 @@ EXPORT_SYMBOL(ptlrpc_sample_next_xid); ...@@ -3023,8 +3023,8 @@ EXPORT_SYMBOL(ptlrpc_sample_next_xid);
* have delay before it really runs by ptlrpcd thread. * have delay before it really runs by ptlrpcd thread.
*/ */
struct ptlrpc_work_async_args { struct ptlrpc_work_async_args {
int (*cb)(const struct lu_env *, void *); int (*cb)(const struct lu_env *, void *);
void *cbdata; void *cbdata;
}; };
static void ptlrpcd_add_work_req(struct ptlrpc_request *req) static void ptlrpcd_add_work_req(struct ptlrpc_request *req)
...@@ -3113,7 +3113,7 @@ void *ptlrpcd_alloc_work(struct obd_import *imp, ...@@ -3113,7 +3113,7 @@ void *ptlrpcd_alloc_work(struct obd_import *imp,
CLASSERT(sizeof(*args) <= sizeof(req->rq_async_args)); CLASSERT(sizeof(*args) <= sizeof(req->rq_async_args));
args = ptlrpc_req_async_args(req); args = ptlrpc_req_async_args(req);
args->cb = cb; args->cb = cb;
args->cbdata = cbdata; args->cbdata = cbdata;
return req; return req;
......
...@@ -53,7 +53,7 @@ lnet_handle_eq_t ptlrpc_eq_h; ...@@ -53,7 +53,7 @@ lnet_handle_eq_t ptlrpc_eq_h;
*/ */
void request_out_callback(lnet_event_t *ev) void request_out_callback(lnet_event_t *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
struct ptlrpc_request *req = cbid->cbid_arg; struct ptlrpc_request *req = cbid->cbid_arg;
LASSERT(ev->type == LNET_EVENT_SEND || LASSERT(ev->type == LNET_EVENT_SEND ||
...@@ -86,7 +86,7 @@ void request_out_callback(lnet_event_t *ev) ...@@ -86,7 +86,7 @@ void request_out_callback(lnet_event_t *ev)
*/ */
void reply_in_callback(lnet_event_t *ev) void reply_in_callback(lnet_event_t *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
struct ptlrpc_request *req = cbid->cbid_arg; struct ptlrpc_request *req = cbid->cbid_arg;
DEBUG_REQ(D_NET, req, "type %d, status %d", ev->type, ev->status); DEBUG_REQ(D_NET, req, "type %d, status %d", ev->type, ev->status);
...@@ -172,9 +172,9 @@ void reply_in_callback(lnet_event_t *ev) ...@@ -172,9 +172,9 @@ void reply_in_callback(lnet_event_t *ev)
*/ */
void client_bulk_callback(lnet_event_t *ev) void client_bulk_callback(lnet_event_t *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
struct ptlrpc_bulk_desc *desc = cbid->cbid_arg; struct ptlrpc_bulk_desc *desc = cbid->cbid_arg;
struct ptlrpc_request *req; struct ptlrpc_request *req;
LASSERT((desc->bd_type == BULK_PUT_SINK && LASSERT((desc->bd_type == BULK_PUT_SINK &&
ev->type == LNET_EVENT_PUT) || ev->type == LNET_EVENT_PUT) ||
...@@ -245,9 +245,9 @@ void client_bulk_callback(lnet_event_t *ev) ...@@ -245,9 +245,9 @@ void client_bulk_callback(lnet_event_t *ev)
static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt, static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt,
struct ptlrpc_request *req) struct ptlrpc_request *req)
{ {
__u64 sec = req->rq_arrival_time.tv_sec; __u64 sec = req->rq_arrival_time.tv_sec;
__u32 usec = req->rq_arrival_time.tv_usec >> 4; /* usec / 16 */ __u32 usec = req->rq_arrival_time.tv_usec >> 4; /* usec / 16 */
__u64 new_seq; __u64 new_seq;
/* set sequence ID for request and add it to history list, /* set sequence ID for request and add it to history list,
* it must be called with hold svcpt::scp_lock */ * it must be called with hold svcpt::scp_lock */
...@@ -281,11 +281,11 @@ static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt, ...@@ -281,11 +281,11 @@ static void ptlrpc_req_add_history(struct ptlrpc_service_part *svcpt,
*/ */
void request_in_callback(lnet_event_t *ev) void request_in_callback(lnet_event_t *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
struct ptlrpc_request_buffer_desc *rqbd = cbid->cbid_arg; struct ptlrpc_request_buffer_desc *rqbd = cbid->cbid_arg;
struct ptlrpc_service_part *svcpt = rqbd->rqbd_svcpt; struct ptlrpc_service_part *svcpt = rqbd->rqbd_svcpt;
struct ptlrpc_service *service = svcpt->scp_service; struct ptlrpc_service *service = svcpt->scp_service;
struct ptlrpc_request *req; struct ptlrpc_request *req;
LASSERT(ev->type == LNET_EVENT_PUT || LASSERT(ev->type == LNET_EVENT_PUT ||
ev->type == LNET_EVENT_UNLINK); ev->type == LNET_EVENT_UNLINK);
...@@ -380,7 +380,7 @@ void request_in_callback(lnet_event_t *ev) ...@@ -380,7 +380,7 @@ void request_in_callback(lnet_event_t *ev)
*/ */
void reply_out_callback(lnet_event_t *ev) void reply_out_callback(lnet_event_t *ev)
{ {
struct ptlrpc_cb_id *cbid = ev->md.user_ptr; struct ptlrpc_cb_id *cbid = ev->md.user_ptr;
struct ptlrpc_reply_state *rs = cbid->cbid_arg; struct ptlrpc_reply_state *rs = cbid->cbid_arg;
struct ptlrpc_service_part *svcpt = rs->rs_svcpt; struct ptlrpc_service_part *svcpt = rs->rs_svcpt;
...@@ -433,17 +433,17 @@ static void ptlrpc_master_callback(lnet_event_t *ev) ...@@ -433,17 +433,17 @@ static void ptlrpc_master_callback(lnet_event_t *ev)
} }
int ptlrpc_uuid_to_peer(struct obd_uuid *uuid, int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
lnet_process_id_t *peer, lnet_nid_t *self) lnet_process_id_t *peer, lnet_nid_t *self)
{ {
int best_dist = 0; int best_dist = 0;
__u32 best_order = 0; __u32 best_order = 0;
int count = 0; int count = 0;
int rc = -ENOENT; int rc = -ENOENT;
int portals_compatibility; int portals_compatibility;
int dist; int dist;
__u32 order; __u32 order;
lnet_nid_t dst_nid; lnet_nid_t dst_nid;
lnet_nid_t src_nid; lnet_nid_t src_nid;
portals_compatibility = LNetCtl(IOC_LIBCFS_PORTALS_COMPATIBILITY, NULL); portals_compatibility = LNetCtl(IOC_LIBCFS_PORTALS_COMPATIBILITY, NULL);
...@@ -487,10 +487,10 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid, ...@@ -487,10 +487,10 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid,
void ptlrpc_ni_fini(void) void ptlrpc_ni_fini(void)
{ {
wait_queue_head_t waitq; wait_queue_head_t waitq;
struct l_wait_info lwi; struct l_wait_info lwi;
int rc; int rc;
int retries; int retries;
/* Wait for the event queue to become idle since there may still be /* Wait for the event queue to become idle since there may still be
* messages in flight with pending events (i.e. the fire-and-forget * messages in flight with pending events (i.e. the fire-and-forget
...@@ -523,7 +523,7 @@ void ptlrpc_ni_fini(void) ...@@ -523,7 +523,7 @@ void ptlrpc_ni_fini(void)
lnet_pid_t ptl_get_pid(void) lnet_pid_t ptl_get_pid(void)
{ {
lnet_pid_t pid; lnet_pid_t pid;
pid = LUSTRE_SRV_LNET_PID; pid = LUSTRE_SRV_LNET_PID;
return pid; return pid;
...@@ -531,8 +531,8 @@ lnet_pid_t ptl_get_pid(void) ...@@ -531,8 +531,8 @@ lnet_pid_t ptl_get_pid(void)
int ptlrpc_ni_init(void) int ptlrpc_ni_init(void)
{ {
int rc; int rc;
lnet_pid_t pid; lnet_pid_t pid;
pid = ptl_get_pid(); pid = ptl_get_pid();
CDEBUG(D_NET, "My pid is: %x\n", pid); CDEBUG(D_NET, "My pid is: %x\n", pid);
...@@ -563,7 +563,7 @@ int ptlrpc_ni_init(void) ...@@ -563,7 +563,7 @@ int ptlrpc_ni_init(void)
int ptlrpc_init_portals(void) int ptlrpc_init_portals(void)
{ {
int rc = ptlrpc_ni_init(); int rc = ptlrpc_ni_init();
if (rc != 0) { if (rc != 0) {
CERROR("network initialisation failed\n"); CERROR("network initialisation failed\n");
......
...@@ -119,7 +119,7 @@ int ptlrpc_init_import(struct obd_import *imp) ...@@ -119,7 +119,7 @@ int ptlrpc_init_import(struct obd_import *imp)
spin_lock(&imp->imp_lock); spin_lock(&imp->imp_lock);
imp->imp_generation++; imp->imp_generation++;
imp->imp_state = LUSTRE_IMP_NEW; imp->imp_state = LUSTRE_IMP_NEW;
spin_unlock(&imp->imp_lock); spin_unlock(&imp->imp_lock);
...@@ -369,7 +369,7 @@ void ptlrpc_invalidate_import(struct obd_import *imp) ...@@ -369,7 +369,7 @@ void ptlrpc_invalidate_import(struct obd_import *imp)
imp_unregistering)); imp_unregistering));
} }
spin_unlock(&imp->imp_lock); spin_unlock(&imp->imp_lock);
} }
} while (rc != 0); } while (rc != 0);
/* /*
...@@ -559,7 +559,7 @@ static int import_select_connection(struct obd_import *imp) ...@@ -559,7 +559,7 @@ static int import_select_connection(struct obd_import *imp)
ptlrpc_connection_put(imp->imp_connection); ptlrpc_connection_put(imp->imp_connection);
imp->imp_connection = ptlrpc_connection_addref(imp_conn->oic_conn); 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); LASSERT(dlmexp != NULL);
if (dlmexp->exp_connection) if (dlmexp->exp_connection)
ptlrpc_connection_put(dlmexp->exp_connection); ptlrpc_connection_put(dlmexp->exp_connection);
...@@ -1490,7 +1490,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose) ...@@ -1490,7 +1490,7 @@ int ptlrpc_disconnect_import(struct obd_import *imp, int noclose)
INITIAL_CONNECT_TIMEOUT); INITIAL_CONNECT_TIMEOUT);
IMPORT_SET_STATE(imp, LUSTRE_IMP_CONNECTING); 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); ptlrpc_request_set_replen(req);
rc = ptlrpc_queue_wait(req); rc = ptlrpc_queue_wait(req);
ptlrpc_req_finished(req); ptlrpc_req_finished(req);
......
...@@ -807,11 +807,11 @@ struct req_capsule; ...@@ -807,11 +807,11 @@ struct req_capsule;
/* /*
* Request fields. * Request fields.
*/ */
#define DEFINE_MSGF(name, flags, size, swabber, dumper) { \ #define DEFINE_MSGF(name, flags, size, swabber, dumper) { \
.rmf_name = (name), \ .rmf_name = (name), \
.rmf_flags = (flags), \ .rmf_flags = (flags), \
.rmf_size = (size), \ .rmf_size = (size), \
.rmf_swabber = (void (*)(void *))(swabber), \ .rmf_swabber = (void (*)(void *))(swabber), \
.rmf_dumper = (void (*)(void *))(dumper) \ .rmf_dumper = (void (*)(void *))(dumper) \
} }
...@@ -1164,25 +1164,25 @@ EXPORT_SYMBOL(RMF_SWAP_LAYOUTS); ...@@ -1164,25 +1164,25 @@ EXPORT_SYMBOL(RMF_SWAP_LAYOUTS);
struct req_format { struct req_format {
const char *rf_name; const char *rf_name;
int rf_idx; int rf_idx;
struct { struct {
int nr; int nr;
const struct req_msg_field **d; const struct req_msg_field **d;
} rf_fields[RCL_NR]; } rf_fields[RCL_NR];
}; };
#define DEFINE_REQ_FMT(name, client, client_nr, server, server_nr) { \ #define DEFINE_REQ_FMT(name, client, client_nr, server, server_nr) { \
.rf_name = name, \ .rf_name = name, \
.rf_fields = { \ .rf_fields = { \
[RCL_CLIENT] = { \ [RCL_CLIENT] = { \
.nr = client_nr, \ .nr = client_nr, \
.d = client \ .d = client \
}, \ }, \
[RCL_SERVER] = { \ [RCL_SERVER] = { \
.nr = server_nr, \ .nr = server_nr, \
.d = server \ .d = server \
} \ } \
} \ } \
} }
#define DEFINE_REQ_FMT0(name, client, server) \ #define DEFINE_REQ_FMT0(name, client, server) \
...@@ -1769,10 +1769,10 @@ EXPORT_SYMBOL(req_capsule_set); ...@@ -1769,10 +1769,10 @@ EXPORT_SYMBOL(req_capsule_set);
* field of a \a pill's \a rc_fmt's RMF's. * field of a \a pill's \a rc_fmt's RMF's.
*/ */
int req_capsule_filled_sizes(struct req_capsule *pill, int req_capsule_filled_sizes(struct req_capsule *pill,
enum req_location loc) enum req_location loc)
{ {
const struct req_format *fmt = pill->rc_fmt; const struct req_format *fmt = pill->rc_fmt;
int i; int i;
LASSERT(fmt != NULL); LASSERT(fmt != NULL);
...@@ -1806,8 +1806,8 @@ EXPORT_SYMBOL(req_capsule_filled_sizes); ...@@ -1806,8 +1806,8 @@ EXPORT_SYMBOL(req_capsule_filled_sizes);
int req_capsule_server_pack(struct req_capsule *pill) int req_capsule_server_pack(struct req_capsule *pill)
{ {
const struct req_format *fmt; const struct req_format *fmt;
int count; int count;
int rc; int rc;
LASSERT(pill->rc_loc == RCL_SERVER); LASSERT(pill->rc_loc == RCL_SERVER);
fmt = pill->rc_fmt; fmt = pill->rc_fmt;
...@@ -1857,11 +1857,11 @@ swabber_dumper_helper(struct req_capsule *pill, ...@@ -1857,11 +1857,11 @@ swabber_dumper_helper(struct req_capsule *pill,
int offset, int offset,
void *value, int len, int dump, void (*swabber)(void *)) void *value, int len, int dump, void (*swabber)(void *))
{ {
void *p; void *p;
int i; int i;
int n; int n;
int do_swab; int do_swab;
int inout = loc == RCL_CLIENT; int inout = loc == RCL_CLIENT;
swabber = swabber ?: field->rmf_swabber; swabber = swabber ?: field->rmf_swabber;
...@@ -1936,10 +1936,10 @@ static void *__req_capsule_get(struct req_capsule *pill, ...@@ -1936,10 +1936,10 @@ static void *__req_capsule_get(struct req_capsule *pill,
int dump) int dump)
{ {
const struct req_format *fmt; const struct req_format *fmt;
struct lustre_msg *msg; struct lustre_msg *msg;
void *value; void *value;
int len; int len;
int offset; int offset;
void *(*getter)(struct lustre_msg *m, int n, int minlen); void *(*getter)(struct lustre_msg *m, int n, int minlen);
...@@ -2000,10 +2000,10 @@ static void *__req_capsule_get(struct req_capsule *pill, ...@@ -2000,10 +2000,10 @@ static void *__req_capsule_get(struct req_capsule *pill,
*/ */
static void __req_capsule_dump(struct req_capsule *pill, enum req_location loc) static void __req_capsule_dump(struct req_capsule *pill, enum req_location loc)
{ {
const struct req_format *fmt; const struct req_format *fmt;
const struct req_msg_field *field; const struct req_msg_field *field;
int len; int len;
int i; int i;
fmt = pill->rc_fmt; fmt = pill->rc_fmt;
...@@ -2350,9 +2350,9 @@ void req_capsule_shrink(struct req_capsule *pill, ...@@ -2350,9 +2350,9 @@ void req_capsule_shrink(struct req_capsule *pill,
enum req_location loc) enum req_location loc)
{ {
const struct req_format *fmt; const struct req_format *fmt;
struct lustre_msg *msg; struct lustre_msg *msg;
int len; int len;
int offset; int offset;
fmt = pill->rc_fmt; fmt = pill->rc_fmt;
LASSERT(fmt != NULL); LASSERT(fmt != NULL);
......
...@@ -49,29 +49,29 @@ ...@@ -49,29 +49,29 @@
#include "../include/lustre_net.h" #include "../include/lustre_net.h"
#include <linux/list.h> #include <linux/list.h>
#define LLOG_CLIENT_ENTRY(ctxt, imp) do { \ #define LLOG_CLIENT_ENTRY(ctxt, imp) do { \
mutex_lock(&ctxt->loc_mutex); \ mutex_lock(&ctxt->loc_mutex); \
if (ctxt->loc_imp) { \ if (ctxt->loc_imp) { \
imp = class_import_get(ctxt->loc_imp); \ imp = class_import_get(ctxt->loc_imp); \
} else { \ } else { \
CERROR("ctxt->loc_imp == NULL for context idx %d." \ CERROR("ctxt->loc_imp == NULL for context idx %d." \
"Unable to complete MDS/OSS recovery," \ "Unable to complete MDS/OSS recovery," \
"but I'll try again next time. Not fatal.\n", \ "but I'll try again next time. Not fatal.\n", \
ctxt->loc_idx); \ ctxt->loc_idx); \
imp = NULL; \ imp = NULL; \
mutex_unlock(&ctxt->loc_mutex); \ mutex_unlock(&ctxt->loc_mutex); \
return (-EINVAL); \ return (-EINVAL); \
} \ } \
mutex_unlock(&ctxt->loc_mutex); \ mutex_unlock(&ctxt->loc_mutex); \
} while (0) } while (0)
#define LLOG_CLIENT_EXIT(ctxt, imp) do { \ #define LLOG_CLIENT_EXIT(ctxt, imp) do { \
mutex_lock(&ctxt->loc_mutex); \ mutex_lock(&ctxt->loc_mutex); \
if (ctxt->loc_imp != imp) \ if (ctxt->loc_imp != imp) \
CWARN("loc_imp has changed from %p to %p\n", \ CWARN("loc_imp has changed from %p to %p\n", \
ctxt->loc_imp, imp); \ ctxt->loc_imp, imp); \
class_import_put(imp); \ class_import_put(imp); \
mutex_unlock(&ctxt->loc_mutex); \ mutex_unlock(&ctxt->loc_mutex); \
} while (0) } while (0)
/* This is a callback from the llog_* functions. /* This is a callback from the llog_* functions.
...@@ -80,11 +80,11 @@ static int llog_client_open(const struct lu_env *env, ...@@ -80,11 +80,11 @@ static int llog_client_open(const struct lu_env *env,
struct llog_handle *lgh, struct llog_logid *logid, struct llog_handle *lgh, struct llog_logid *logid,
char *name, enum llog_open_param open_param) char *name, enum llog_open_param open_param)
{ {
struct obd_import *imp; struct obd_import *imp;
struct llogd_body *body; struct llogd_body *body;
struct llog_ctxt *ctxt = lgh->lgh_ctxt; struct llog_ctxt *ctxt = lgh->lgh_ctxt;
struct ptlrpc_request *req = NULL; struct ptlrpc_request *req = NULL;
int rc; int rc;
LLOG_CLIENT_ENTRY(ctxt, imp); LLOG_CLIENT_ENTRY(ctxt, imp);
...@@ -145,10 +145,10 @@ static int llog_client_open(const struct lu_env *env, ...@@ -145,10 +145,10 @@ static int llog_client_open(const struct lu_env *env,
static int llog_client_destroy(const struct lu_env *env, static int llog_client_destroy(const struct lu_env *env,
struct llog_handle *loghandle) struct llog_handle *loghandle)
{ {
struct obd_import *imp; struct obd_import *imp;
struct ptlrpc_request *req = NULL; struct ptlrpc_request *req = NULL;
struct llogd_body *body; struct llogd_body *body;
int rc; int rc;
LLOG_CLIENT_ENTRY(loghandle->lgh_ctxt, imp); LLOG_CLIENT_ENTRY(loghandle->lgh_ctxt, imp);
req = ptlrpc_request_alloc_pack(imp, &RQF_LLOG_ORIGIN_HANDLE_DESTROY, req = ptlrpc_request_alloc_pack(imp, &RQF_LLOG_ORIGIN_HANDLE_DESTROY,
...@@ -182,11 +182,11 @@ static int llog_client_next_block(const struct lu_env *env, ...@@ -182,11 +182,11 @@ static int llog_client_next_block(const struct lu_env *env,
int *cur_idx, int next_idx, int *cur_idx, int next_idx,
__u64 *cur_offset, void *buf, int len) __u64 *cur_offset, void *buf, int len)
{ {
struct obd_import *imp; struct obd_import *imp;
struct ptlrpc_request *req = NULL; struct ptlrpc_request *req = NULL;
struct llogd_body *body; struct llogd_body *body;
void *ptr; void *ptr;
int rc; int rc;
LLOG_CLIENT_ENTRY(loghandle->lgh_ctxt, imp); LLOG_CLIENT_ENTRY(loghandle->lgh_ctxt, imp);
req = ptlrpc_request_alloc_pack(imp, &RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK, req = ptlrpc_request_alloc_pack(imp, &RQF_LLOG_ORIGIN_HANDLE_NEXT_BLOCK,
...@@ -240,11 +240,11 @@ static int llog_client_prev_block(const struct lu_env *env, ...@@ -240,11 +240,11 @@ static int llog_client_prev_block(const struct lu_env *env,
struct llog_handle *loghandle, struct llog_handle *loghandle,
int prev_idx, void *buf, int len) int prev_idx, void *buf, int len)
{ {
struct obd_import *imp; struct obd_import *imp;
struct ptlrpc_request *req = NULL; struct ptlrpc_request *req = NULL;
struct llogd_body *body; struct llogd_body *body;
void *ptr; void *ptr;
int rc; int rc;
LLOG_CLIENT_ENTRY(loghandle->lgh_ctxt, imp); LLOG_CLIENT_ENTRY(loghandle->lgh_ctxt, imp);
req = ptlrpc_request_alloc_pack(imp, &RQF_LLOG_ORIGIN_HANDLE_PREV_BLOCK, req = ptlrpc_request_alloc_pack(imp, &RQF_LLOG_ORIGIN_HANDLE_PREV_BLOCK,
...@@ -292,12 +292,12 @@ static int llog_client_prev_block(const struct lu_env *env, ...@@ -292,12 +292,12 @@ static int llog_client_prev_block(const struct lu_env *env,
static int llog_client_read_header(const struct lu_env *env, static int llog_client_read_header(const struct lu_env *env,
struct llog_handle *handle) struct llog_handle *handle)
{ {
struct obd_import *imp; struct obd_import *imp;
struct ptlrpc_request *req = NULL; struct ptlrpc_request *req = NULL;
struct llogd_body *body; struct llogd_body *body;
struct llog_log_hdr *hdr; struct llog_log_hdr *hdr;
struct llog_rec_hdr *llh_hdr; struct llog_rec_hdr *llh_hdr;
int rc; int rc;
LLOG_CLIENT_ENTRY(handle->lgh_ctxt, imp); LLOG_CLIENT_ENTRY(handle->lgh_ctxt, imp);
req = ptlrpc_request_alloc_pack(imp, &RQF_LLOG_ORIGIN_HANDLE_READ_HEADER, req = ptlrpc_request_alloc_pack(imp, &RQF_LLOG_ORIGIN_HANDLE_READ_HEADER,
......
...@@ -261,8 +261,8 @@ ptlrpc_lprocfs_req_history_len_seq_show(struct seq_file *m, void *v) ...@@ -261,8 +261,8 @@ ptlrpc_lprocfs_req_history_len_seq_show(struct seq_file *m, void *v)
{ {
struct ptlrpc_service *svc = m->private; struct ptlrpc_service *svc = m->private;
struct ptlrpc_service_part *svcpt; struct ptlrpc_service_part *svcpt;
int total = 0; int total = 0;
int i; int i;
ptlrpc_service_for_each_part(svcpt, i, svc) ptlrpc_service_for_each_part(svcpt, i, svc)
total += svcpt->scp_hist_nrqbds; total += svcpt->scp_hist_nrqbds;
...@@ -277,8 +277,8 @@ ptlrpc_lprocfs_req_history_max_seq_show(struct seq_file *m, void *n) ...@@ -277,8 +277,8 @@ ptlrpc_lprocfs_req_history_max_seq_show(struct seq_file *m, void *n)
{ {
struct ptlrpc_service *svc = m->private; struct ptlrpc_service *svc = m->private;
struct ptlrpc_service_part *svcpt; struct ptlrpc_service_part *svcpt;
int total = 0; int total = 0;
int i; int i;
ptlrpc_service_for_each_part(svcpt, i, svc) ptlrpc_service_for_each_part(svcpt, i, svc)
total += svc->srv_hist_nrqbds_cpt_max; total += svc->srv_hist_nrqbds_cpt_max;
...@@ -289,13 +289,13 @@ ptlrpc_lprocfs_req_history_max_seq_show(struct seq_file *m, void *n) ...@@ -289,13 +289,13 @@ ptlrpc_lprocfs_req_history_max_seq_show(struct seq_file *m, void *n)
static ssize_t static ssize_t
ptlrpc_lprocfs_req_history_max_seq_write(struct file *file, ptlrpc_lprocfs_req_history_max_seq_write(struct file *file,
const char __user *buffer, const char __user *buffer,
size_t count, loff_t *off) size_t count, loff_t *off)
{ {
struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private; struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private;
int bufpages; int bufpages;
int val; int val;
int rc; int rc;
rc = lprocfs_write_helper(buffer, count, &val); rc = lprocfs_write_helper(buffer, count, &val);
if (rc < 0) if (rc < 0)
...@@ -478,17 +478,17 @@ void nrs_policy_get_info_locked(struct ptlrpc_nrs_policy *policy, ...@@ -478,17 +478,17 @@ void nrs_policy_get_info_locked(struct ptlrpc_nrs_policy *policy,
*/ */
static int ptlrpc_lprocfs_nrs_seq_show(struct seq_file *m, void *n) static int ptlrpc_lprocfs_nrs_seq_show(struct seq_file *m, void *n)
{ {
struct ptlrpc_service *svc = m->private; struct ptlrpc_service *svc = m->private;
struct ptlrpc_service_part *svcpt; struct ptlrpc_service_part *svcpt;
struct ptlrpc_nrs *nrs; struct ptlrpc_nrs *nrs;
struct ptlrpc_nrs_policy *policy; struct ptlrpc_nrs_policy *policy;
struct ptlrpc_nrs_pol_info *infos; struct ptlrpc_nrs_pol_info *infos;
struct ptlrpc_nrs_pol_info tmp; struct ptlrpc_nrs_pol_info tmp;
unsigned num_pols; unsigned num_pols;
unsigned pol_idx = 0; unsigned pol_idx = 0;
bool hp = false; bool hp = false;
int i; int i;
int rc = 0; int rc = 0;
/** /**
* Serialize NRS core lprocfs operations with policy registration/ * Serialize NRS core lprocfs operations with policy registration/
...@@ -638,15 +638,15 @@ static int ptlrpc_lprocfs_nrs_seq_show(struct seq_file *m, void *n) ...@@ -638,15 +638,15 @@ static int ptlrpc_lprocfs_nrs_seq_show(struct seq_file *m, void *n)
* regular and high-priority (if the service has one) NRS head. * regular and high-priority (if the service has one) NRS head.
*/ */
static ssize_t ptlrpc_lprocfs_nrs_seq_write(struct file *file, static ssize_t ptlrpc_lprocfs_nrs_seq_write(struct file *file,
const char __user *buffer, const char __user *buffer,
size_t count, loff_t *off) size_t count, loff_t *off)
{ {
struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private; struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private;
enum ptlrpc_nrs_queue_type queue = PTLRPC_NRS_QUEUE_BOTH; enum ptlrpc_nrs_queue_type queue = PTLRPC_NRS_QUEUE_BOTH;
char *cmd; char *cmd;
char *cmd_copy = NULL; char *cmd_copy = NULL;
char *token; char *token;
int rc = 0; int rc = 0;
if (count >= LPROCFS_NRS_WR_MAX_CMD) if (count >= LPROCFS_NRS_WR_MAX_CMD)
return -EINVAL; return -EINVAL;
...@@ -729,8 +729,8 @@ ptlrpc_lprocfs_svc_req_history_seek(struct ptlrpc_service_part *svcpt, ...@@ -729,8 +729,8 @@ ptlrpc_lprocfs_svc_req_history_seek(struct ptlrpc_service_part *svcpt,
struct ptlrpc_srh_iterator *srhi, struct ptlrpc_srh_iterator *srhi,
__u64 seq) __u64 seq)
{ {
struct list_head *e; struct list_head *e;
struct ptlrpc_request *req; struct ptlrpc_request *req;
if (srhi->srhi_req != NULL && if (srhi->srhi_req != NULL &&
srhi->srhi_seq > svcpt->scp_hist_seq_culled && srhi->srhi_seq > svcpt->scp_hist_seq_culled &&
...@@ -860,12 +860,12 @@ static void * ...@@ -860,12 +860,12 @@ static void *
ptlrpc_lprocfs_svc_req_history_next(struct seq_file *s, ptlrpc_lprocfs_svc_req_history_next(struct seq_file *s,
void *iter, loff_t *pos) void *iter, loff_t *pos)
{ {
struct ptlrpc_service *svc = s->private; struct ptlrpc_service *svc = s->private;
struct ptlrpc_srh_iterator *srhi = iter; struct ptlrpc_srh_iterator *srhi = iter;
struct ptlrpc_service_part *svcpt; struct ptlrpc_service_part *svcpt;
__u64 seq; __u64 seq;
int rc; int rc;
int i; int i;
for (i = srhi->srhi_idx; i < svc->srv_ncpts; i++) { for (i = srhi->srhi_idx; i < svc->srv_ncpts; i++) {
svcpt = svc->srv_parts[i]; svcpt = svc->srv_parts[i];
...@@ -923,11 +923,11 @@ EXPORT_SYMBOL(target_print_req); ...@@ -923,11 +923,11 @@ EXPORT_SYMBOL(target_print_req);
static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter) static int ptlrpc_lprocfs_svc_req_history_show(struct seq_file *s, void *iter)
{ {
struct ptlrpc_service *svc = s->private; struct ptlrpc_service *svc = s->private;
struct ptlrpc_srh_iterator *srhi = iter; struct ptlrpc_srh_iterator *srhi = iter;
struct ptlrpc_service_part *svcpt; struct ptlrpc_service_part *svcpt;
struct ptlrpc_request *req; struct ptlrpc_request *req;
int rc; int rc;
LASSERT(srhi->srhi_idx < svc->srv_ncpts); LASSERT(srhi->srhi_idx < svc->srv_ncpts);
...@@ -972,8 +972,8 @@ ptlrpc_lprocfs_svc_req_history_open(struct inode *inode, struct file *file) ...@@ -972,8 +972,8 @@ ptlrpc_lprocfs_svc_req_history_open(struct inode *inode, struct file *file)
.next = ptlrpc_lprocfs_svc_req_history_next, .next = ptlrpc_lprocfs_svc_req_history_next,
.show = ptlrpc_lprocfs_svc_req_history_show, .show = ptlrpc_lprocfs_svc_req_history_show,
}; };
struct seq_file *seqf; struct seq_file *seqf;
int rc; int rc;
rc = seq_open(file, &sops); rc = seq_open(file, &sops);
if (rc) if (rc)
...@@ -987,13 +987,13 @@ ptlrpc_lprocfs_svc_req_history_open(struct inode *inode, struct file *file) ...@@ -987,13 +987,13 @@ ptlrpc_lprocfs_svc_req_history_open(struct inode *inode, struct file *file)
/* See also lprocfs_rd_timeouts */ /* See also lprocfs_rd_timeouts */
static int ptlrpc_lprocfs_timeouts_seq_show(struct seq_file *m, void *n) static int ptlrpc_lprocfs_timeouts_seq_show(struct seq_file *m, void *n)
{ {
struct ptlrpc_service *svc = m->private; struct ptlrpc_service *svc = m->private;
struct ptlrpc_service_part *svcpt; struct ptlrpc_service_part *svcpt;
struct dhms ts; struct dhms ts;
time_t worstt; time_t worstt;
unsigned int cur; unsigned int cur;
unsigned int worst; unsigned int worst;
int i; int i;
if (AT_OFF) { if (AT_OFF) {
seq_printf(m, "adaptive timeouts off, using obd_timeout %u\n", seq_printf(m, "adaptive timeouts off, using obd_timeout %u\n",
...@@ -1215,8 +1215,8 @@ int lprocfs_wr_evict_client(struct file *file, const char __user *buffer, ...@@ -1215,8 +1215,8 @@ int lprocfs_wr_evict_client(struct file *file, const char __user *buffer,
size_t count, loff_t *off) size_t count, loff_t *off)
{ {
struct obd_device *obd = ((struct seq_file *)file->private_data)->private; struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
char *kbuf; char *kbuf;
char *tmpbuf; char *tmpbuf;
kbuf = kzalloc(BUFLEN, GFP_NOFS); kbuf = kzalloc(BUFLEN, GFP_NOFS);
if (kbuf == NULL) if (kbuf == NULL)
...@@ -1264,7 +1264,7 @@ int lprocfs_wr_ping(struct file *file, const char __user *buffer, ...@@ -1264,7 +1264,7 @@ int lprocfs_wr_ping(struct file *file, const char __user *buffer,
{ {
struct obd_device *obd = ((struct seq_file *)file->private_data)->private; struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
struct ptlrpc_request *req; struct ptlrpc_request *req;
int rc; int rc;
LPROCFS_CLIMP_CHECK(obd); LPROCFS_CLIMP_CHECK(obd);
req = ptlrpc_prep_ping(obd->u.cli.cl_import); req = ptlrpc_prep_ping(obd->u.cli.cl_import);
......
...@@ -52,17 +52,17 @@ static int ptl_send_buf(lnet_handle_md_t *mdh, void *base, int len, ...@@ -52,17 +52,17 @@ static int ptl_send_buf(lnet_handle_md_t *mdh, void *base, int len,
struct ptlrpc_connection *conn, int portal, __u64 xid, struct ptlrpc_connection *conn, int portal, __u64 xid,
unsigned int offset) unsigned int offset)
{ {
int rc; int rc;
lnet_md_t md; lnet_md_t md;
LASSERT(portal != 0); LASSERT(portal != 0);
LASSERT(conn != NULL); LASSERT(conn != NULL);
CDEBUG(D_INFO, "conn=%p id %s\n", conn, libcfs_id2str(conn->c_peer)); CDEBUG(D_INFO, "conn=%p id %s\n", conn, libcfs_id2str(conn->c_peer));
md.start = base; md.start = base;
md.length = len; md.length = len;
md.threshold = (ack == LNET_ACK_REQ) ? 2 : 1; md.threshold = (ack == LNET_ACK_REQ) ? 2 : 1;
md.options = PTLRPC_MD_OPTIONS; md.options = PTLRPC_MD_OPTIONS;
md.user_ptr = cbid; md.user_ptr = cbid;
md.eq_handle = ptlrpc_eq_h; md.eq_handle = ptlrpc_eq_h;
if (unlikely(ack == LNET_ACK_REQ && if (unlikely(ack == LNET_ACK_REQ &&
...@@ -120,8 +120,8 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req) ...@@ -120,8 +120,8 @@ int ptlrpc_register_bulk(struct ptlrpc_request *req)
int posted_md; int posted_md;
int total_md; int total_md;
__u64 xid; __u64 xid;
lnet_handle_me_t me_h; lnet_handle_me_t me_h;
lnet_md_t md; lnet_md_t md;
if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_BULK_GET_NET)) if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_BULK_GET_NET))
return 0; return 0;
...@@ -243,9 +243,9 @@ EXPORT_SYMBOL(ptlrpc_register_bulk); ...@@ -243,9 +243,9 @@ EXPORT_SYMBOL(ptlrpc_register_bulk);
int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async) int ptlrpc_unregister_bulk(struct ptlrpc_request *req, int async)
{ {
struct ptlrpc_bulk_desc *desc = req->rq_bulk; struct ptlrpc_bulk_desc *desc = req->rq_bulk;
wait_queue_head_t *wq; wait_queue_head_t *wq;
struct l_wait_info lwi; struct l_wait_info lwi;
int rc; int rc;
LASSERT(!in_interrupt()); /* might sleep */ LASSERT(!in_interrupt()); /* might sleep */
...@@ -301,8 +301,8 @@ EXPORT_SYMBOL(ptlrpc_unregister_bulk); ...@@ -301,8 +301,8 @@ EXPORT_SYMBOL(ptlrpc_unregister_bulk);
static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags) static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags)
{ {
struct ptlrpc_service_part *svcpt = req->rq_rqbd->rqbd_svcpt; struct ptlrpc_service_part *svcpt = req->rq_rqbd->rqbd_svcpt;
struct ptlrpc_service *svc = svcpt->scp_service; struct ptlrpc_service *svc = svcpt->scp_service;
int service_time = max_t(int, get_seconds() - int service_time = max_t(int, get_seconds() -
req->rq_arrival_time.tv_sec, 1); req->rq_arrival_time.tv_sec, 1);
...@@ -353,8 +353,8 @@ static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags) ...@@ -353,8 +353,8 @@ static void ptlrpc_at_set_reply(struct ptlrpc_request *req, int flags)
int ptlrpc_send_reply(struct ptlrpc_request *req, int flags) int ptlrpc_send_reply(struct ptlrpc_request *req, int flags)
{ {
struct ptlrpc_reply_state *rs = req->rq_reply_state; struct ptlrpc_reply_state *rs = req->rq_reply_state;
struct ptlrpc_connection *conn; struct ptlrpc_connection *conn;
int rc; int rc;
/* We must already have a reply buffer (only ptlrpc_error() may be /* We must already have a reply buffer (only ptlrpc_error() may be
* called without one). The reply generated by sptlrpc layer (e.g. * called without one). The reply generated by sptlrpc layer (e.g.
...@@ -491,8 +491,8 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply) ...@@ -491,8 +491,8 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
int rc2; int rc2;
int mpflag = 0; int mpflag = 0;
struct ptlrpc_connection *connection; struct ptlrpc_connection *connection;
lnet_handle_me_t reply_me_h; lnet_handle_me_t reply_me_h;
lnet_md_t reply_md; lnet_md_t reply_md;
struct obd_device *obd = request->rq_import->imp_obd; struct obd_device *obd = request->rq_import->imp_obd;
if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_DROP_RPC)) if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_DROP_RPC))
...@@ -594,15 +594,15 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply) ...@@ -594,15 +594,15 @@ int ptl_send_rpc(struct ptlrpc_request *request, int noreply)
spin_unlock(&request->rq_lock); spin_unlock(&request->rq_lock);
if (!noreply) { if (!noreply) {
reply_md.start = request->rq_repbuf; reply_md.start = request->rq_repbuf;
reply_md.length = request->rq_repbuf_len; reply_md.length = request->rq_repbuf_len;
/* Allow multiple early replies */ /* Allow multiple early replies */
reply_md.threshold = LNET_MD_THRESH_INF; reply_md.threshold = LNET_MD_THRESH_INF;
/* Manage remote for early replies */ /* Manage remote for early replies */
reply_md.options = PTLRPC_MD_OPTIONS | LNET_MD_OP_PUT | reply_md.options = PTLRPC_MD_OPTIONS | LNET_MD_OP_PUT |
LNET_MD_MANAGE_REMOTE | LNET_MD_MANAGE_REMOTE |
LNET_MD_TRUNCATE; /* allow to make EOVERFLOW error */; LNET_MD_TRUNCATE; /* allow to make EOVERFLOW error */;
reply_md.user_ptr = &request->rq_reply_cbid; reply_md.user_ptr = &request->rq_reply_cbid;
reply_md.eq_handle = ptlrpc_eq_h; reply_md.eq_handle = ptlrpc_eq_h;
/* We must see the unlink callback to unset rq_reply_unlink, /* We must see the unlink callback to unset rq_reply_unlink,
...@@ -682,11 +682,11 @@ EXPORT_SYMBOL(ptl_send_rpc); ...@@ -682,11 +682,11 @@ EXPORT_SYMBOL(ptl_send_rpc);
*/ */
int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd) int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
{ {
struct ptlrpc_service *service = rqbd->rqbd_svcpt->scp_service; struct ptlrpc_service *service = rqbd->rqbd_svcpt->scp_service;
static lnet_process_id_t match_id = {LNET_NID_ANY, LNET_PID_ANY}; static lnet_process_id_t match_id = {LNET_NID_ANY, LNET_PID_ANY};
int rc; int rc;
lnet_md_t md; lnet_md_t md;
lnet_handle_me_t me_h; lnet_handle_me_t me_h;
CDEBUG(D_NET, "LNetMEAttach: portal %d\n", CDEBUG(D_NET, "LNetMEAttach: portal %d\n",
service->srv_req_portal); service->srv_req_portal);
...@@ -709,12 +709,12 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd) ...@@ -709,12 +709,12 @@ int ptlrpc_register_rqbd(struct ptlrpc_request_buffer_desc *rqbd)
LASSERT(rqbd->rqbd_refcount == 0); LASSERT(rqbd->rqbd_refcount == 0);
rqbd->rqbd_refcount = 1; rqbd->rqbd_refcount = 1;
md.start = rqbd->rqbd_buffer; md.start = rqbd->rqbd_buffer;
md.length = service->srv_buf_size; md.length = service->srv_buf_size;
md.max_size = service->srv_max_req_size; md.max_size = service->srv_max_req_size;
md.threshold = LNET_MD_THRESH_INF; md.threshold = LNET_MD_THRESH_INF;
md.options = PTLRPC_MD_OPTIONS | LNET_MD_OP_PUT | LNET_MD_MAX_SIZE; md.options = PTLRPC_MD_OPTIONS | LNET_MD_OP_PUT | LNET_MD_MAX_SIZE;
md.user_ptr = &rqbd->rqbd_cbid; md.user_ptr = &rqbd->rqbd_cbid;
md.eq_handle = ptlrpc_eq_h; md.eq_handle = ptlrpc_eq_h;
rc = LNetMDAttach(me_h, md, LNET_UNLINK, &rqbd->rqbd_md_h); rc = LNetMDAttach(me_h, md, LNET_UNLINK, &rqbd->rqbd_md_h);
......
This diff is collapsed.
...@@ -160,9 +160,9 @@ static int nrs_fifo_res_get(struct ptlrpc_nrs_policy *policy, ...@@ -160,9 +160,9 @@ static int nrs_fifo_res_get(struct ptlrpc_nrs_policy *policy,
*/ */
static static
struct ptlrpc_nrs_request *nrs_fifo_req_get(struct ptlrpc_nrs_policy *policy, 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; struct ptlrpc_nrs_request *nrq;
nrq = unlikely(list_empty(&head->fh_list)) ? NULL : nrq = unlikely(list_empty(&head->fh_list)) ? NULL :
......
...@@ -279,8 +279,8 @@ lustre_get_emerg_rs(struct ptlrpc_service_part *svcpt) ...@@ -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 */ /* See if we have anything in a pool, and wait if nothing */
while (list_empty(&svcpt->scp_rep_idle)) { while (list_empty(&svcpt->scp_rep_idle)) {
struct l_wait_info lwi; struct l_wait_info lwi;
int rc; int rc;
spin_unlock(&svcpt->scp_rep_lock); spin_unlock(&svcpt->scp_rep_lock);
/* If we cannot get anything for some long time, we better /* 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, ...@@ -321,7 +321,7 @@ int lustre_pack_reply_v2(struct ptlrpc_request *req, int count,
__u32 *lens, char **bufs, int flags) __u32 *lens, char **bufs, int flags)
{ {
struct ptlrpc_reply_state *rs; struct ptlrpc_reply_state *rs;
int msg_len, rc; int msg_len, rc;
LASSERT(req->rq_reply_state == NULL); LASSERT(req->rq_reply_state == NULL);
...@@ -440,8 +440,8 @@ EXPORT_SYMBOL(lustre_msg_buf); ...@@ -440,8 +440,8 @@ EXPORT_SYMBOL(lustre_msg_buf);
int lustre_shrink_msg_v2(struct lustre_msg_v2 *msg, int segment, int lustre_shrink_msg_v2(struct lustre_msg_v2 *msg, int segment,
unsigned int newlen, int move_data) unsigned int newlen, int move_data)
{ {
char *tail = NULL, *newpos; char *tail = NULL, *newpos;
int tail_len = 0, n; int tail_len = 0, n;
LASSERT(msg); LASSERT(msg);
LASSERT(msg->lm_bufcount > segment); LASSERT(msg->lm_bufcount > segment);
...@@ -1577,8 +1577,8 @@ int do_set_info_async(struct obd_import *imp, ...@@ -1577,8 +1577,8 @@ int do_set_info_async(struct obd_import *imp,
struct ptlrpc_request_set *set) struct ptlrpc_request_set *set)
{ {
struct ptlrpc_request *req; struct ptlrpc_request *req;
char *tmp; char *tmp;
int rc; int rc;
req = ptlrpc_request_alloc(imp, &RQF_OBD_SET_INFO); req = ptlrpc_request_alloc(imp, &RQF_OBD_SET_INFO);
if (req == NULL) if (req == NULL)
...@@ -1688,7 +1688,7 @@ void lustre_swab_connect(struct obd_connect_data *ocd) ...@@ -1688,7 +1688,7 @@ void lustre_swab_connect(struct obd_connect_data *ocd)
CLASSERT(offsetof(typeof(*ocd), paddingF) != 0); CLASSERT(offsetof(typeof(*ocd), paddingF) != 0);
} }
void lustre_swab_obdo(struct obdo *o) void lustre_swab_obdo(struct obdo *o)
{ {
__swab64s(&o->o_valid); __swab64s(&o->o_valid);
lustre_swab_ost_id(&o->o_oi); lustre_swab_ost_id(&o->o_oi);
...@@ -2179,7 +2179,7 @@ EXPORT_SYMBOL(lustre_swab_lov_user_md_objects); ...@@ -2179,7 +2179,7 @@ EXPORT_SYMBOL(lustre_swab_lov_user_md_objects);
void lustre_swab_ldlm_res_id(struct ldlm_res_id *id) void lustre_swab_ldlm_res_id(struct ldlm_res_id *id)
{ {
int i; int i;
for (i = 0; i < RES_NAME_SIZE; i++) for (i = 0; i < RES_NAME_SIZE; i++)
__swab64s(&id->name[i]); __swab64s(&id->name[i]);
......
...@@ -546,8 +546,8 @@ void ptlrpc_pinger_wake_up(void) ...@@ -546,8 +546,8 @@ void ptlrpc_pinger_wake_up(void)
#define PET_TERMINATE 2 #define PET_TERMINATE 2
static int pet_refcount; static int pet_refcount;
static int pet_state; static int pet_state;
static wait_queue_head_t pet_waitq; static wait_queue_head_t pet_waitq;
static LIST_HEAD(pet_list); static LIST_HEAD(pet_list);
static DEFINE_SPINLOCK(pet_lock); static DEFINE_SPINLOCK(pet_lock);
......
...@@ -68,9 +68,9 @@ ...@@ -68,9 +68,9 @@
#include "ptlrpc_internal.h" #include "ptlrpc_internal.h"
struct ptlrpcd { struct ptlrpcd {
int pd_size; int pd_size;
int pd_index; int pd_index;
int pd_nthreads; int pd_nthreads;
struct ptlrpcd_ctl pd_thread_rcv; struct ptlrpcd_ctl pd_thread_rcv;
struct ptlrpcd_ctl pd_threads[0]; struct ptlrpcd_ctl pd_threads[0];
}; };
......
...@@ -113,10 +113,10 @@ static ...@@ -113,10 +113,10 @@ static
struct ptlrpc_sec_policy *sptlrpc_wireflavor2policy(__u32 flavor) struct ptlrpc_sec_policy *sptlrpc_wireflavor2policy(__u32 flavor)
{ {
static DEFINE_MUTEX(load_mutex); static DEFINE_MUTEX(load_mutex);
static atomic_t loaded = ATOMIC_INIT(0); static atomic_t loaded = ATOMIC_INIT(0);
struct ptlrpc_sec_policy *policy; struct ptlrpc_sec_policy *policy;
__u16 number = SPTLRPC_FLVR_POLICY(flavor); __u16 number = SPTLRPC_FLVR_POLICY(flavor);
__u16 flag = 0; __u16 flag = 0;
if (number >= SPTLRPC_POLICY_MAX) if (number >= SPTLRPC_POLICY_MAX)
return NULL; return NULL;
...@@ -339,7 +339,7 @@ int sptlrpc_cli_ctx_display(struct ptlrpc_cli_ctx *ctx, char *buf, int bufsize) ...@@ -339,7 +339,7 @@ int sptlrpc_cli_ctx_display(struct ptlrpc_cli_ctx *ctx, char *buf, int bufsize)
static int import_sec_check_expire(struct obd_import *imp) static int import_sec_check_expire(struct obd_import *imp)
{ {
int adapt = 0; int adapt = 0;
spin_lock(&imp->imp_lock); spin_lock(&imp->imp_lock);
if (imp->imp_sec_expire && if (imp->imp_sec_expire &&
...@@ -359,7 +359,7 @@ static int import_sec_check_expire(struct obd_import *imp) ...@@ -359,7 +359,7 @@ static int import_sec_check_expire(struct obd_import *imp)
static int import_sec_validate_get(struct obd_import *imp, static int import_sec_validate_get(struct obd_import *imp,
struct ptlrpc_sec **sec) struct ptlrpc_sec **sec)
{ {
int rc; int rc;
if (unlikely(imp->imp_sec_expire)) { if (unlikely(imp->imp_sec_expire)) {
rc = import_sec_check_expire(imp); rc = import_sec_check_expire(imp);
...@@ -447,10 +447,10 @@ int sptlrpc_req_ctx_switch(struct ptlrpc_request *req, ...@@ -447,10 +447,10 @@ int sptlrpc_req_ctx_switch(struct ptlrpc_request *req,
struct ptlrpc_cli_ctx *oldctx, struct ptlrpc_cli_ctx *oldctx,
struct ptlrpc_cli_ctx *newctx) struct ptlrpc_cli_ctx *newctx)
{ {
struct sptlrpc_flavor old_flvr; struct sptlrpc_flavor old_flvr;
char *reqmsg = NULL; /* to workaround old gcc */ char *reqmsg = NULL; /* to workaround old gcc */
int reqmsg_size; int reqmsg_size;
int rc = 0; int rc = 0;
LASSERT(req->rq_reqmsg); LASSERT(req->rq_reqmsg);
LASSERT(req->rq_reqlen); LASSERT(req->rq_reqlen);
...@@ -514,7 +514,7 @@ int sptlrpc_req_replace_dead_ctx(struct ptlrpc_request *req) ...@@ -514,7 +514,7 @@ int sptlrpc_req_replace_dead_ctx(struct ptlrpc_request *req)
{ {
struct ptlrpc_cli_ctx *oldctx = req->rq_cli_ctx; struct ptlrpc_cli_ctx *oldctx = req->rq_cli_ctx;
struct ptlrpc_cli_ctx *newctx; struct ptlrpc_cli_ctx *newctx;
int rc; int rc;
LASSERT(oldctx); LASSERT(oldctx);
...@@ -629,10 +629,10 @@ void req_off_ctx_list(struct ptlrpc_request *req, struct ptlrpc_cli_ctx *ctx) ...@@ -629,10 +629,10 @@ void req_off_ctx_list(struct ptlrpc_request *req, struct ptlrpc_cli_ctx *ctx)
*/ */
int sptlrpc_req_refresh_ctx(struct ptlrpc_request *req, long timeout) int sptlrpc_req_refresh_ctx(struct ptlrpc_request *req, long timeout)
{ {
struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx; struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx;
struct ptlrpc_sec *sec; struct ptlrpc_sec *sec;
struct l_wait_info lwi; struct l_wait_info lwi;
int rc; int rc;
LASSERT(ctx); LASSERT(ctx);
...@@ -878,7 +878,7 @@ void sptlrpc_request_out_callback(struct ptlrpc_request *req) ...@@ -878,7 +878,7 @@ void sptlrpc_request_out_callback(struct ptlrpc_request *req)
*/ */
int sptlrpc_import_check_ctx(struct obd_import *imp) int sptlrpc_import_check_ctx(struct obd_import *imp)
{ {
struct ptlrpc_sec *sec; struct ptlrpc_sec *sec;
struct ptlrpc_cli_ctx *ctx; struct ptlrpc_cli_ctx *ctx;
struct ptlrpc_request *req = NULL; struct ptlrpc_request *req = NULL;
int rc; int rc;
...@@ -974,7 +974,7 @@ int sptlrpc_cli_wrap_request(struct ptlrpc_request *req) ...@@ -974,7 +974,7 @@ int sptlrpc_cli_wrap_request(struct ptlrpc_request *req)
static int do_cli_unwrap_reply(struct ptlrpc_request *req) static int do_cli_unwrap_reply(struct ptlrpc_request *req)
{ {
struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx; struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx;
int rc; int rc;
LASSERT(ctx); LASSERT(ctx);
LASSERT(ctx->cc_sec); LASSERT(ctx->cc_sec);
...@@ -1082,10 +1082,10 @@ int sptlrpc_cli_unwrap_reply(struct ptlrpc_request *req) ...@@ -1082,10 +1082,10 @@ int sptlrpc_cli_unwrap_reply(struct ptlrpc_request *req)
int sptlrpc_cli_unwrap_early_reply(struct ptlrpc_request *req, int sptlrpc_cli_unwrap_early_reply(struct ptlrpc_request *req,
struct ptlrpc_request **req_ret) struct ptlrpc_request **req_ret)
{ {
struct ptlrpc_request *early_req; struct ptlrpc_request *early_req;
char *early_buf; char *early_buf;
int early_bufsz, early_size; int early_bufsz, early_size;
int rc; int rc;
early_req = ptlrpc_request_cache_alloc(GFP_NOFS); early_req = ptlrpc_request_cache_alloc(GFP_NOFS);
if (early_req == NULL) if (early_req == NULL)
...@@ -1273,13 +1273,13 @@ EXPORT_SYMBOL(sptlrpc_sec_put); ...@@ -1273,13 +1273,13 @@ EXPORT_SYMBOL(sptlrpc_sec_put);
*/ */
static static
struct ptlrpc_sec *sptlrpc_sec_create(struct obd_import *imp, struct ptlrpc_sec *sptlrpc_sec_create(struct obd_import *imp,
struct ptlrpc_svc_ctx *svc_ctx, struct ptlrpc_svc_ctx *svc_ctx,
struct sptlrpc_flavor *sf, struct sptlrpc_flavor *sf,
enum lustre_sec_part sp) enum lustre_sec_part sp)
{ {
struct ptlrpc_sec_policy *policy; struct ptlrpc_sec_policy *policy;
struct ptlrpc_sec *sec; struct ptlrpc_sec *sec;
char str[32]; char str[32];
if (svc_ctx) { if (svc_ctx) {
LASSERT(imp->imp_dlm_fake == 1); LASSERT(imp->imp_dlm_fake == 1);
...@@ -1369,7 +1369,7 @@ static void sptlrpc_import_sec_adapt_inplace(struct obd_import *imp, ...@@ -1369,7 +1369,7 @@ static void sptlrpc_import_sec_adapt_inplace(struct obd_import *imp,
struct ptlrpc_sec *sec, struct ptlrpc_sec *sec,
struct sptlrpc_flavor *sf) struct sptlrpc_flavor *sf)
{ {
char str1[32], str2[32]; char str1[32], str2[32];
if (sec->ps_flvr.sf_flags != sf->sf_flags) if (sec->ps_flvr.sf_flags != sf->sf_flags)
CDEBUG(D_SEC, "changing sec flags: %s -> %s\n", CDEBUG(D_SEC, "changing sec flags: %s -> %s\n",
...@@ -1394,12 +1394,12 @@ int sptlrpc_import_sec_adapt(struct obd_import *imp, ...@@ -1394,12 +1394,12 @@ int sptlrpc_import_sec_adapt(struct obd_import *imp,
struct ptlrpc_svc_ctx *svc_ctx, struct ptlrpc_svc_ctx *svc_ctx,
struct sptlrpc_flavor *flvr) struct sptlrpc_flavor *flvr)
{ {
struct ptlrpc_connection *conn; struct ptlrpc_connection *conn;
struct sptlrpc_flavor sf; struct sptlrpc_flavor sf;
struct ptlrpc_sec *sec, *newsec; struct ptlrpc_sec *sec, *newsec;
enum lustre_sec_part sp; enum lustre_sec_part sp;
char str[24]; char str[24];
int rc = 0; int rc = 0;
might_sleep(); might_sleep();
...@@ -1436,7 +1436,7 @@ int sptlrpc_import_sec_adapt(struct obd_import *imp, ...@@ -1436,7 +1436,7 @@ int sptlrpc_import_sec_adapt(struct obd_import *imp,
sec = sptlrpc_import_sec_ref(imp); sec = sptlrpc_import_sec_ref(imp);
if (sec) { if (sec) {
char str2[24]; char str2[24];
if (flavor_equal(&sf, &sec->ps_flvr)) if (flavor_equal(&sf, &sec->ps_flvr))
goto out; goto out;
...@@ -1585,8 +1585,8 @@ void sptlrpc_cli_free_reqbuf(struct ptlrpc_request *req) ...@@ -1585,8 +1585,8 @@ void sptlrpc_cli_free_reqbuf(struct ptlrpc_request *req)
void _sptlrpc_enlarge_msg_inplace(struct lustre_msg *msg, void _sptlrpc_enlarge_msg_inplace(struct lustre_msg *msg,
int segment, int newsize) int segment, int newsize)
{ {
void *src, *dst; void *src, *dst;
int oldsize, oldmsg_size, movesize; int oldsize, oldmsg_size, movesize;
LASSERT(segment < msg->lm_bufcount); LASSERT(segment < msg->lm_bufcount);
LASSERT(msg->lm_buflens[segment] <= newsize); LASSERT(msg->lm_buflens[segment] <= newsize);
...@@ -1635,9 +1635,9 @@ EXPORT_SYMBOL(_sptlrpc_enlarge_msg_inplace); ...@@ -1635,9 +1635,9 @@ EXPORT_SYMBOL(_sptlrpc_enlarge_msg_inplace);
int sptlrpc_cli_enlarge_reqbuf(struct ptlrpc_request *req, int sptlrpc_cli_enlarge_reqbuf(struct ptlrpc_request *req,
int segment, int newsize) int segment, int newsize)
{ {
struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx; struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx;
struct ptlrpc_sec_cops *cops; struct ptlrpc_sec_cops *cops;
struct lustre_msg *msg = req->rq_reqmsg; struct lustre_msg *msg = req->rq_reqmsg;
LASSERT(ctx); LASSERT(ctx);
LASSERT(msg); LASSERT(msg);
...@@ -1748,7 +1748,7 @@ static int flavor_allowed(struct sptlrpc_flavor *exp, ...@@ -1748,7 +1748,7 @@ static int flavor_allowed(struct sptlrpc_flavor *exp,
int sptlrpc_target_export_check(struct obd_export *exp, int sptlrpc_target_export_check(struct obd_export *exp,
struct ptlrpc_request *req) struct ptlrpc_request *req)
{ {
struct sptlrpc_flavor flavor; struct sptlrpc_flavor flavor;
if (exp == NULL) if (exp == NULL)
return 0; return 0;
...@@ -1926,8 +1926,8 @@ EXPORT_SYMBOL(sptlrpc_target_export_check); ...@@ -1926,8 +1926,8 @@ EXPORT_SYMBOL(sptlrpc_target_export_check);
void sptlrpc_target_update_exp_flavor(struct obd_device *obd, void sptlrpc_target_update_exp_flavor(struct obd_device *obd,
struct sptlrpc_rule_set *rset) struct sptlrpc_rule_set *rset)
{ {
struct obd_export *exp; struct obd_export *exp;
struct sptlrpc_flavor new_flvr; struct sptlrpc_flavor new_flvr;
LASSERT(obd); LASSERT(obd);
...@@ -2019,8 +2019,8 @@ static int sptlrpc_svc_check_from(struct ptlrpc_request *req, int svc_rc) ...@@ -2019,8 +2019,8 @@ static int sptlrpc_svc_check_from(struct ptlrpc_request *req, int svc_rc)
int sptlrpc_svc_unwrap_request(struct ptlrpc_request *req) int sptlrpc_svc_unwrap_request(struct ptlrpc_request *req)
{ {
struct ptlrpc_sec_policy *policy; struct ptlrpc_sec_policy *policy;
struct lustre_msg *msg = req->rq_reqbuf; struct lustre_msg *msg = req->rq_reqbuf;
int rc; int rc;
LASSERT(msg); LASSERT(msg);
LASSERT(req->rq_reqmsg == NULL); LASSERT(req->rq_reqmsg == NULL);
...@@ -2231,8 +2231,8 @@ int sptlrpc_cli_unwrap_bulk_read(struct ptlrpc_request *req, ...@@ -2231,8 +2231,8 @@ int sptlrpc_cli_unwrap_bulk_read(struct ptlrpc_request *req,
struct ptlrpc_bulk_desc *desc, struct ptlrpc_bulk_desc *desc,
int nob) int nob)
{ {
struct ptlrpc_cli_ctx *ctx; struct ptlrpc_cli_ctx *ctx;
int rc; int rc;
LASSERT(req->rq_bulk_read && !req->rq_bulk_write); LASSERT(req->rq_bulk_read && !req->rq_bulk_write);
...@@ -2256,8 +2256,8 @@ EXPORT_SYMBOL(sptlrpc_cli_unwrap_bulk_read); ...@@ -2256,8 +2256,8 @@ EXPORT_SYMBOL(sptlrpc_cli_unwrap_bulk_read);
int sptlrpc_cli_unwrap_bulk_write(struct ptlrpc_request *req, int sptlrpc_cli_unwrap_bulk_write(struct ptlrpc_request *req,
struct ptlrpc_bulk_desc *desc) struct ptlrpc_bulk_desc *desc)
{ {
struct ptlrpc_cli_ctx *ctx; struct ptlrpc_cli_ctx *ctx;
int rc; int rc;
LASSERT(!req->rq_bulk_read && req->rq_bulk_write); LASSERT(!req->rq_bulk_read && req->rq_bulk_write);
...@@ -2329,7 +2329,7 @@ EXPORT_SYMBOL(sptlrpc_pack_user_desc); ...@@ -2329,7 +2329,7 @@ EXPORT_SYMBOL(sptlrpc_pack_user_desc);
int sptlrpc_unpack_user_desc(struct lustre_msg *msg, int offset, int swabbed) int sptlrpc_unpack_user_desc(struct lustre_msg *msg, int offset, int swabbed)
{ {
struct ptlrpc_user_desc *pud; struct ptlrpc_user_desc *pud;
int i; int i;
pud = lustre_msg_buf(msg, offset, sizeof(*pud)); pud = lustre_msg_buf(msg, offset, sizeof(*pud));
if (!pud) if (!pud)
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
#define POINTERS_PER_PAGE (PAGE_CACHE_SIZE / sizeof(void *)) #define POINTERS_PER_PAGE (PAGE_CACHE_SIZE / sizeof(void *))
#define PAGES_PER_POOL (POINTERS_PER_PAGE) #define PAGES_PER_POOL (POINTERS_PER_PAGE)
#define IDLE_IDX_MAX (100) #define IDLE_IDX_MAX (100)
#define IDLE_IDX_WEIGHT (3) #define IDLE_IDX_WEIGHT (3)
#define CACHE_QUIESCENT_PERIOD (20) #define CACHE_QUIESCENT_PERIOD (20)
...@@ -173,8 +173,8 @@ int sptlrpc_proc_enc_pool_seq_show(struct seq_file *m, void *v) ...@@ -173,8 +173,8 @@ int sptlrpc_proc_enc_pool_seq_show(struct seq_file *m, void *v)
static void enc_pools_release_free_pages(long npages) static void enc_pools_release_free_pages(long npages)
{ {
int p_idx, g_idx; int p_idx, g_idx;
int p_idx_max1, p_idx_max2; int p_idx_max1, p_idx_max2;
LASSERT(npages > 0); LASSERT(npages > 0);
LASSERT(npages <= page_pools.epp_free_pages); LASSERT(npages <= page_pools.epp_free_pages);
...@@ -284,7 +284,7 @@ int npages_to_npools(unsigned long npages) ...@@ -284,7 +284,7 @@ int npages_to_npools(unsigned long npages)
static unsigned long enc_pools_cleanup(struct page ***pools, int npools) static unsigned long enc_pools_cleanup(struct page ***pools, int npools)
{ {
unsigned long cleaned = 0; unsigned long cleaned = 0;
int i, j; int i, j;
for (i = 0; i < npools; i++) { for (i = 0; i < npools; i++) {
if (pools[i]) { if (pools[i]) {
...@@ -311,9 +311,9 @@ static unsigned long enc_pools_cleanup(struct page ***pools, int npools) ...@@ -311,9 +311,9 @@ static unsigned long enc_pools_cleanup(struct page ***pools, int npools)
*/ */
static void enc_pools_insert(struct page ***pools, int npools, int npages) static void enc_pools_insert(struct page ***pools, int npools, int npages)
{ {
int freeslot; int freeslot;
int op_idx, np_idx, og_idx, ng_idx; int op_idx, np_idx, og_idx, ng_idx;
int cur_npools, end_npools; int cur_npools, end_npools;
LASSERT(npages > 0); LASSERT(npages > 0);
LASSERT(page_pools.epp_total_pages+npages <= page_pools.epp_max_pages); LASSERT(page_pools.epp_total_pages+npages <= page_pools.epp_max_pages);
...@@ -393,9 +393,9 @@ static void enc_pools_insert(struct page ***pools, int npools, int npages) ...@@ -393,9 +393,9 @@ static void enc_pools_insert(struct page ***pools, int npools, int npages)
static int enc_pools_add_pages(int npages) static int enc_pools_add_pages(int npages)
{ {
static DEFINE_MUTEX(add_pages_mutex); static DEFINE_MUTEX(add_pages_mutex);
struct page ***pools; struct page ***pools;
int npools, alloced = 0; int npools, alloced = 0;
int i, j, rc = -ENOMEM; int i, j, rc = -ENOMEM;
if (npages < PTLRPC_MAX_BRW_PAGES) if (npages < PTLRPC_MAX_BRW_PAGES)
npages = PTLRPC_MAX_BRW_PAGES; npages = PTLRPC_MAX_BRW_PAGES;
...@@ -494,12 +494,12 @@ static int enc_pools_should_grow(int page_needed, long now) ...@@ -494,12 +494,12 @@ static int enc_pools_should_grow(int page_needed, long now)
*/ */
int sptlrpc_enc_pool_get_pages(struct ptlrpc_bulk_desc *desc) int sptlrpc_enc_pool_get_pages(struct ptlrpc_bulk_desc *desc)
{ {
wait_queue_t waitlink; wait_queue_t waitlink;
unsigned long this_idle = -1; unsigned long this_idle = -1;
unsigned long tick = 0; unsigned long tick = 0;
long now; long now;
int p_idx, g_idx; int p_idx, g_idx;
int i; int i;
LASSERT(desc->bd_iov_count > 0); LASSERT(desc->bd_iov_count > 0);
LASSERT(desc->bd_iov_count <= page_pools.epp_max_pages); LASSERT(desc->bd_iov_count <= page_pools.epp_max_pages);
...@@ -609,8 +609,8 @@ EXPORT_SYMBOL(sptlrpc_enc_pool_get_pages); ...@@ -609,8 +609,8 @@ EXPORT_SYMBOL(sptlrpc_enc_pool_get_pages);
void sptlrpc_enc_pool_put_pages(struct ptlrpc_bulk_desc *desc) void sptlrpc_enc_pool_put_pages(struct ptlrpc_bulk_desc *desc)
{ {
int p_idx, g_idx; int p_idx, g_idx;
int i; int i;
if (desc->bd_enc_iov == NULL) if (desc->bd_enc_iov == NULL)
return; return;
...@@ -658,7 +658,7 @@ EXPORT_SYMBOL(sptlrpc_enc_pool_put_pages); ...@@ -658,7 +658,7 @@ EXPORT_SYMBOL(sptlrpc_enc_pool_put_pages);
*/ */
int sptlrpc_enc_pool_add_user(void) int sptlrpc_enc_pool_add_user(void)
{ {
int need_grow = 0; int need_grow = 0;
spin_lock(&page_pools.epp_lock); spin_lock(&page_pools.epp_lock);
if (page_pools.epp_growing == 0 && page_pools.epp_total_pages == 0) { if (page_pools.epp_growing == 0 && page_pools.epp_total_pages == 0) {
...@@ -842,11 +842,11 @@ EXPORT_SYMBOL(bulk_sec_desc_unpack); ...@@ -842,11 +842,11 @@ EXPORT_SYMBOL(bulk_sec_desc_unpack);
int sptlrpc_get_bulk_checksum(struct ptlrpc_bulk_desc *desc, __u8 alg, int sptlrpc_get_bulk_checksum(struct ptlrpc_bulk_desc *desc, __u8 alg,
void *buf, int buflen) void *buf, int buflen)
{ {
struct cfs_crypto_hash_desc *hdesc; struct cfs_crypto_hash_desc *hdesc;
int hashsize; int hashsize;
char hashbuf[64]; char hashbuf[64];
unsigned int bufsize; unsigned int bufsize;
int i, err; int i, err;
LASSERT(alg > BULK_HASH_ALG_NULL && alg < BULK_HASH_ALG_MAX); LASSERT(alg > BULK_HASH_ALG_NULL && alg < BULK_HASH_ALG_MAX);
LASSERT(buflen >= 4); LASSERT(buflen >= 4);
......
...@@ -94,8 +94,8 @@ EXPORT_SYMBOL(sptlrpc_target_sec_part); ...@@ -94,8 +94,8 @@ EXPORT_SYMBOL(sptlrpc_target_sec_part);
*/ */
int sptlrpc_parse_flavor(const char *str, struct sptlrpc_flavor *flvr) int sptlrpc_parse_flavor(const char *str, struct sptlrpc_flavor *flvr)
{ {
char buf[32]; char buf[32];
char *bulk, *alg; char *bulk, *alg;
memset(flvr, 0, sizeof(*flvr)); memset(flvr, 0, sizeof(*flvr));
...@@ -182,8 +182,8 @@ static void sptlrpc_rule_init(struct sptlrpc_rule *rule) ...@@ -182,8 +182,8 @@ static void sptlrpc_rule_init(struct sptlrpc_rule *rule)
*/ */
int sptlrpc_parse_rule(char *param, struct sptlrpc_rule *rule) int sptlrpc_parse_rule(char *param, struct sptlrpc_rule *rule)
{ {
char *flavor, *dir; char *flavor, *dir;
int rc; int rc;
sptlrpc_rule_init(rule); sptlrpc_rule_init(rule);
...@@ -309,9 +309,9 @@ static inline int rule_match_net(struct sptlrpc_rule *r1, ...@@ -309,9 +309,9 @@ static inline int rule_match_net(struct sptlrpc_rule *r1,
int sptlrpc_rule_set_merge(struct sptlrpc_rule_set *rset, int sptlrpc_rule_set_merge(struct sptlrpc_rule_set *rset,
struct sptlrpc_rule *rule) struct sptlrpc_rule *rule)
{ {
struct sptlrpc_rule *p = rset->srs_rules; struct sptlrpc_rule *p = rset->srs_rules;
int spec_dir, spec_net; int spec_dir, spec_net;
int rc, n, match = 0; int rc, n, match = 0;
might_sleep(); might_sleep();
...@@ -403,8 +403,8 @@ int sptlrpc_rule_set_choose(struct sptlrpc_rule_set *rset, ...@@ -403,8 +403,8 @@ int sptlrpc_rule_set_choose(struct sptlrpc_rule_set *rset,
lnet_nid_t nid, lnet_nid_t nid,
struct sptlrpc_flavor *sf) struct sptlrpc_flavor *sf)
{ {
struct sptlrpc_rule *r; struct sptlrpc_rule *r;
int n; int n;
for (n = 0; n < rset->srs_nrule; n++) { for (n = 0; n < rset->srs_nrule; n++) {
r = &rset->srs_rules[n]; r = &rset->srs_rules[n];
...@@ -433,7 +433,7 @@ EXPORT_SYMBOL(sptlrpc_rule_set_choose); ...@@ -433,7 +433,7 @@ EXPORT_SYMBOL(sptlrpc_rule_set_choose);
void sptlrpc_rule_set_dump(struct sptlrpc_rule_set *rset) void sptlrpc_rule_set_dump(struct sptlrpc_rule_set *rset)
{ {
struct sptlrpc_rule *r; struct sptlrpc_rule *r;
int n; int n;
for (n = 0; n < rset->srs_nrule; n++) { for (n = 0; n < rset->srs_nrule; n++) {
r = &rset->srs_rules[n]; r = &rset->srs_rules[n];
...@@ -474,8 +474,8 @@ static inline int is_hex(char c) ...@@ -474,8 +474,8 @@ static inline int is_hex(char c)
static void target2fsname(const char *tgt, char *fsname, int buflen) static void target2fsname(const char *tgt, char *fsname, int buflen)
{ {
const char *ptr; const char *ptr;
int len; int len;
ptr = strrchr(tgt, '-'); ptr = strrchr(tgt, '-');
if (ptr) { if (ptr) {
...@@ -583,8 +583,8 @@ static int sptlrpc_conf_merge_rule(struct sptlrpc_conf *conf, ...@@ -583,8 +583,8 @@ static int sptlrpc_conf_merge_rule(struct sptlrpc_conf *conf,
const char *target, const char *target,
struct sptlrpc_rule *rule) struct sptlrpc_rule *rule)
{ {
struct sptlrpc_conf_tgt *conf_tgt; struct sptlrpc_conf_tgt *conf_tgt;
struct sptlrpc_rule_set *rule_set; struct sptlrpc_rule_set *rule_set;
/* fsname == target means general rules for the whole fs */ /* fsname == target means general rules for the whole fs */
if (strcmp(conf->sc_fsname, target) == 0) { if (strcmp(conf->sc_fsname, target) == 0) {
...@@ -610,10 +610,10 @@ static int sptlrpc_conf_merge_rule(struct sptlrpc_conf *conf, ...@@ -610,10 +610,10 @@ static int sptlrpc_conf_merge_rule(struct sptlrpc_conf *conf,
static int __sptlrpc_process_config(struct lustre_cfg *lcfg, static int __sptlrpc_process_config(struct lustre_cfg *lcfg,
struct sptlrpc_conf *conf) struct sptlrpc_conf *conf)
{ {
char *target, *param; char *target, *param;
char fsname[MTI_NAME_MAXLEN]; char fsname[MTI_NAME_MAXLEN];
struct sptlrpc_rule rule; struct sptlrpc_rule rule;
int rc; int rc;
target = lustre_cfg_string(lcfg, 1); target = lustre_cfg_string(lcfg, 1);
if (target == NULL) { if (target == NULL) {
...@@ -671,8 +671,8 @@ EXPORT_SYMBOL(sptlrpc_process_config); ...@@ -671,8 +671,8 @@ EXPORT_SYMBOL(sptlrpc_process_config);
static int logname2fsname(const char *logname, char *buf, int buflen) static int logname2fsname(const char *logname, char *buf, int buflen)
{ {
char *ptr; char *ptr;
int len; int len;
ptr = strrchr(logname, '-'); ptr = strrchr(logname, '-');
if (ptr == NULL || strcmp(ptr, "-sptlrpc")) { if (ptr == NULL || strcmp(ptr, "-sptlrpc")) {
...@@ -690,7 +690,7 @@ static int logname2fsname(const char *logname, char *buf, int buflen) ...@@ -690,7 +690,7 @@ static int logname2fsname(const char *logname, char *buf, int buflen)
void sptlrpc_conf_log_update_begin(const char *logname) void sptlrpc_conf_log_update_begin(const char *logname)
{ {
struct sptlrpc_conf *conf; struct sptlrpc_conf *conf;
char fsname[16]; char fsname[16];
if (logname2fsname(logname, fsname, sizeof(fsname))) if (logname2fsname(logname, fsname, sizeof(fsname)))
return; return;
...@@ -716,7 +716,7 @@ EXPORT_SYMBOL(sptlrpc_conf_log_update_begin); ...@@ -716,7 +716,7 @@ EXPORT_SYMBOL(sptlrpc_conf_log_update_begin);
void sptlrpc_conf_log_update_end(const char *logname) void sptlrpc_conf_log_update_end(const char *logname)
{ {
struct sptlrpc_conf *conf; struct sptlrpc_conf *conf;
char fsname[16]; char fsname[16];
if (logname2fsname(logname, fsname, sizeof(fsname))) if (logname2fsname(logname, fsname, sizeof(fsname)))
return; return;
...@@ -741,7 +741,7 @@ EXPORT_SYMBOL(sptlrpc_conf_log_update_end); ...@@ -741,7 +741,7 @@ EXPORT_SYMBOL(sptlrpc_conf_log_update_end);
void sptlrpc_conf_log_start(const char *logname) void sptlrpc_conf_log_start(const char *logname)
{ {
char fsname[16]; char fsname[16];
if (logname2fsname(logname, fsname, sizeof(fsname))) if (logname2fsname(logname, fsname, sizeof(fsname)))
return; return;
...@@ -755,7 +755,7 @@ EXPORT_SYMBOL(sptlrpc_conf_log_start); ...@@ -755,7 +755,7 @@ EXPORT_SYMBOL(sptlrpc_conf_log_start);
void sptlrpc_conf_log_stop(const char *logname) void sptlrpc_conf_log_stop(const char *logname)
{ {
struct sptlrpc_conf *conf; struct sptlrpc_conf *conf;
char fsname[16]; char fsname[16];
if (logname2fsname(logname, fsname, sizeof(fsname))) if (logname2fsname(logname, fsname, sizeof(fsname)))
return; return;
...@@ -799,10 +799,10 @@ void sptlrpc_conf_choose_flavor(enum lustre_sec_part from, ...@@ -799,10 +799,10 @@ void sptlrpc_conf_choose_flavor(enum lustre_sec_part from,
lnet_nid_t nid, lnet_nid_t nid,
struct sptlrpc_flavor *sf) struct sptlrpc_flavor *sf)
{ {
struct sptlrpc_conf *conf; struct sptlrpc_conf *conf;
struct sptlrpc_conf_tgt *conf_tgt; struct sptlrpc_conf_tgt *conf_tgt;
char name[MTI_NAME_MAXLEN]; char name[MTI_NAME_MAXLEN];
int len, rc = 0; int len, rc = 0;
target2fsname(target->uuid, name, sizeof(name)); target2fsname(target->uuid, name, sizeof(name));
...@@ -858,7 +858,7 @@ EXPORT_SYMBOL(sptlrpc_target_choose_flavor); ...@@ -858,7 +858,7 @@ EXPORT_SYMBOL(sptlrpc_target_choose_flavor);
*/ */
void sptlrpc_conf_client_adapt(struct obd_device *obd) void sptlrpc_conf_client_adapt(struct obd_device *obd)
{ {
struct obd_import *imp; struct obd_import *imp;
LASSERT(strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 || LASSERT(strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0); strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME) == 0);
...@@ -880,7 +880,7 @@ void sptlrpc_conf_client_adapt(struct obd_device *obd) ...@@ -880,7 +880,7 @@ void sptlrpc_conf_client_adapt(struct obd_device *obd)
} }
EXPORT_SYMBOL(sptlrpc_conf_client_adapt); EXPORT_SYMBOL(sptlrpc_conf_client_adapt);
int sptlrpc_conf_init(void) int sptlrpc_conf_init(void)
{ {
mutex_init(&sptlrpc_conf_lock); mutex_init(&sptlrpc_conf_lock);
return 0; return 0;
...@@ -888,7 +888,7 @@ int sptlrpc_conf_init(void) ...@@ -888,7 +888,7 @@ int sptlrpc_conf_init(void)
void sptlrpc_conf_fini(void) void sptlrpc_conf_fini(void)
{ {
struct sptlrpc_conf *conf, *conf_next; struct sptlrpc_conf *conf, *conf_next;
mutex_lock(&sptlrpc_conf_lock); mutex_lock(&sptlrpc_conf_lock);
list_for_each_entry_safe(conf, conf_next, &sptlrpc_confs, sc_list) { list_for_each_entry_safe(conf, conf_next, &sptlrpc_confs, sc_list) {
......
...@@ -164,7 +164,7 @@ static void sec_do_gc(struct ptlrpc_sec *sec) ...@@ -164,7 +164,7 @@ static void sec_do_gc(struct ptlrpc_sec *sec)
static int sec_gc_main(void *arg) static int sec_gc_main(void *arg)
{ {
struct ptlrpc_thread *thread = (struct ptlrpc_thread *) arg; struct ptlrpc_thread *thread = (struct ptlrpc_thread *) arg;
struct l_wait_info lwi; struct l_wait_info lwi;
unshare_fs_struct(); unshare_fs_struct();
......
...@@ -74,7 +74,7 @@ static int sptlrpc_info_lprocfs_seq_show(struct seq_file *seq, void *v) ...@@ -74,7 +74,7 @@ static int sptlrpc_info_lprocfs_seq_show(struct seq_file *seq, void *v)
struct obd_device *dev = seq->private; struct obd_device *dev = seq->private;
struct client_obd *cli = &dev->u.cli; struct client_obd *cli = &dev->u.cli;
struct ptlrpc_sec *sec = NULL; struct ptlrpc_sec *sec = NULL;
char str[32]; char str[32];
LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 || LASSERT(strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) == 0 ||
strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 || strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) == 0 ||
...@@ -134,7 +134,7 @@ LPROC_SEQ_FOPS_RO(sptlrpc_ctxs_lprocfs); ...@@ -134,7 +134,7 @@ LPROC_SEQ_FOPS_RO(sptlrpc_ctxs_lprocfs);
int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev) int sptlrpc_lprocfs_cliobd_attach(struct obd_device *dev)
{ {
int rc; int rc;
if (strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) != 0 && if (strcmp(dev->obd_type->typ_name, LUSTRE_OSC_NAME) != 0 &&
strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) != 0 && strcmp(dev->obd_type->typ_name, LUSTRE_MDC_NAME) != 0 &&
......
...@@ -92,7 +92,7 @@ int null_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) ...@@ -92,7 +92,7 @@ int null_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
static static
int null_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) int null_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
{ {
__u32 cksums, cksumc; __u32 cksums, cksumc;
LASSERT(req->rq_repdata); LASSERT(req->rq_repdata);
...@@ -226,9 +226,9 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec, ...@@ -226,9 +226,9 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec,
struct ptlrpc_request *req, struct ptlrpc_request *req,
int segment, int newsize) int segment, int newsize)
{ {
struct lustre_msg *newbuf; struct lustre_msg *newbuf;
struct lustre_msg *oldbuf = req->rq_reqmsg; struct lustre_msg *oldbuf = req->rq_reqmsg;
int oldsize, newmsg_size, alloc_size; int oldsize, newmsg_size, alloc_size;
LASSERT(req->rq_reqbuf); LASSERT(req->rq_reqbuf);
LASSERT(req->rq_reqbuf == req->rq_reqmsg); LASSERT(req->rq_reqbuf == req->rq_reqmsg);
......
...@@ -136,7 +136,7 @@ static int plain_verify_bulk_csum(struct ptlrpc_bulk_desc *desc, ...@@ -136,7 +136,7 @@ static int plain_verify_bulk_csum(struct ptlrpc_bulk_desc *desc,
struct plain_bulk_token *tokenr) struct plain_bulk_token *tokenr)
{ {
struct plain_bulk_token tokenv; struct plain_bulk_token tokenv;
int rc; int rc;
if (hash_alg == BULK_HASH_ALG_NULL) if (hash_alg == BULK_HASH_ALG_NULL)
return 0; return 0;
...@@ -154,8 +154,8 @@ static int plain_verify_bulk_csum(struct ptlrpc_bulk_desc *desc, ...@@ -154,8 +154,8 @@ static int plain_verify_bulk_csum(struct ptlrpc_bulk_desc *desc,
static void corrupt_bulk_data(struct ptlrpc_bulk_desc *desc) static void corrupt_bulk_data(struct ptlrpc_bulk_desc *desc)
{ {
char *ptr; char *ptr;
unsigned int off, i; unsigned int off, i;
for (i = 0; i < desc->bd_iov_count; i++) { for (i = 0; i < desc->bd_iov_count; i++) {
if (desc->bd_iov[i].kiov_len == 0) if (desc->bd_iov[i].kiov_len == 0)
...@@ -190,7 +190,7 @@ int plain_ctx_validate(struct ptlrpc_cli_ctx *ctx) ...@@ -190,7 +190,7 @@ int plain_ctx_validate(struct ptlrpc_cli_ctx *ctx)
static static
int plain_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) int plain_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
{ {
struct lustre_msg *msg = req->rq_reqbuf; struct lustre_msg *msg = req->rq_reqbuf;
struct plain_header *phdr; struct plain_header *phdr;
msg->lm_secflvr = req->rq_flvr.sf_rpc; msg->lm_secflvr = req->rq_flvr.sf_rpc;
...@@ -214,10 +214,10 @@ int plain_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) ...@@ -214,10 +214,10 @@ int plain_ctx_sign(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
static static
int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
{ {
struct lustre_msg *msg = req->rq_repdata; struct lustre_msg *msg = req->rq_repdata;
struct plain_header *phdr; struct plain_header *phdr;
__u32 cksum; __u32 cksum;
int swabbed; int swabbed;
if (msg->lm_bufcount != PLAIN_PACK_SEGMENTS) { if (msg->lm_bufcount != PLAIN_PACK_SEGMENTS) {
CERROR("unexpected reply buf count %u\n", msg->lm_bufcount); CERROR("unexpected reply buf count %u\n", msg->lm_bufcount);
...@@ -290,8 +290,8 @@ int plain_cli_wrap_bulk(struct ptlrpc_cli_ctx *ctx, ...@@ -290,8 +290,8 @@ int plain_cli_wrap_bulk(struct ptlrpc_cli_ctx *ctx,
struct ptlrpc_bulk_desc *desc) struct ptlrpc_bulk_desc *desc)
{ {
struct ptlrpc_bulk_sec_desc *bsd; struct ptlrpc_bulk_sec_desc *bsd;
struct plain_bulk_token *token; struct plain_bulk_token *token;
int rc; int rc;
LASSERT(req->rq_pack_bulk); LASSERT(req->rq_pack_bulk);
LASSERT(req->rq_reqbuf->lm_bufcount == PLAIN_PACK_SEGMENTS); LASSERT(req->rq_reqbuf->lm_bufcount == PLAIN_PACK_SEGMENTS);
...@@ -333,9 +333,9 @@ int plain_cli_unwrap_bulk(struct ptlrpc_cli_ctx *ctx, ...@@ -333,9 +333,9 @@ int plain_cli_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
struct ptlrpc_bulk_desc *desc) struct ptlrpc_bulk_desc *desc)
{ {
struct ptlrpc_bulk_sec_desc *bsdv; struct ptlrpc_bulk_sec_desc *bsdv;
struct plain_bulk_token *tokenv; struct plain_bulk_token *tokenv;
int rc; int rc;
int i, nob; int i, nob;
LASSERT(req->rq_pack_bulk); LASSERT(req->rq_pack_bulk);
LASSERT(req->rq_reqbuf->lm_bufcount == PLAIN_PACK_SEGMENTS); LASSERT(req->rq_reqbuf->lm_bufcount == PLAIN_PACK_SEGMENTS);
...@@ -374,7 +374,7 @@ int plain_cli_unwrap_bulk(struct ptlrpc_cli_ctx *ctx, ...@@ -374,7 +374,7 @@ int plain_cli_unwrap_bulk(struct ptlrpc_cli_ctx *ctx,
static static
struct ptlrpc_cli_ctx *plain_sec_install_ctx(struct plain_sec *plsec) struct ptlrpc_cli_ctx *plain_sec_install_ctx(struct plain_sec *plsec)
{ {
struct ptlrpc_cli_ctx *ctx, *ctx_new; struct ptlrpc_cli_ctx *ctx, *ctx_new;
ctx_new = kzalloc(sizeof(*ctx_new), GFP_NOFS); ctx_new = kzalloc(sizeof(*ctx_new), GFP_NOFS);
...@@ -413,7 +413,7 @@ struct ptlrpc_cli_ctx *plain_sec_install_ctx(struct plain_sec *plsec) ...@@ -413,7 +413,7 @@ struct ptlrpc_cli_ctx *plain_sec_install_ctx(struct plain_sec *plsec)
static static
void plain_destroy_sec(struct ptlrpc_sec *sec) void plain_destroy_sec(struct ptlrpc_sec *sec)
{ {
struct plain_sec *plsec = sec2plsec(sec); struct plain_sec *plsec = sec2plsec(sec);
LASSERT(sec->ps_policy == &plain_policy); LASSERT(sec->ps_policy == &plain_policy);
LASSERT(sec->ps_import); LASSERT(sec->ps_import);
...@@ -437,9 +437,9 @@ struct ptlrpc_sec *plain_create_sec(struct obd_import *imp, ...@@ -437,9 +437,9 @@ struct ptlrpc_sec *plain_create_sec(struct obd_import *imp,
struct ptlrpc_svc_ctx *svc_ctx, struct ptlrpc_svc_ctx *svc_ctx,
struct sptlrpc_flavor *sf) struct sptlrpc_flavor *sf)
{ {
struct plain_sec *plsec; struct plain_sec *plsec;
struct ptlrpc_sec *sec; struct ptlrpc_sec *sec;
struct ptlrpc_cli_ctx *ctx; struct ptlrpc_cli_ctx *ctx;
LASSERT(SPTLRPC_FLVR_POLICY(sf->sf_rpc) == SPTLRPC_POLICY_PLAIN); LASSERT(SPTLRPC_FLVR_POLICY(sf->sf_rpc) == SPTLRPC_POLICY_PLAIN);
...@@ -483,8 +483,8 @@ struct ptlrpc_cli_ctx *plain_lookup_ctx(struct ptlrpc_sec *sec, ...@@ -483,8 +483,8 @@ struct ptlrpc_cli_ctx *plain_lookup_ctx(struct ptlrpc_sec *sec,
struct vfs_cred *vcred, struct vfs_cred *vcred,
int create, int remove_dead) int create, int remove_dead)
{ {
struct plain_sec *plsec = sec2plsec(sec); struct plain_sec *plsec = sec2plsec(sec);
struct ptlrpc_cli_ctx *ctx; struct ptlrpc_cli_ctx *ctx;
read_lock(&plsec->pls_lock); read_lock(&plsec->pls_lock);
ctx = plsec->pls_ctx; ctx = plsec->pls_ctx;
...@@ -517,8 +517,8 @@ static ...@@ -517,8 +517,8 @@ static
int plain_flush_ctx_cache(struct ptlrpc_sec *sec, int plain_flush_ctx_cache(struct ptlrpc_sec *sec,
uid_t uid, int grace, int force) uid_t uid, int grace, int force)
{ {
struct plain_sec *plsec = sec2plsec(sec); struct plain_sec *plsec = sec2plsec(sec);
struct ptlrpc_cli_ctx *ctx; struct ptlrpc_cli_ctx *ctx;
/* do nothing unless caller want to flush for 'all' */ /* do nothing unless caller want to flush for 'all' */
if (uid != -1) if (uid != -1)
...@@ -540,7 +540,7 @@ int plain_alloc_reqbuf(struct ptlrpc_sec *sec, ...@@ -540,7 +540,7 @@ int plain_alloc_reqbuf(struct ptlrpc_sec *sec,
int msgsize) int msgsize)
{ {
__u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, }; __u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
int alloc_len; int alloc_len;
buflens[PLAIN_PACK_HDR_OFF] = sizeof(struct plain_header); buflens[PLAIN_PACK_HDR_OFF] = sizeof(struct plain_header);
buflens[PLAIN_PACK_MSG_OFF] = msgsize; buflens[PLAIN_PACK_MSG_OFF] = msgsize;
...@@ -635,9 +635,9 @@ int plain_enlarge_reqbuf(struct ptlrpc_sec *sec, ...@@ -635,9 +635,9 @@ int plain_enlarge_reqbuf(struct ptlrpc_sec *sec,
struct ptlrpc_request *req, struct ptlrpc_request *req,
int segment, int newsize) int segment, int newsize)
{ {
struct lustre_msg *newbuf; struct lustre_msg *newbuf;
int oldsize; int oldsize;
int newmsg_size, newbuf_size; int newmsg_size, newbuf_size;
LASSERT(req->rq_reqbuf); LASSERT(req->rq_reqbuf);
LASSERT(req->rq_reqbuf_len >= req->rq_reqlen); LASSERT(req->rq_reqbuf_len >= req->rq_reqlen);
...@@ -709,9 +709,9 @@ static struct ptlrpc_svc_ctx plain_svc_ctx = { ...@@ -709,9 +709,9 @@ static struct ptlrpc_svc_ctx plain_svc_ctx = {
static static
int plain_accept(struct ptlrpc_request *req) int plain_accept(struct ptlrpc_request *req)
{ {
struct lustre_msg *msg = req->rq_reqbuf; struct lustre_msg *msg = req->rq_reqbuf;
struct plain_header *phdr; struct plain_header *phdr;
int swabbed; int swabbed;
LASSERT(SPTLRPC_FLVR_POLICY(req->rq_flvr.sf_rpc) == LASSERT(SPTLRPC_FLVR_POLICY(req->rq_flvr.sf_rpc) ==
SPTLRPC_POLICY_PLAIN); SPTLRPC_POLICY_PLAIN);
...@@ -780,9 +780,9 @@ int plain_accept(struct ptlrpc_request *req) ...@@ -780,9 +780,9 @@ int plain_accept(struct ptlrpc_request *req)
static static
int plain_alloc_rs(struct ptlrpc_request *req, int msgsize) int plain_alloc_rs(struct ptlrpc_request *req, int msgsize)
{ {
struct ptlrpc_reply_state *rs; struct ptlrpc_reply_state *rs;
__u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, }; __u32 buflens[PLAIN_PACK_SEGMENTS] = { 0, };
int rs_size = sizeof(*rs); int rs_size = sizeof(*rs);
LASSERT(msgsize % 8 == 0); LASSERT(msgsize % 8 == 0);
...@@ -833,9 +833,9 @@ static ...@@ -833,9 +833,9 @@ static
int plain_authorize(struct ptlrpc_request *req) int plain_authorize(struct ptlrpc_request *req)
{ {
struct ptlrpc_reply_state *rs = req->rq_reply_state; struct ptlrpc_reply_state *rs = req->rq_reply_state;
struct lustre_msg_v2 *msg = rs->rs_repbuf; struct lustre_msg_v2 *msg = rs->rs_repbuf;
struct plain_header *phdr; struct plain_header *phdr;
int len; int len;
LASSERT(rs); LASSERT(rs);
LASSERT(msg); LASSERT(msg);
...@@ -880,10 +880,10 @@ static ...@@ -880,10 +880,10 @@ static
int plain_svc_unwrap_bulk(struct ptlrpc_request *req, int plain_svc_unwrap_bulk(struct ptlrpc_request *req,
struct ptlrpc_bulk_desc *desc) struct ptlrpc_bulk_desc *desc)
{ {
struct ptlrpc_reply_state *rs = req->rq_reply_state; struct ptlrpc_reply_state *rs = req->rq_reply_state;
struct ptlrpc_bulk_sec_desc *bsdr, *bsdv; struct ptlrpc_bulk_sec_desc *bsdr, *bsdv;
struct plain_bulk_token *tokenr; struct plain_bulk_token *tokenr;
int rc; int rc;
LASSERT(req->rq_bulk_write); LASSERT(req->rq_bulk_write);
LASSERT(req->rq_pack_bulk); LASSERT(req->rq_pack_bulk);
...@@ -914,10 +914,10 @@ static ...@@ -914,10 +914,10 @@ static
int plain_svc_wrap_bulk(struct ptlrpc_request *req, int plain_svc_wrap_bulk(struct ptlrpc_request *req,
struct ptlrpc_bulk_desc *desc) struct ptlrpc_bulk_desc *desc)
{ {
struct ptlrpc_reply_state *rs = req->rq_reply_state; struct ptlrpc_reply_state *rs = req->rq_reply_state;
struct ptlrpc_bulk_sec_desc *bsdr, *bsdv; struct ptlrpc_bulk_sec_desc *bsdr, *bsdv;
struct plain_bulk_token *tokenv; struct plain_bulk_token *tokenv;
int rc; int rc;
LASSERT(req->rq_bulk_read); LASSERT(req->rq_bulk_read);
LASSERT(req->rq_pack_bulk); LASSERT(req->rq_pack_bulk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment