static inline __u32 lov_entry_type(struct lov_stripe_md_entry *lsme)
{
if ((lov_pattern(lsme->lsme_pattern) & LOV_PATTERN_RAID0) ||
- (lov_pattern(lsme->lsme_pattern) == LOV_PATTERN_MDT))
+ (lov_pattern(lsme->lsme_pattern) == LOV_PATTERN_MDT) ||
+ (lov_pattern(lsme->lsme_pattern) == LOV_PATTERN_FOREIGN))
return lov_pattern(lsme->lsme_pattern &
~LOV_PATTERN_OVERSTRIPING);
return 0;
struct lov_layout_raid0 {
unsigned lo_nr;
/**
+ * record the stripe no before the truncate size, used for setting OST
+ * object size for truncate. LU-14128.
+ */
+ int lo_trunc_stripeno;
+ /**
* When this is true, lov_object::lo_attr contains
* valid up to date attributes for a top-level
* object. This field is reset to 0 when attributes of
unsigned short lre_mirror_id;
unsigned short lre_preferred:1,
lre_stale:1, /* set if any components is stale */
- lre_valid:1; /* set if at least one of components
+ lre_valid:1, /* set if at least one of components
* in this mirror is valid */
+ lre_foreign:1; /* set if it is a foreign component */
+
unsigned short lre_start; /* index to lo_entries, start index of
* this mirror */
unsigned short lre_end; /* end index of this mirror */
};
+enum lov_object_flags {
+ /* Layout is invalid, set when layout lock is lost */
+ LO_LAYOUT_INVALID = 0x1,
+};
+
/**
* lov-specific file state.
*
*/
enum lov_layout_type lo_type;
/**
- * True if layout is invalid. This bit is cleared when layout lock
- * is lost.
+ * Object flags.
*/
- bool lo_layout_invalid;
+ unsigned long lo_obj_flags;
/**
* How many IOs are on going on this object. Layout can be changed
* only if there is no active IO.
extern struct kmem_cache *lovsub_object_kmem;
-int lov_object_init (const struct lu_env *env, struct lu_object *obj,
- const struct lu_object_conf *conf);
-int lovsub_object_init (const struct lu_env *env, struct lu_object *obj,
- const struct lu_object_conf *conf);
-int lov_lock_init (const struct lu_env *env, struct cl_object *obj,
- struct cl_lock *lock, const struct cl_io *io);
-int lov_io_init (const struct lu_env *env, struct cl_object *obj,
- struct cl_io *io);
-
int lov_lock_init_composite(const struct lu_env *env, struct cl_object *obj,
struct cl_lock *lock, const struct cl_io *io);
int lov_lock_init_empty (const struct lu_env *env, struct cl_object *obj,
struct lov_io_sub *lov_sub_get(const struct lu_env *env, struct lov_io *lio,
int stripe);
-int lov_page_init (const struct lu_env *env, struct cl_object *ob,
- struct cl_page *page, pgoff_t index);
int lov_page_init_empty (const struct lu_env *env, struct cl_object *obj,
struct cl_page *page, pgoff_t index);
int lov_page_init_composite(const struct lu_env *env, struct cl_object *obj,
const struct lu_object_header *hdr,
struct lu_device *dev);
-struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov);
int lov_page_stripe(const struct cl_page *page);
bool lov_page_is_empty(const struct cl_page *page);
int lov_lsm_entry(const struct lov_stripe_md *lsm, __u64 offset);