struct lovsub_object;
enum lov_device_flags {
- LOV_DEV_INITIALIZED = 1 << 0
+ LOV_DEV_INITIALIZED = BIT(0),
};
/*
LLT_EMPTY, /** empty file without body (mknod + truncate) */
LLT_RELEASED, /** file with no objects (data in HSM) */
LLT_COMP, /** support composite layout */
+ LLT_FOREIGN, /** foreign layout */
LLT_NR
};
return "RELEASED";
case LLT_COMP:
return "COMPOSITE";
+ case LLT_FOREIGN:
+ return "FOREIGN";
case LLT_NR:
LBUG();
}
*/
static inline __u32 lov_entry_type(struct lov_stripe_md_entry *lsme)
{
- if ((lov_pattern(lsme->lsme_pattern) == LOV_PATTERN_RAID0) ||
+ if ((lov_pattern(lsme->lsme_pattern) & LOV_PATTERN_RAID0) ||
(lov_pattern(lsme->lsme_pattern) == LOV_PATTERN_MDT))
- return lov_pattern(lsme->lsme_pattern);
+ return lov_pattern(lsme->lsme_pattern &
+ ~LOV_PATTERN_OVERSTRIPING);
return 0;
}
{
LASSERT(lov->lo_type == LLT_COMP);
LASSERTF(i < lov->u.composite.lo_entry_count,
- "entry %d entry_count %d", i, lov->u.composite.lo_entry_count);
+ "entry %d entry_count %d\n", i,
+ lov->u.composite.lo_entry_count);
return &lov->u.composite.lo_entries[i].lle_raid0;
}
{
LASSERT(lov->lo_type == LLT_COMP);
LASSERTF(i < lov->u.composite.lo_entry_count,
- "entry %d entry_count %d", i, lov->u.composite.lo_entry_count);
+ "entry %d entry_count %d\n", i,
+ lov->u.composite.lo_entry_count);
return &lov->u.composite.lo_entries[i];
}
struct lov_page {
struct cl_page_slice lps_cl;
- /** layout_entry + stripe index, composed using lov_comp_index() */
- unsigned int lps_index;
/* the layout gen when this page was created */
__u32 lps_layout_gen;
};
struct cl_io *lse_io;
};
-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;
struct ost_lvb lti_lvb;
struct cl_2queue lti_cl2q;
struct cl_page_list lti_plist;
- wait_queue_t lti_waiter;
};
/**
* \see cl_env_get()
*/
__u16 sub_refcheck;
- __u16 sub_reenter;
};
/**
int lov_page_init (const struct lu_env *env, struct cl_object *ob,
struct cl_page *page, pgoff_t index);
-int lovsub_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,
struct cl_page *page, pgoff_t index);
+int lov_page_init_foreign(const struct lu_env *env, struct cl_object *obj,
+ struct cl_page *page, pgoff_t index);
struct lu_object *lov_object_alloc (const struct lu_env *env,
const struct lu_object_header *hdr,
struct lu_device *dev);
+
struct lu_object *lovsub_object_alloc(const struct lu_env *env,
const struct lu_object_header *hdr,
struct lu_device *dev);
static inline struct lov_device *lu2lov_dev(const struct lu_device *d)
{
- LINVRNT(d->ld_type == &lov_device_type);
- return container_of0(d, struct lov_device, ld_cl.cd_lu_dev);
+ LINVRNT(d->ld_type == &lov_device_type);
+ return container_of(d, struct lov_device, ld_cl.cd_lu_dev);
}
static inline struct cl_device *lovsub2cl_dev(struct lovsub_device *lovsub)
static inline struct lovsub_device *lu2lovsub_dev(const struct lu_device *d)
{
- LINVRNT(d->ld_type == &lovsub_device_type);
- return container_of0(d, struct lovsub_device, acid_cl.cd_lu_dev);
+ LINVRNT(d->ld_type == &lovsub_device_type);
+ return container_of(d, struct lovsub_device, acid_cl.cd_lu_dev);
}
static inline struct lovsub_device *cl2lovsub_dev(const struct cl_device *d)
{
- LINVRNT(d->cd_lu_dev.ld_type == &lovsub_device_type);
- return container_of0(d, struct lovsub_device, acid_cl);
+ LINVRNT(d->cd_lu_dev.ld_type == &lovsub_device_type);
+ return container_of(d, struct lovsub_device, acid_cl);
}
static inline struct lu_object *lov2lu(struct lov_object *lov)
static inline struct lov_object *lu2lov(const struct lu_object *obj)
{
- LINVRNT(lov_is_object(obj));
- return container_of0(obj, struct lov_object, lo_cl.co_lu);
+ LINVRNT(lov_is_object(obj));
+ return container_of(obj, struct lov_object, lo_cl.co_lu);
}
static inline struct lov_object *cl2lov(const struct cl_object *obj)
{
- LINVRNT(lov_is_object(&obj->co_lu));
- return container_of0(obj, struct lov_object, lo_cl);
+ LINVRNT(lov_is_object(&obj->co_lu));
+ return container_of(obj, struct lov_object, lo_cl);
}
static inline struct lu_object *lovsub2lu(struct lovsub_object *los)
{
- return &los->lso_cl.co_lu;
+ return &los->lso_cl.co_lu;
}
static inline struct cl_object *lovsub2cl(struct lovsub_object *los)
{
- return &los->lso_cl;
+ return &los->lso_cl;
}
static inline struct lovsub_object *cl2lovsub(const struct cl_object *obj)
{
- LINVRNT(lovsub_is_object(&obj->co_lu));
- return container_of0(obj, struct lovsub_object, lso_cl);
+ LINVRNT(lovsub_is_object(&obj->co_lu));
+ return container_of(obj, struct lovsub_object, lso_cl);
}
static inline struct lovsub_object *lu2lovsub(const struct lu_object *obj)
{
- LINVRNT(lovsub_is_object(obj));
- return container_of0(obj, struct lovsub_object, lso_cl.co_lu);
+ LINVRNT(lovsub_is_object(obj));
+ return container_of(obj, struct lovsub_object, lso_cl.co_lu);
}
static inline struct lov_lock *cl2lov_lock(const struct cl_lock_slice *slice)
{
- LINVRNT(lov_is_object(&slice->cls_obj->co_lu));
- return container_of(slice, struct lov_lock, lls_cl);
+ LINVRNT(lov_is_object(&slice->cls_obj->co_lu));
+ return container_of(slice, struct lov_lock, lls_cl);
}
static inline struct lov_page *cl2lov_page(const struct cl_page_slice *slice)
{
- LINVRNT(lov_is_object(&slice->cpl_obj->co_lu));
- return container_of0(slice, struct lov_page, lps_cl);
-}
-
-static inline struct lovsub_page *
-cl2lovsub_page(const struct cl_page_slice *slice)
-{
- LINVRNT(lovsub_is_object(&slice->cpl_obj->co_lu));
- return container_of0(slice, struct lovsub_page, lsb_cl);
+ LINVRNT(lov_is_object(&slice->cpl_obj->co_lu));
+ return container_of(slice, struct lov_page, lps_cl);
}
static inline struct lov_io *cl2lov_io(const struct lu_env *env,