/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2012, Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
}
cfs_down_write(&lov->lov_qos.lq_rw_sem);
- cfs_mutex_down(&lov->lov_lock);
+ cfs_mutex_lock(&lov->lov_lock);
cfs_list_for_each_entry(oss, &lov->lov_qos.lq_oss_list, lqo_oss_list) {
if (obd_uuid_equals(&oss->lqo_uuid,
&exp->exp_connection->c_remote_uuid)) {
oss->lqo_ost_count);
out:
- cfs_mutex_up(&lov->lov_lock);
+ cfs_mutex_unlock(&lov->lov_lock);
cfs_up_write(&lov->lov_qos.lq_rw_sem);
RETURN(rc);
}
struct lov_request *req,
struct obd_trans_info *oti)
{
- int stripe;
+ __u16 stripe;
int rc = -EIO;
ENTRY;
int stripe_cnt_min = min_stripe_count(*stripe_cnt, flags);
struct pool_desc *pool;
struct ost_pool *osts;
- struct lov_qos_rr *lqr;
ENTRY;
if (stripe_cnt_min < 1)
pool = lov_find_pool(lov, poolname);
if (pool == NULL) {
osts = &(lov->lov_packed);
- lqr = &(lov->lov_qos.lq_rr);
} else {
cfs_down_read(&pool_tgt_rw_sem(pool));
osts = &(pool->pool_obds);
- lqr = &(pool->pool_rr);
}
obd_getref(exp->exp_obd);
LASSERT(src_oa->o_valid & OBD_MD_FLGROUP);
if (set->set_oi->oi_md == NULL) {
- int stripes_def = lov_get_stripecnt(lov, 0);
+ __u16 stripes_def = lov_get_stripecnt(lov, LOV_MAGIC, 0);
/* If the MDS file was truncated up to some size, stripe over
* enough OSTs to allow the file to be created at that size.
if (stripes < stripes_def)
stripes = stripes_def;
} else {
- flag = LOV_USES_DEFAULT_STRIPE;
- stripes = stripes_def;
+ flag = LOV_USES_DEFAULT_STRIPE;
+ stripes = stripes_def;
}
rc = lov_alloc_memmd(&set->set_oi->oi_md, stripes,
lsm = set->set_oi->oi_md;
lsm->lsm_object_id = src_oa->o_id;
lsm->lsm_object_seq = src_oa->o_seq;
+ lsm->lsm_layout_gen = 0; /* actual generation set in mdd_lov_create() */
if (!lsm->lsm_stripe_size)
lsm->lsm_stripe_size = lov->desc.ld_default_stripe_size;
void qos_statfs_done(struct lov_obd *lov)
{
- LASSERT(lov->lov_qos.lq_statfs_in_progress);
cfs_down_write(&lov->lov_qos.lq_rw_sem);
- lov->lov_qos.lq_statfs_in_progress = 0;
- /* wake up any threads waiting for the statfs rpcs to complete */
- cfs_waitq_signal(&lov->lov_qos.lq_statfs_waitq);
+ if (lov->lov_qos.lq_statfs_in_progress) {
+ lov->lov_qos.lq_statfs_in_progress = 0;
+ /* wake up any threads waiting for the statfs rpcs to complete*/
+ cfs_waitq_signal(&lov->lov_qos.lq_statfs_waitq);
+ }
cfs_up_write(&lov->lov_qos.lq_rw_sem);
}