diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/lov')
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_cl_internal.h | 5 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_dev.c | 15 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_ea.c | 7 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_internal.h | 5 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_io.c | 9 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_lock.c | 21 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_obd.c | 52 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_object.c | 18 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_pack.c | 22 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_page.c | 2 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_pool.c | 32 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lov_request.c | 17 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lovsub_dev.c | 5 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lovsub_lock.c | 4 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lovsub_object.c | 6 | ||||
-rw-r--r-- | drivers/staging/lustre/lustre/lov/lproc_lov.c | 5 |
16 files changed, 73 insertions, 152 deletions
diff --git a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h index 314ce8525aed..1c0fe65243e1 100644 --- a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h @@ -438,7 +438,6 @@ struct lovsub_page { struct cl_page_slice lsb_cl; }; - struct lov_thread_info { struct cl_object_conf lti_stripe_conf; struct lu_fid lti_fid; @@ -611,7 +610,6 @@ int lov_sublock_modify(const struct lu_env *env, struct lov_lock *lov, struct lovsub_lock *sublock, const struct cl_lock_descr *d, int idx); - int lov_page_init(const struct lu_env *env, struct cl_object *ob, struct cl_page *page, struct page *vmpage); int lovsub_page_init(const struct lu_env *env, struct cl_object *ob, @@ -637,9 +635,6 @@ struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio, const struct cl_page_slice *slice); -void lov_lsm_decref(struct lov_object *lov, struct lov_stripe_md *lsm); -struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov); - #define lov_foreach_target(lov, var) \ for (var = 0; var < lov_targets_nr(lov); ++var) diff --git a/drivers/staging/lustre/lustre/lov/lov_dev.c b/drivers/staging/lustre/lustre/lov/lov_dev.c index 8c3bbe574723..2e8b566458f6 100644 --- a/drivers/staging/lustre/lustre/lov/lov_dev.c +++ b/drivers/staging/lustre/lustre/lov/lov_dev.c @@ -46,7 +46,6 @@ #include "lov_cl_internal.h" #include "lov_internal.h" - struct kmem_cache *lov_lock_kmem; struct kmem_cache *lov_object_kmem; struct kmem_cache *lov_thread_kmem; @@ -125,7 +124,7 @@ static void lov_req_completion(const struct lu_env *env, struct lov_req *lr; lr = cl2lov_req(slice); - OBD_SLAB_FREE_PTR(lr, lov_req_kmem); + kmem_cache_free(lov_req_kmem, lr); } static const struct cl_req_operations lov_req_ops = { @@ -143,7 +142,7 @@ static void *lov_key_init(const struct lu_context *ctx, { struct lov_thread_info *info; - OBD_SLAB_ALLOC_PTR_GFP(info, lov_thread_kmem, GFP_NOFS); + info = kmem_cache_alloc(lov_thread_kmem, GFP_NOFS | __GFP_ZERO); if (info != NULL) INIT_LIST_HEAD(&info->lti_closure.clc_list); else @@ -155,8 +154,9 @@ static void lov_key_fini(const struct lu_context *ctx, struct lu_context_key *key, void *data) { struct lov_thread_info *info = data; + LINVRNT(list_empty(&info->lti_closure.clc_list)); - OBD_SLAB_FREE_PTR(info, lov_thread_kmem); + kmem_cache_free(lov_thread_kmem, info); } struct lu_context_key lov_key = { @@ -170,7 +170,7 @@ static void *lov_session_key_init(const struct lu_context *ctx, { struct lov_session *info; - OBD_SLAB_ALLOC_PTR_GFP(info, lov_session_kmem, GFP_NOFS); + info = kmem_cache_alloc(lov_session_kmem, GFP_NOFS | __GFP_ZERO); if (info == NULL) info = ERR_PTR(-ENOMEM); return info; @@ -180,7 +180,8 @@ static void lov_session_key_fini(const struct lu_context *ctx, struct lu_context_key *key, void *data) { struct lov_session *info = data; - OBD_SLAB_FREE_PTR(info, lov_session_kmem); + + kmem_cache_free(lov_session_kmem, info); } struct lu_context_key lov_session_key = { @@ -260,7 +261,7 @@ static int lov_req_init(const struct lu_env *env, struct cl_device *dev, struct lov_req *lr; int result; - OBD_SLAB_ALLOC_PTR_GFP(lr, lov_req_kmem, GFP_NOFS); + lr = kmem_cache_alloc(lov_req_kmem, GFP_NOFS | __GFP_ZERO); if (lr != NULL) { cl_req_slice_add(req, &lr->lr_cl, dev, &lov_req_ops); result = 0; diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c b/drivers/staging/lustre/lustre/lov/lov_ea.c index 3f51b573e1fb..34c1346f0dc7 100644 --- a/drivers/staging/lustre/lustre/lov/lov_ea.c +++ b/drivers/staging/lustre/lustre/lov/lov_ea.c @@ -100,7 +100,7 @@ struct lov_stripe_md *lsm_alloc_plain(__u16 stripe_count, int *size) return NULL; for (i = 0; i < stripe_count; i++) { - OBD_SLAB_ALLOC_PTR_GFP(loi, lov_oinfo_slab, GFP_NOFS); + loi = kmem_cache_alloc(lov_oinfo_slab, GFP_NOFS | __GFP_ZERO); if (loi == NULL) goto err; lsm->lsm_oinfo[i] = loi; @@ -110,7 +110,7 @@ struct lov_stripe_md *lsm_alloc_plain(__u16 stripe_count, int *size) err: while (--i >= 0) - OBD_SLAB_FREE(lsm->lsm_oinfo[i], lov_oinfo_slab, sizeof(*loi)); + kmem_cache_free(lov_oinfo_slab, lsm->lsm_oinfo[i]); kvfree(lsm); return NULL; } @@ -121,8 +121,7 @@ void lsm_free_plain(struct lov_stripe_md *lsm) int i; for (i = 0; i < stripe_count; i++) - OBD_SLAB_FREE(lsm->lsm_oinfo[i], lov_oinfo_slab, - sizeof(struct lov_oinfo)); + kmem_cache_free(lov_oinfo_slab, lsm->lsm_oinfo[i]); kvfree(lsm); } diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h b/drivers/staging/lustre/lustre/lov/lov_internal.h index dde9656d4dd6..515a5c147827 100644 --- a/drivers/staging/lustre/lustre/lov/lov_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_internal.h @@ -220,7 +220,6 @@ int lov_free_memmd(struct lov_stripe_md **lsmp); void lov_dump_lmm_v1(int level, struct lov_mds_md_v1 *lmm); void lov_dump_lmm_v3(int level, struct lov_mds_md_v3 *lmm); void lov_dump_lmm_common(int level, void *lmmp); -void lov_dump_lmm(int level, void *lmm); /* lov_ea.c */ struct lov_stripe_md *lsm_alloc_plain(__u16 stripe_count, int *size); @@ -235,7 +234,7 @@ void lprocfs_lov_init_vars(struct lprocfs_static_vars *lvars); extern struct lu_device_type lov_device_type; /* pools */ -extern cfs_hash_ops_t pool_hash_operations; +extern struct cfs_hash_ops pool_hash_operations; /* ost_pool methods */ int lov_ost_pool_init(struct ost_pool *op, unsigned int count); int lov_ost_pool_extend(struct ost_pool *op, unsigned int min_count); @@ -248,7 +247,6 @@ int lov_pool_new(struct obd_device *obd, char *poolname); int lov_pool_del(struct obd_device *obd, char *poolname); int lov_pool_add(struct obd_device *obd, char *poolname, char *ostname); int lov_pool_remove(struct obd_device *obd, char *poolname, char *ostname); -void lov_dump_pool(int level, struct pool_desc *pool); struct pool_desc *lov_find_pool(struct lov_obd *lov, char *poolname); int lov_check_index_in_pool(__u32 idx, struct pool_desc *pool); void lov_pool_putref(struct pool_desc *pool); @@ -271,5 +269,4 @@ static inline bool lov_oinfo_is_dummy(const struct lov_oinfo *loi) return false; } - #endif diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c b/drivers/staging/lustre/lustre/lov/lov_io.c index bf3629151d68..5e6228b9ca01 100644 --- a/drivers/staging/lustre/lustre/lov/lov_io.c +++ b/drivers/staging/lustre/lustre/lov/lov_io.c @@ -51,6 +51,7 @@ static inline void lov_sub_enter(struct lov_io_sub *sub) { sub->sub_reenter++; } + static inline void lov_sub_exit(struct lov_io_sub *sub) { sub->sub_reenter--; @@ -90,7 +91,6 @@ static void lov_io_sub_inherit(struct cl_io *io, struct lov_io *lio, case CIT_SETATTR: { io->u.ci_setattr.sa_attr = parent->u.ci_setattr.sa_attr; io->u.ci_setattr.sa_valid = parent->u.ci_setattr.sa_valid; - io->u.ci_setattr.sa_capa = parent->u.ci_setattr.sa_capa; if (cl_io_is_trunc(io)) { loff_t new_size = parent->u.ci_setattr.sa_attr.lvb_size; @@ -111,7 +111,6 @@ static void lov_io_sub_inherit(struct cl_io *io, struct lov_io *lio, case CIT_FSYNC: { io->u.ci_fsync.fi_start = start; io->u.ci_fsync.fi_end = end; - io->u.ci_fsync.fi_capa = parent->u.ci_fsync.fi_capa; io->u.ci_fsync.fi_fid = parent->u.ci_fsync.fi_fid; io->u.ci_fsync.fi_mode = parent->u.ci_fsync.fi_mode; break; @@ -273,7 +272,6 @@ struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio, return lov_sub_get(env, lio, stripe); } - static int lov_io_subio_init(const struct lu_env *env, struct lov_io *lio, struct cl_io *io) { @@ -332,6 +330,7 @@ static void lov_io_slice_init(struct lov_io *lio, case CIT_FAULT: { pgoff_t index = io->u.ci_fault.ft_index; + lio->lis_pos = cl_offset(io->ci_obj, index); lio->lis_endpos = cl_offset(io->ci_obj, index + 1); break; @@ -546,7 +545,6 @@ static void lov_io_unlock(const struct lu_env *env, LASSERT(rc == 0); } - static struct cl_page_list *lov_io_submit_qin(struct lov_device *ld, struct cl_page_list *qin, int idx, int alloc) @@ -729,6 +727,8 @@ static int lov_io_fault_start(const struct lu_env *env, fio = &ios->cis_io->u.ci_fault; lio = cl2lov_io(env, ios); sub = lov_sub_get(env, lio, lov_page_stripe(fio->ft_page)); + if (IS_ERR(sub)) + return PTR_ERR(sub); sub->sub_io->u.ci_fault.ft_nob = fio->ft_nob; lov_sub_put(sub); return lov_io_start(env, ios); @@ -990,4 +990,5 @@ int lov_io_init_released(const struct lu_env *env, struct cl_object *obj, io->ci_result = result < 0 ? result : 0; return result != 0; } + /** @} lov */ diff --git a/drivers/staging/lustre/lustre/lov/lov_lock.c b/drivers/staging/lustre/lustre/lov/lov_lock.c index a6938085ff24..d866791d7b22 100644 --- a/drivers/staging/lustre/lustre/lov/lov_lock.c +++ b/drivers/staging/lustre/lustre/lov/lov_lock.c @@ -144,7 +144,7 @@ static struct cl_lock *lov_sublock_alloc(const struct lu_env *env, LASSERT(idx < lck->lls_nr); - OBD_SLAB_ALLOC_PTR_GFP(link, lov_lock_link_kmem, GFP_NOFS); + link = kmem_cache_alloc(lov_lock_link_kmem, GFP_NOFS | __GFP_ZERO); if (link != NULL) { struct lov_sublock_env *subenv; struct lov_lock_sub *lls; @@ -173,7 +173,7 @@ static struct cl_lock *lov_sublock_alloc(const struct lu_env *env, if (!IS_ERR(sublock)) *out = link; else - OBD_SLAB_FREE_PTR(link, lov_lock_link_kmem); + kmem_cache_free(lov_lock_link_kmem, link); } else sublock = ERR_PTR(-ENOMEM); return sublock; @@ -227,6 +227,7 @@ static int lov_sublock_lock(const struct lu_env *env, result = CLO_REPEAT; } else if (lsep) { struct lov_sublock_env *subenv; + subenv = lov_sublock_env_get(env, parent, lls); if (IS_ERR(subenv)) { lov_sublock_unlock(env, sublock, @@ -443,7 +444,7 @@ static void lov_lock_fini(const struct lu_env *env, LASSERT(lck->lls_sub[i].sub_lock == NULL); kvfree(lck->lls_sub); } - OBD_SLAB_FREE_PTR(lck, lov_lock_kmem); + kmem_cache_free(lov_lock_kmem, lck); } static int lov_lock_enqueue_wait(const struct lu_env *env, @@ -517,7 +518,7 @@ static int lov_sublock_fill(const struct lu_env *env, struct cl_lock *parent, lck->lls_sub[idx].sub_lock == NULL) { lov_sublock_adopt(env, lck, sublock, idx, link); } else { - OBD_SLAB_FREE_PTR(link, lov_lock_link_kmem); + kmem_cache_free(lov_lock_link_kmem, link); /* other thread allocated sub-lock, or enqueue is no * longer going on */ cl_lock_mutex_put(env, parent); @@ -677,7 +678,6 @@ static int lov_lock_unuse(const struct lu_env *env, return result; } - static void lov_lock_cancel(const struct lu_env *env, const struct cl_lock_slice *slice) { @@ -981,6 +981,7 @@ static int lov_lock_fits_into(const struct lu_env *env, result = cl_lock_ext_match(&lov->lls_orig, need); else if (lov->lls_nr == 1) { struct cl_lock_descr *got = &lov->lls_sub[0].sub_got; + result = lov_lock_stripe_is_matching(env, cl2lov(slice->cls_obj), lov->lls_sub[0].sub_stripe, @@ -1026,7 +1027,7 @@ void lov_lock_unlink(const struct lu_env *env, lck->lls_nr_filled--; lu_ref_del(&parent->cll_reference, "lov-child", sub->lss_cl.cls_lock); cl_lock_put(env, parent); - OBD_SLAB_FREE_PTR(link, lov_lock_link_kmem); + kmem_cache_free(lov_lock_link_kmem, link); } struct lov_lock_link *lov_lock_link_find(const struct lu_env *env, @@ -1138,7 +1139,7 @@ int lov_lock_init_raid0(const struct lu_env *env, struct cl_object *obj, struct lov_lock *lck; int result; - OBD_SLAB_ALLOC_PTR_GFP(lck, lov_lock_kmem, GFP_NOFS); + lck = kmem_cache_alloc(lov_lock_kmem, GFP_NOFS | __GFP_ZERO); if (lck != NULL) { cl_lock_slice_add(lock, &lck->lls_cl, obj, &lov_lock_ops); result = lov_lock_sub_init(env, lck, io); @@ -1151,7 +1152,8 @@ static void lov_empty_lock_fini(const struct lu_env *env, struct cl_lock_slice *slice) { struct lov_lock *lck = cl2lov_lock(slice); - OBD_SLAB_FREE_PTR(lck, lov_lock_kmem); + + kmem_cache_free(lov_lock_kmem, lck); } static int lov_empty_lock_print(const struct lu_env *env, void *cookie, @@ -1173,7 +1175,7 @@ int lov_lock_init_empty(const struct lu_env *env, struct cl_object *obj, struct lov_lock *lck; int result = -ENOMEM; - OBD_SLAB_ALLOC_PTR_GFP(lck, lov_lock_kmem, GFP_NOFS); + lck = kmem_cache_alloc(lov_lock_kmem, GFP_NOFS | __GFP_ZERO); if (lck != NULL) { cl_lock_slice_add(lock, &lck->lls_cl, obj, &lov_empty_lock_ops); lck->lls_orig = lock->cll_descr; @@ -1193,5 +1195,4 @@ static struct cl_lock_closure *lov_closure_get(const struct lu_env *env, return closure; } - /** @} lov */ diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index c5c67d982ef2..7abe484c07c0 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -85,6 +85,7 @@ static void lov_putref(struct obd_device *obd) LIST_HEAD(kill); int i; struct lov_tgt_desc *tgt, *n; + CDEBUG(D_CONFIG, "destroying %d lov targets\n", lov->lov_death_row); for (i = 0; i < lov->desc.ld_tgt_count; i++) { @@ -121,7 +122,6 @@ static int lov_set_osc_active(struct obd_device *obd, struct obd_uuid *uuid, static int lov_notify(struct obd_device *obd, struct obd_device *watched, enum obd_notify_event ev, void *data); - #define MAX_STRING_SIZE 128 int lov_connect_obd(struct obd_device *obd, __u32 index, int activate, struct obd_connect_data *data) @@ -169,7 +169,6 @@ int lov_connect_obd(struct obd_device *obd, __u32 index, int activate, return rc; } - if (imp->imp_invalid) { CDEBUG(D_CONFIG, "not connecting OSC %s; administratively disabled\n", obd_uuid2str(tgt_uuid)); @@ -833,6 +832,7 @@ static int lov_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) switch (stage) { case OBD_CLEANUP_EARLY: { int i; + for (i = 0; i < lov->desc.ld_tgt_count; i++) { if (!lov->lov_tgts[i] || !lov->lov_tgts[i]->ltd_active) continue; @@ -869,6 +869,7 @@ static int lov_cleanup(struct obd_device *obd) lprocfs_obd_cleanup(obd); if (lov->lov_tgts) { int i; + obd_getref(obd); for (i = 0; i < lov->desc.ld_tgt_count; i++) { if (!lov->lov_tgts[i]) @@ -913,14 +914,12 @@ int lov_process_config_base(struct obd_device *obd, struct lustre_cfg *lcfg, obd_str2uuid(&obd_uuid, lustre_cfg_buf(lcfg, 1)); - if (sscanf(lustre_cfg_buf(lcfg, 2), "%d", indexp) != 1) { - rc = -EINVAL; + rc = kstrtoint(lustre_cfg_buf(lcfg, 2), 10, indexp); + if (rc < 0) goto out; - } - if (sscanf(lustre_cfg_buf(lcfg, 3), "%d", genp) != 1) { - rc = -EINVAL; + rc = kstrtoint(lustre_cfg_buf(lcfg, 3), 10, genp); + if (rc < 0) goto out; - } index = *indexp; gen = *genp; if (cmd == LCFG_LOV_ADD_OBD) @@ -1061,8 +1060,7 @@ do { \ static int lov_destroy(const struct lu_env *env, struct obd_export *exp, struct obdo *oa, struct lov_stripe_md *lsm, - struct obd_trans_info *oti, struct obd_export *md_exp, - void *capa) + struct obd_trans_info *oti, struct obd_export *md_exp) { struct lov_request_set *set; struct obd_info oinfo; @@ -1094,7 +1092,7 @@ static int lov_destroy(const struct lu_env *env, struct obd_export *exp, oti->oti_logcookies = set->set_cookies + req->rq_stripe; err = obd_destroy(env, lov->lov_tgts[req->rq_idx]->ltd_exp, - req->rq_oi.oi_oa, NULL, oti, NULL, capa); + req->rq_oi.oi_oa, NULL, oti, NULL); err = lov_update_common_set(set, req, err); if (err) { CERROR("%s: destroying objid "DOSTID" subobj " @@ -1257,6 +1255,7 @@ static int lov_setattr_async(struct obd_export *exp, struct obd_info *oinfo, /* If we are not waiting for responses on async requests, return. */ if (rc || !rqset || list_empty(&rqset->set_requests)) { int err; + if (rc) atomic_set(&set->set_completes, 0); err = lov_fini_setattr_set(set); @@ -1349,6 +1348,7 @@ static int lov_statfs_async(struct obd_export *exp, struct obd_info *oinfo, if (rc || list_empty(&rqset->set_requests)) { int err; + if (rc) atomic_set(&set->set_completes, 0); err = lov_fini_statfs_set(set); @@ -1365,7 +1365,7 @@ static int lov_statfs(const struct lu_env *env, struct obd_export *exp, struct obd_statfs *osfs, __u64 max_age, __u32 flags) { struct ptlrpc_request_set *set = NULL; - struct obd_info oinfo = { { { 0 } } }; + struct obd_info oinfo = { }; int rc = 0; /* for obdclass we forbid using obd_statfs_rqset, but prefer using async @@ -1487,7 +1487,7 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, struct obd_quotactl *oqctl; if (qctl->qc_valid == QC_OSTIDX) { - if (qctl->qc_idx < 0 || count <= qctl->qc_idx) + if (count <= qctl->qc_idx) return -EINVAL; tgt = lov->lov_tgts[qctl->qc_idx]; @@ -1672,7 +1672,7 @@ static int fiemap_calc_last_stripe(struct lov_stripe_md *lsm, u64 fm_start, break; } *stripe_count = j; - last_stripe = (start_stripe + j - 1) %lsm->lsm_stripe_count; + last_stripe = (start_stripe + j - 1) % lsm->lsm_stripe_count; } return last_stripe; @@ -1862,7 +1862,7 @@ static int lov_fiemap(struct lov_obd *lov, __u32 keylen, void *key, fm_local->fm_start = lun_start; fm_local->fm_flags &= ~FIEMAP_FLAG_DEVICE_ORDER; memcpy(&fm_key->fiemap, fm_local, sizeof(*fm_local)); - *vallen=fiemap_count_to_size(fm_local->fm_extent_count); + *vallen = fiemap_count_to_size(fm_local->fm_extent_count); rc = obd_get_info(NULL, lov->lov_tgts[ost_index]->ltd_exp, keylen, key, vallen, fm_local, lsm); @@ -2067,7 +2067,7 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp, struct lov_tgt_desc *tgt; unsigned incr, check_uuid, do_inactive, no_set; - unsigned next_id = 0, mds_con = 0, capa = 0; + unsigned next_id = 0, mds_con = 0; incr = check_uuid = do_inactive = no_set = 0; if (set == NULL) { @@ -2092,8 +2092,6 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp, /* use defaults: do_inactive = incr = 0; */ } else if (KEY_IS(KEY_MDS_CONN)) { mds_con = 1; - } else if (KEY_IS(KEY_CAPA_KEY)) { - capa = 1; } else if (KEY_IS(KEY_CACHE_SET)) { LASSERT(lov->lov_cache == NULL); lov->lov_cache = val; @@ -2101,11 +2099,10 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp, } for (i = 0; i < count; i++, val = (char *)val + incr) { - if (next_id) { + if (next_id) tgt = lov->lov_tgts[((struct obd_id_info *)val)->idx]; - } else { + else tgt = lov->lov_tgts[i]; - } /* OST was disconnected */ if (!tgt || !tgt->ltd_exp) continue; @@ -2132,19 +2129,6 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp, err = obd_set_info_async(env, tgt->ltd_exp, keylen, key, vallen, ((struct obd_id_info *)val)->data, set); - } else if (capa) { - struct mds_capa_info *info = (struct mds_capa_info *)val; - - LASSERT(vallen == sizeof(*info)); - - /* Only want a specific OSC */ - if (info->uuid && - !obd_uuid_equals(info->uuid, &tgt->ltd_uuid)) - continue; - - err = obd_set_info_async(env, tgt->ltd_exp, keylen, - key, sizeof(*info->capa), - info->capa, set); } else { /* Only want a specific OSC */ if (check_uuid && diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c index 4d7cd924a27e..c7ff817bb6fb 100644 --- a/drivers/staging/lustre/lustre/lov/lov_object.c +++ b/drivers/staging/lustre/lustre/lov/lov_object.c @@ -42,7 +42,6 @@ #define DEBUG_SUBSYSTEM S_LOV #include "lov_cl_internal.h" -#include "../include/lclient.h" /** \addtogroup lov * @{ @@ -809,7 +808,7 @@ static void lov_object_free(const struct lu_env *env, struct lu_object *obj) LOV_2DISPATCH_VOID(lov, llo_fini, env, lov, &lov->u); lu_object_fini(obj); - OBD_SLAB_FREE_PTR(lov, lov_object_kmem); + kmem_cache_free(lov_object_kmem, lov); } static int lov_object_print(const struct lu_env *env, void *cookie, @@ -892,7 +891,7 @@ struct lu_object *lov_object_alloc(const struct lu_env *env, struct lov_object *lov; struct lu_object *obj; - OBD_SLAB_ALLOC_PTR_GFP(lov, lov_object_kmem, GFP_NOFS); + lov = kmem_cache_alloc(lov_object_kmem, GFP_NOFS | __GFP_ZERO); if (lov != NULL) { obj = lov2lu(lov); lu_object_init(obj, NULL, dev); @@ -909,7 +908,7 @@ struct lu_object *lov_object_alloc(const struct lu_env *env, return obj; } -struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov) +static struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov) { struct lov_stripe_md *lsm = NULL; @@ -924,17 +923,6 @@ struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov) return lsm; } -void lov_lsm_decref(struct lov_object *lov, struct lov_stripe_md *lsm) -{ - if (lsm == NULL) - return; - - CDEBUG(D_INODE, "lsm %p decref %d by %p.\n", - lsm, atomic_read(&lsm->lsm_refc), current); - - lov_free_memmd(&lsm); -} - struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj) { struct lu_object *luobj; diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 6b1c135c9ab0..2fb1e974cc70 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -100,26 +100,6 @@ void lov_dump_lmm_v3(int level, struct lov_mds_md_v3 *lmm) le16_to_cpu(lmm->lmm_stripe_count)); } -void lov_dump_lmm(int level, void *lmm) -{ - int magic; - - magic = le32_to_cpu(((struct lov_mds_md *)lmm)->lmm_magic); - switch (magic) { - case LOV_MAGIC_V1: - lov_dump_lmm_v1(level, (struct lov_mds_md_v1 *)lmm); - break; - case LOV_MAGIC_V3: - lov_dump_lmm_v3(level, (struct lov_mds_md_v3 *)lmm); - break; - default: - CDEBUG(level, "unrecognized lmm_magic %x, assuming %x\n", - magic, LOV_MAGIC_V1); - lov_dump_lmm_common(level, lmm); - break; - } -} - /* Pack LOV object metadata for disk storage. It is packed in LE byte * order and is opaque to the networking layer. * @@ -273,7 +253,6 @@ __u16 lov_get_stripecnt(struct lov_obd *lov, __u32 magic, __u16 stripe_count) return stripe_count; } - static int lov_verify_lmm(void *lmm, int lmm_bytes, __u16 *stripe_count) { int rc; @@ -347,7 +326,6 @@ int lov_free_memmd(struct lov_stripe_md **lsmp) return refc; } - /* Unpack LOV object metadata from disk storage. It is packed in LE byte * order and is opaque to the networking layer. */ diff --git a/drivers/staging/lustre/lustre/lov/lov_page.c b/drivers/staging/lustre/lustre/lov/lov_page.c index c4596e8e5783..463cadbd9d40 100644 --- a/drivers/staging/lustre/lustre/lov/lov_page.c +++ b/drivers/staging/lustre/lustre/lov/lov_page.c @@ -208,7 +208,6 @@ out: return rc; } - static const struct cl_page_operations lov_empty_page_ops = { .cpo_fini = lov_empty_page_fini, .cpo_print = lov_page_print @@ -228,5 +227,4 @@ int lov_page_init_empty(const struct lu_env *env, struct cl_object *obj, return 0; } - /** @} lov */ diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c index c59b1402616e..b03827ef6514 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pool.c +++ b/drivers/staging/lustre/lustre/lov/lov_pool.c @@ -142,12 +142,12 @@ static void pool_hashrefcount_put_locked(struct cfs_hash *hs, lov_pool_putref_locked(pool); } -cfs_hash_ops_t pool_hash_operations = { +struct cfs_hash_ops pool_hash_operations = { .hs_hash = pool_hashfn, - .hs_key = pool_key, + .hs_key = pool_key, .hs_keycmp = pool_hashkey_keycmp, .hs_object = pool_hashobject, - .hs_get = pool_hashrefcount_get, + .hs_get = pool_hashrefcount_get, .hs_put_locked = pool_hashrefcount_put_locked, }; @@ -282,6 +282,7 @@ static int pool_proc_open(struct inode *inode, struct file *file) rc = seq_open(file, &pool_proc_ops); if (!rc) { struct seq_file *s = file->private_data; + s->private = inode->i_private; } return rc; @@ -294,28 +295,6 @@ static struct file_operations pool_proc_operations = { .release = seq_release, }; -void lov_dump_pool(int level, struct pool_desc *pool) -{ - int i; - - lov_pool_getref(pool); - - CDEBUG(level, "pool "LOV_POOLNAMEF" has %d members\n", - pool->pool_name, pool->pool_obds.op_count); - down_read(&pool_tgt_rw_sem(pool)); - - for (i = 0; i < pool_tgt_count(pool) ; i++) { - if (!pool_tgt(pool, i) || !(pool_tgt(pool, i))->ltd_exp) - continue; - CDEBUG(level, "pool "LOV_POOLNAMEF"[%d] = %s\n", - pool->pool_name, i, - obd_uuid2str(&((pool_tgt(pool, i))->ltd_uuid))); - } - - up_read(&pool_tgt_rw_sem(pool)); - lov_pool_putref(pool); -} - #define LOV_POOL_INIT_COUNT 2 int lov_ost_pool_init(struct ost_pool *op, unsigned int count) { @@ -418,7 +397,6 @@ int lov_ost_pool_free(struct ost_pool *op) return 0; } - int lov_pool_new(struct obd_device *obd, char *poolname) { struct lov_obd *lov; @@ -530,7 +508,6 @@ int lov_pool_del(struct obd_device *obd, char *poolname) return 0; } - int lov_pool_add(struct obd_device *obd, char *poolname, char *ostname) { struct obd_uuid ost_uuid; @@ -547,7 +524,6 @@ int lov_pool_add(struct obd_device *obd, char *poolname, char *ostname) obd_str2uuid(&ost_uuid, ostname); - /* search ost in lov array */ obd_getref(obd); for (lov_idx = 0; lov_idx < lov->desc.ld_tgt_count; lov_idx++) { diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c index 416e42ed7792..1a150c26798d 100644 --- a/drivers/staging/lustre/lustre/lov/lov_request.c +++ b/drivers/staging/lustre/lustre/lov/lov_request.c @@ -67,7 +67,7 @@ void lov_finish_set(struct lov_request_set *set) list_del_init(&req->rq_link); if (req->rq_oi.oi_oa) - OBDO_FREE(req->rq_oi.oi_oa); + kmem_cache_free(obdo_cachep, req->rq_oi.oi_oa); kfree(req->rq_oi.oi_osfs); kfree(req); } @@ -202,7 +202,7 @@ static int common_attr_done(struct lov_request_set *set) if (!atomic_read(&set->set_success)) return -EIO; - OBDO_ALLOC(tmp_oa); + tmp_oa = kmem_cache_alloc(obdo_cachep, GFP_NOFS | __GFP_ZERO); if (tmp_oa == NULL) { rc = -ENOMEM; goto out; @@ -236,7 +236,7 @@ static int common_attr_done(struct lov_request_set *set) memcpy(set->set_oi->oi_oa, tmp_oa, sizeof(*set->set_oi->oi_oa)); out: if (tmp_oa) - OBDO_FREE(tmp_oa); + kmem_cache_free(obdo_cachep, tmp_oa); return rc; } @@ -309,7 +309,8 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo, req->rq_stripe = i; req->rq_idx = loi->loi_ost_idx; - OBDO_ALLOC(req->rq_oi.oi_oa); + req->rq_oi.oi_oa = kmem_cache_alloc(obdo_cachep, + GFP_NOFS | __GFP_ZERO); if (req->rq_oi.oi_oa == NULL) { kfree(req); rc = -ENOMEM; @@ -319,7 +320,6 @@ int lov_prep_getattr_set(struct obd_export *exp, struct obd_info *oinfo, sizeof(*req->rq_oi.oi_oa)); req->rq_oi.oi_oa->o_oi = loi->loi_oi; req->rq_oi.oi_cb_up = cb_getattr_update; - req->rq_oi.oi_capa = oinfo->oi_capa; lov_set_add_req(req, set); } @@ -392,7 +392,8 @@ int lov_prep_destroy_set(struct obd_export *exp, struct obd_info *oinfo, req->rq_stripe = i; req->rq_idx = loi->loi_ost_idx; - OBDO_ALLOC(req->rq_oi.oi_oa); + req->rq_oi.oi_oa = kmem_cache_alloc(obdo_cachep, + GFP_NOFS | __GFP_ZERO); if (req->rq_oi.oi_oa == NULL) { kfree(req); rc = -ENOMEM; @@ -507,7 +508,8 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo, req->rq_stripe = i; req->rq_idx = loi->loi_ost_idx; - OBDO_ALLOC(req->rq_oi.oi_oa); + req->rq_oi.oi_oa = kmem_cache_alloc(obdo_cachep, + GFP_NOFS | __GFP_ZERO); if (req->rq_oi.oi_oa == NULL) { kfree(req); rc = -ENOMEM; @@ -518,7 +520,6 @@ int lov_prep_setattr_set(struct obd_export *exp, struct obd_info *oinfo, req->rq_oi.oi_oa->o_oi = loi->loi_oi; req->rq_oi.oi_oa->o_stripe_idx = i; req->rq_oi.oi_cb_up = cb_setattr_update; - req->rq_oi.oi_capa = oinfo->oi_capa; if (oinfo->oi_oa->o_valid & OBD_MD_FLSIZE) { int off = lov_stripe_offset(oinfo->oi_md, diff --git a/drivers/staging/lustre/lustre/lov/lovsub_dev.c b/drivers/staging/lustre/lustre/lov/lovsub_dev.c index 90d9ec386a1a..8bc04c8d3d60 100644 --- a/drivers/staging/lustre/lustre/lov/lovsub_dev.c +++ b/drivers/staging/lustre/lustre/lov/lovsub_dev.c @@ -56,7 +56,7 @@ static void lovsub_req_completion(const struct lu_env *env, struct lovsub_req *lsr; lsr = cl2lovsub_req(slice); - OBD_SLAB_FREE_PTR(lsr, lovsub_req_kmem); + kmem_cache_free(lovsub_req_kmem, lsr); } /** @@ -146,7 +146,7 @@ static int lovsub_req_init(const struct lu_env *env, struct cl_device *dev, struct lovsub_req *lsr; int result; - OBD_SLAB_ALLOC_PTR_GFP(lsr, lovsub_req_kmem, GFP_NOFS); + lsr = kmem_cache_alloc(lovsub_req_kmem, GFP_NOFS | __GFP_ZERO); if (lsr != NULL) { cl_req_slice_add(req, &lsr->lsrq_cl, dev, &lovsub_req_ops); result = 0; @@ -205,5 +205,4 @@ struct lu_device_type lovsub_device_type = { .ldt_ctx_tags = LCT_CL_THREAD }; - /** @} lov */ diff --git a/drivers/staging/lustre/lustre/lov/lovsub_lock.c b/drivers/staging/lustre/lustre/lov/lovsub_lock.c index 62b696d25d81..1a3e30a14895 100644 --- a/drivers/staging/lustre/lustre/lov/lovsub_lock.c +++ b/drivers/staging/lustre/lustre/lov/lovsub_lock.c @@ -59,7 +59,7 @@ static void lovsub_lock_fini(const struct lu_env *env, lsl = cl2lovsub_lock(slice); LASSERT(list_empty(&lsl->lss_parents)); - OBD_SLAB_FREE_PTR(lsl, lovsub_lock_kmem); + kmem_cache_free(lovsub_lock_kmem, lsl); } static void lovsub_parent_lock(const struct lu_env *env, struct lov_lock *lov) @@ -453,7 +453,7 @@ int lovsub_lock_init(const struct lu_env *env, struct cl_object *obj, struct lovsub_lock *lsk; int result; - OBD_SLAB_ALLOC_PTR_GFP(lsk, lovsub_lock_kmem, GFP_NOFS); + lsk = kmem_cache_alloc(lovsub_lock_kmem, GFP_NOFS | __GFP_ZERO); if (lsk != NULL) { INIT_LIST_HEAD(&lsk->lss_parents); cl_lock_slice_add(lock, &lsk->lss_cl, obj, &lovsub_lock_ops); diff --git a/drivers/staging/lustre/lustre/lov/lovsub_object.c b/drivers/staging/lustre/lustre/lov/lovsub_object.c index 57e3629fccee..d775e28d4097 100644 --- a/drivers/staging/lustre/lustre/lov/lovsub_object.c +++ b/drivers/staging/lustre/lustre/lov/lovsub_object.c @@ -91,7 +91,7 @@ static void lovsub_object_free(const struct lu_env *env, struct lu_object *obj) lu_object_fini(obj); lu_object_header_fini(&los->lso_header.coh_lu); - OBD_SLAB_FREE_PTR(los, lovsub_object_kmem); + kmem_cache_free(lovsub_object_kmem, los); } static int lovsub_object_print(const struct lu_env *env, void *cookie, @@ -120,8 +120,6 @@ static int lovsub_object_glimpse(const struct lu_env *env, return cl_object_glimpse(env, &los->lso_super->lo_cl, lvb); } - - static const struct cl_object_operations lovsub_ops = { .coo_page_init = lovsub_page_init, .coo_lock_init = lovsub_lock_init, @@ -145,7 +143,7 @@ struct lu_object *lovsub_object_alloc(const struct lu_env *env, struct lovsub_object *los; struct lu_object *obj; - OBD_SLAB_ALLOC_PTR_GFP(los, lovsub_object_kmem, GFP_NOFS); + los = kmem_cache_alloc(lovsub_object_kmem, GFP_NOFS | __GFP_ZERO); if (los != NULL) { struct cl_object_header *hdr; diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c b/drivers/staging/lustre/lustre/lov/lproc_lov.c index 380b8271bf24..a0be15c6b55a 100644 --- a/drivers/staging/lustre/lustre/lov/lproc_lov.c +++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c @@ -71,6 +71,7 @@ static ssize_t lov_stripesize_seq_write(struct file *file, desc->ld_default_stripe_size = val; return count; } + LPROC_SEQ_FOPS(lov_stripesize); static int lov_stripeoffset_seq_show(struct seq_file *m, void *v) @@ -102,6 +103,7 @@ static ssize_t lov_stripeoffset_seq_write(struct file *file, desc->ld_default_stripe_offset = val; return count; } + LPROC_SEQ_FOPS(lov_stripeoffset); static int lov_stripetype_seq_show(struct seq_file *m, void *v) @@ -133,6 +135,7 @@ static ssize_t lov_stripetype_seq_write(struct file *file, desc->ld_pattern = val; return count; } + LPROC_SEQ_FOPS(lov_stripetype); static int lov_stripecount_seq_show(struct seq_file *m, void *v) @@ -164,6 +167,7 @@ static ssize_t lov_stripecount_seq_write(struct file *file, desc->ld_default_stripe_count = val; return count; } + LPROC_SEQ_FOPS(lov_stripecount); static ssize_t numobd_show(struct kobject *kobj, struct attribute *attr, @@ -200,6 +204,7 @@ static int lov_desc_uuid_seq_show(struct seq_file *m, void *v) seq_printf(m, "%s\n", lov->desc.ld_uuid.uuid); return 0; } + LPROC_SEQ_FOPS_RO(lov_desc_uuid); static void *lov_tgt_seq_start(struct seq_file *p, loff_t *pos) |