* its ref on 'cmid'). */
rwlock_t *glock = &kiblnd_data.kib_global_lock;
kib_net_t *net = peer->ibp_ni->ni_data;
- kib_dev_t *dev = net->ibn_dev;
+ kib_dev_t *dev;
struct ib_qp_init_attr *init_qp_attr;
struct kib_sched_info *sched;
kib_conn_t *conn;
LASSERT(net != NULL);
LASSERT(!cfs_in_interrupt());
+ dev = net->ibn_dev;
+
cpt = lnet_cpt_of_nid(peer->ibp_nid);
sched = kiblnd_data.kib_scheds[cpt];
kib_pages_t *txpgs = tpo->tpo_tx_pages;
kib_pool_t *pool = &tpo->tpo_pool;
kib_net_t *net = pool->po_owner->ps_net;
- kib_dev_t *dev = net->ibn_dev;
+ kib_dev_t *dev;
struct page *page;
kib_tx_t *tx;
int page_offset;
LASSERT (net != NULL);
+ dev = net->ibn_dev;
+
/* pre-mapped messages are not bigger than 1 page */
CLASSERT (IBLND_MSG_SIZE <= PAGE_SIZE);
static int
kiblnd_fmr_map_tx(kib_net_t *net, kib_tx_t *tx, kib_rdma_desc_t *rd, int nob)
{
- kib_hca_dev_t *hdev = tx->tx_pool->tpo_hdev;
+ kib_hca_dev_t *hdev;
__u64 *pages = tx->tx_pages;
kib_fmr_poolset_t *fps;
int npages;
int rc;
int i;
+ LASSERT(tx->tx_pool != NULL);
+ LASSERT(tx->tx_pool->tpo_pool.po_owner != NULL);
+
+ hdev = tx->tx_pool->tpo_hdev;
+
for (i = 0, npages = 0; i < rd->rd_nfrags; i++) {
for (size = 0; size < rd->rd_frags[i].rf_nob;
size += hdev->ibh_page_size) {
}
}
- LASSERT(tx->tx_pool != NULL);
- LASSERT(tx->tx_pool->tpo_pool.po_owner != NULL);
-
cpt = tx->tx_pool->tpo_pool.po_owner->ps_cpt;
fps = net->ibn_fmr_ps[cpt];
static int
kiblnd_pmr_map_tx(kib_net_t *net, kib_tx_t *tx, kib_rdma_desc_t *rd, int nob)
{
- kib_hca_dev_t *hdev = tx->tx_pool->tpo_hdev;
+ kib_hca_dev_t *hdev;
kib_pmr_poolset_t *pps;
__u64 iova;
int cpt;
int rc;
- iova = rd->rd_frags[0].rf_addr & ~hdev->ibh_page_mask;
-
LASSERT(tx->tx_pool != NULL);
LASSERT(tx->tx_pool->tpo_pool.po_owner != NULL);
+ hdev = tx->tx_pool->tpo_hdev;
+
+ iova = rd->rd_frags[0].rf_addr & ~hdev->ibh_page_mask;
+
cpt = tx->tx_pool->tpo_pool.po_owner->ps_cpt;
pps = net->ibn_pmr_ps[cpt];
int
sfw_load_test(struct sfw_test_instance *tsi)
{
- struct sfw_test_case *tsc = sfw_find_test_case(tsi->tsi_service);
- struct srpc_service *svc = tsc->tsc_srv_service;
- int nbuf = sfw_test_buffers(tsi);
+ struct sfw_test_case *tsc;
+ struct srpc_service *svc;
+ int nbuf;
int rc;
+ LASSERT(tsi != NULL);
+ tsc = sfw_find_test_case(tsi->tsi_service);
+ nbuf = sfw_test_buffers(tsi);
LASSERT(tsc != NULL);
+ svc = tsc->tsc_srv_service;
if (tsi->tsi_is_client) {
tsi->tsi_ops = tsc->tsc_cli_ops;
srpc_send_rpc (swi_workitem_t *wi)
{
int rc = 0;
- srpc_client_rpc_t *rpc = wi->swi_workitem.wi_data;
- srpc_msg_t *reply = &rpc->crpc_replymsg;
- int do_bulk = rpc->crpc_bulk.bk_niov > 0;
+ srpc_client_rpc_t *rpc;
+ srpc_msg_t *reply;
+ int do_bulk;
+
+ LASSERT(wi != NULL);
+
+ rpc = wi->swi_workitem.wi_data;
LASSERT (rpc != NULL);
LASSERT (wi == &rpc->crpc_wi);
+ reply = &rpc->crpc_replymsg;
+ do_bulk = rpc->crpc_bulk.bk_niov > 0;
+
spin_lock(&rpc->crpc_lock);
if (rpc->crpc_aborted) {
int fld_client_add_target(struct lu_client_fld *fld,
struct lu_fld_target *tar)
{
- const char *name = fld_target_name(tar);
+ const char *name;
struct lu_fld_target *target, *tmp;
ENTRY;
LASSERT(tar != NULL);
+ name = fld_target_name(tar);
LASSERT(name != NULL);
LASSERT(tar->ft_srv != NULL || tar->ft_exp != NULL);
static inline int ptlrpc_client_bulk_active(struct ptlrpc_request *req)
{
- struct ptlrpc_bulk_desc *desc = req->rq_bulk;
+ struct ptlrpc_bulk_desc *desc;
int rc;
LASSERT(req != NULL);
+ desc = req->rq_bulk;
if (OBD_FAIL_CHECK(OBD_FAIL_PTLRPC_LONG_BULK_UNLINK) &&
req->rq_bulk_deadline > cfs_time_current_sec())
void *lvb, __u32 lvb_len, enum lvb_type lvb_type,
struct lustre_handle *lockh, int async)
{
- struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
+ struct ldlm_namespace *ns;
struct ldlm_lock *lock;
struct ldlm_request *body;
int is_replay = *flags & LDLM_FL_REPLAY;
LASSERT(exp != NULL);
+ ns = exp->exp_obd->obd_namespace;
+
/* If we're replaying this lock, just check some invariants.
* If we're creating a new lock, get everything all setup nice. */
if (is_replay) {
struct cl_io *unused)
{
cfs_page_t *vmpage = cl2vm_page(slice);
- struct address_space *mapping = vmpage->mapping;
+ struct address_space *mapping;
struct ccc_page *cpg = cl2ccc_page(slice);
LASSERT(vmpage != NULL);
LASSERT(PageLocked(vmpage));
+ mapping = vmpage->mapping;
+
if (cpg->cpg_defer_uptodate && !cpg->cpg_ra_used)
ll_ra_stats_inc(mapping, RA_STAT_DISCARDED);
struct cl_io *unused)
{
cfs_page_t *vmpage = cl2vm_page(slice);
- __u64 offset = vmpage->index << CFS_PAGE_SHIFT;
+ __u64 offset;
LASSERT(vmpage != NULL);
LASSERT(PageLocked(vmpage));
+
+ offset = vmpage->index << CFS_PAGE_SHIFT;
+
/*
* XXX is it safe to call this with the page lock held?
*/
struct lu_device *d)
{
struct mdd_device *mdd = lu2mdd_dev(d);
- struct lu_device *next = &mdd->mdd_child->dd_lu_dev;
+ struct lu_device *next;
int rc;
ENTRY;
LASSERT(mdd != NULL);
+ next = &mdd->mdd_child->dd_lu_dev;
/* XXX: orphans handling. */
__mdd_orphan_cleanup(env, mdd);
rec->cr.cr_namelen = tname->ln_namelen;
memcpy(rec->cr.cr_name, tname->ln_name, tname->ln_namelen);
if (sname) {
- LASSERT(sfid != NULL);
rec->cr.cr_name[tname->ln_namelen] = '\0';
memcpy(rec->cr.cr_name + tname->ln_namelen + 1, sname->ln_name,
sname->ln_namelen);
int flags, struct mdd_object *mdd_obj,
struct thandle *handle)
{
- const struct lu_fid *tfid = mdo2fid(mdd_obj);
+ const struct lu_fid *tfid;
struct llog_changelog_rec *rec;
struct lu_buf *buf;
int reclen;
LASSERT(mdd_obj != NULL);
LASSERT(handle != NULL);
+ tfid = mdo2fid(mdd_obj);
+
if ((type >= CL_MTIME) && (type <= CL_ATIME) &&
cfs_time_before_64(mdd->mdd_cl.mc_starttime, mdd_obj->mod_cltime)) {
/* Don't need multiple updates in this log */
void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
unsigned conf, const char *name, const char *units)
{
- struct lprocfs_counter *c = &(stats->ls_percpu[0]->lp_cntr[index]);
+ struct lprocfs_counter *c;
unsigned long flags = 0;
LASSERT(stats != NULL);
LASSERT(stats->ls_percpu[0] != NULL);
+ c = &(stats->ls_percpu[0]->lp_cntr[index]);
+
lprocfs_stats_lock(stats, LPROCFS_GET_NUM_CPU, &flags);
c->lc_config = conf;
c->lc_count = 0;
ENTRY;
+ if (ec_parent == NULL)
+ return -1;
parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
if (parent == NULL)
RETURN(-ENXIO);
ENTRY;
+ if (ec_parent == NULL)
+ return -1;
parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
if (parent == NULL)
RETURN(-ENXIO);
ENTRY;
+ if (ec_parent == NULL)
+ return -1;
parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
if (parent == NULL)
RETURN(-ENXIO);
int rc = 0;
int i;
+ if (ec_parent == NULL)
+ return -1;
parent = lu_object_locate(ec_parent->lo_header, ld->ld_type);
if (parent == NULL)
return -ENXIO;
int count, int *eof, void *data)
{
struct obd_device *obd = (struct obd_device *)data;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+ struct ofd_device *ofd;
LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
*eof = 1;
return snprintf(page, count, LPU64"\n", ofd->ofd_tot_dirty);
}
int count, int *eof, void *data)
{
struct obd_device *obd = (struct obd_device *)data;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+ struct ofd_device *ofd;
LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
*eof = 1;
return snprintf(page, count, LPU64"\n", ofd->ofd_tot_granted);
}
int count, int *eof, void *data)
{
struct obd_device *obd = (struct obd_device *)data;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+ struct ofd_device *ofd;
LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
*eof = 1;
return snprintf(page, count, LPU64"\n", ofd->ofd_tot_pending);
}
int count, int *eof, void *data)
{
struct obd_device *obd = (struct obd_device *)data;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+ struct ofd_device *ofd;
LASSERT(obd != NULL);
+ ofd = ofd_dev(obd->obd_lu_dev);
*eof = 1;
return snprintf(page, count, "%d%%\n",
(int) ofd_grant_reserved(ofd, 100));
int count, int *eof, void *data)
{
struct obd_device *obd = data;
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+ struct ofd_device *ofd;
struct ofd_seq *oseq = NULL;
int retval = 0, rc;
if (obd == NULL)
return 0;
+ ofd = ofd_dev(obd->obd_lu_dev);
+
read_lock(&ofd->ofd_seq_list_lock);
cfs_list_for_each_entry(oseq, &ofd->ofd_seq_list, os_list) {
rc = snprintf(page, count, LPX64": "LPX64"\n",
LASSERT(rc == 0);
info = ofd_info_init(env, exp);
+ LASSERT(oa != NULL);
+
if (OBD_FAIL_CHECK(OBD_FAIL_OST_ENOENT)) {
struct ofd_seq *oseq;
oseq = ofd_seq_load(env, ofd, oa->o_seq);
rc = ofd_auth_capa(exp, &info->fti_fid, oa->o_seq,
capa, CAPA_OPC_OSS_WRITE);
if (rc == 0) {
- LASSERT(oa != NULL);
la_from_obdo(&info->fti_attr, oa, OBD_MD_FLGETATTR);
rc = ofd_preprw_write(env, exp, ofd, &info->fti_fid,
&info->fti_attr, oa, objcount,
struct obd_device *obd, struct obd_uuid *cluuid,
struct obd_connect_data *data, void *localdata)
{
- struct ofd_device *ofd = ofd_dev(obd->obd_lu_dev);
+ struct ofd_device *ofd;
int rc;
ENTRY;
if (exp == NULL || obd == NULL || cluuid == NULL)
RETURN(-EINVAL);
+ ofd = ofd_dev(obd->obd_lu_dev);
+
rc = lu_env_refill((struct lu_env *)env);
if (rc != 0) {
CERROR("Failure to refill session: '%d'\n", rc);
__u32 keylen, void *key, __u32 vallen, void *val,
struct ptlrpc_request_set *set)
{
- struct ofd_device *ofd = ofd_exp(exp);
+ struct ofd_device *ofd;
int rc = 0;
ENTRY;
RETURN(-EINVAL);
}
+ ofd = ofd_exp(exp);
+
if (KEY_IS(KEY_CAPA_KEY)) {
rc = ofd_update_capa_key(ofd, val);
if (rc)
__u32 keylen, void *key, __u32 *vallen, void *val,
struct lov_stripe_md *lsm)
{
- struct ofd_device *ofd = ofd_exp(exp);
+ struct ofd_device *ofd;
int rc = 0;
ENTRY;
RETURN(-EINVAL);
}
+ ofd = ofd_exp(exp);
+
if (KEY_IS(KEY_BLOCKSIZE)) {
__u32 *blocksize = val;
if (blocksize) {
spin_unlock(&svcpt->scp_rep_lock);
- LASSERT(rs != NULL);
memset(rs, 0, svcpt->scp_service->srv_max_reply_size);
rs->rs_svcpt = svcpt;
rs->rs_prealloc = 1;
{
struct l_wait_info lwi = { 0 };
struct ptlrpc_thread *thread;
- struct ptlrpc_service *svc = svcpt->scp_service;
+ struct ptlrpc_service *svc;
int rc;
ENTRY;
LASSERT(svcpt != NULL);
+ svc = svcpt->scp_service;
+
CDEBUG(D_RPCTRACE, "%s[%d] started %d min %d max %d\n",
svc->srv_name, svcpt->scp_cpt, svcpt->scp_nthrs_running,
svc->srv_nthrs_cpt_init, svc->srv_nthrs_cpt_limit);