Whamcloud - gitweb
LU-12635 build: Support for gcc -Wimplicit-fallthrough
[fs/lustre-release.git] / lustre / lod / lod_qos.c
index 1e2645b..739720f 100644 (file)
@@ -434,12 +434,6 @@ static int lod_qos_used(struct lod_device *lod, struct ost_pool *osts,
        RETURN(0);
 }
 
-void lod_qos_rr_init(struct lu_qos_rr *lqr)
-{
-       spin_lock_init(&lqr->lqr_alloc);
-       lqr->lqr_dirty = 1;
-}
-
 #define LOV_QOS_EMPTY ((__u32)-1)
 
 /**
@@ -1548,29 +1542,7 @@ static int lod_alloc_qos(const struct lu_env *env, struct lod_object *lo,
                cur_weight = 0;
                rc = -ENOSPC;
 
-               if (total_weight) {
-#if BITS_PER_LONG == 32
-                       rand = prandom_u32_max((u32)total_weight);
-                       /* If total_weight > 32-bit, first generate the high
-                        * 32 bits of the random number, then add in the low
-                        * 32 bits (truncated to the upper limit, if needed)
-                        */
-                       if (total_weight > 0xffffffffULL)
-                               rand = prandom_u32_max((u32)(total_weight >> 32)) << 32;
-                       else
-                               rand = 0;
-
-                       if (rand == (total_weight & 0xffffffff00000000ULL))
-                               rand |= prandom_u32_max((u32)total_weight);
-                       else
-                               rand |= prandom_u32();
-
-#else
-                       rand = prandom_u32() | prandom_u32_max((u32)total_weight);
-#endif
-               } else {
-                       rand = 0;
-               }
+               rand = lu_prandom_u64_max(total_weight);
 
                /* On average, this will hit larger-weighted OSTs more often.
                 * 0-weight OSTs will always get used last (only when rand=0) */
@@ -2051,7 +2023,7 @@ int lod_qos_parse_config(const struct lu_env *env, struct lod_object *lo,
                        lod_comp->llc_extent = *ext;
                        lod_comp->llc_flags =
                                comp_v1->lcm_entries[i].lcme_flags &
-                                       LCME_USER_FLAGS;
+                                       LCME_CL_COMP_FLAGS;
                }
 
                pool_name = NULL;
@@ -2310,6 +2282,7 @@ int lod_qos_prep_create(const struct lu_env *env, struct lod_object *lo,
        LASSERT(lo);
        LASSERT(lo->ldo_comp_cnt > comp_idx && lo->ldo_comp_entries != NULL);
        lod_comp = &lo->ldo_comp_entries[comp_idx];
+       LASSERT(!(lod_comp->llc_flags & LCME_FL_EXTENSION));
 
        /* A released component is being created */
        if (lod_comp->llc_pattern & LOV_PATTERN_F_RELEASED)