Whamcloud - gitweb
LU-15850 llite: pass dmv inherit depth instead of dir depth
[fs/lustre-release.git] / lustre / lod / lod_internal.h
index 61d5199..78ec188 100644 (file)
@@ -69,6 +69,8 @@ struct pool_desc {
        unsigned int             pool_spill_threshold_pct;
        atomic_t                 pool_spill_hit;
        char                     pool_spill_target[LOV_MAXPOOLNAME + 1];
+       bool                     pool_same_space; /* targets in pool balanced*/
+       time64_t                 pool_same_space_expire; /*uses ld_qos_maxage*/
 };
 
 struct lod_device;
@@ -158,6 +160,7 @@ struct lod_device {
 
        /* max stripe count if stripe count is set to -1. 0 means unlimited */
        unsigned int            lod_max_stripecount;
+       unsigned int            lod_max_mdt_stripecount;
 };
 
 #define lod_ost_bitmap         lod_ost_descs.ltd_tgt_bitmap
@@ -204,27 +207,6 @@ struct lod_default_striping {
                                        lds_dir_def_striping_set:1;
 };
 
-static inline __u8 lmv_inherit_next(__u8 inherit)
-{
-       if (inherit == LMV_INHERIT_END || inherit == LMV_INHERIT_NONE)
-               return LMV_INHERIT_NONE;
-
-       if (inherit == LMV_INHERIT_UNLIMITED || inherit > LMV_INHERIT_MAX)
-               return inherit;
-
-       return inherit - 1;
-}
-
-static inline __u8 lmv_inherit_rr_next(__u8 inherit_rr)
-{
-       if (inherit_rr == LMV_INHERIT_RR_NONE ||
-           inherit_rr == LMV_INHERIT_RR_UNLIMITED ||
-           inherit_rr > LMV_INHERIT_RR_MAX)
-               return inherit_rr;
-
-       return inherit_rr - 1;
-}
-
 enum layout_verify_flags {
        LVF_ALL_STALE           = BIT(0), /* check not all stale mirrors */
 };
@@ -245,6 +227,8 @@ struct lod_object {
        /* common fields for both files and directories */
        struct dt_object                ldo_obj;
        struct mutex                    ldo_layout_mutex;
+                                       /* foreign file/directory */
+       __u32                           ldo_is_foreign:1;
        union {
                /* file stripe (LOV) */
                struct {
@@ -258,8 +242,7 @@ struct lod_object {
                        struct lod_mirror_entry *ldo_mirrors;
                        __u32           ldo_is_composite:1,
                                        ldo_flr_state:4,
-                                       ldo_comp_cached:1,
-                                       ldo_is_foreign:1;
+                                       ldo_comp_cached:1;
                };
                /* directory stripe (LMV) */
                struct {
@@ -276,9 +259,7 @@ struct lod_object {
                        __u32           ldo_dir_slave_stripe:1,
                                        ldo_dir_striped:1,
                                        /* the stripe has been loaded */
-                                       ldo_dir_stripe_loaded:1,
-                                       /* foreign directory */
-                                       ldo_dir_is_foreign;
+                                       ldo_dir_stripe_loaded:1;
                        /*
                         * This default LMV is parent default LMV, which will be
                         * used in child creation, and it's not cached, so this
@@ -361,12 +342,6 @@ static inline int lod_set_pool(char **pool, const char *new_pool)
        return 0;
 }
 
-static inline int lod_set_def_pool(struct lod_default_striping *lds,
-                                  int i, const char *new_pool)
-{
-       return lod_set_pool(&lds->lds_def_comp_entries[i].llc_pool, new_pool);
-}
-
 static inline int lod_obj_set_pool(struct lod_object *lo, int i,
                                   const char *new_pool)
 {
@@ -838,5 +813,6 @@ void lod_check_and_spill_pool(const struct lu_env *env, struct lod_device *lod,
                              char **poolname);
 void lod_spill_target_refresh(const struct lu_env *env, struct lod_device *lod,
                              struct pool_desc *pool);
+struct pool_desc *lod_pool_find(struct lod_device *lod, char *poolname);
 extern struct lprocfs_vars lprocfs_lod_spill_vars[];
 #endif