Whamcloud - gitweb
LU-12535 lov: Move page index to top level
[fs/lustre-release.git] / lustre / lov / lov_cl_internal.h
index 1609be5..b811451 100644 (file)
@@ -122,6 +122,7 @@ enum lov_layout_type {
        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
 };
 
@@ -134,6 +135,8 @@ static inline char *llt2str(enum lov_layout_type llt)
                return "RELEASED";
        case LLT_COMP:
                return "COMPOSITE";
+       case LLT_FOREIGN:
+               return "FOREIGN";
        case LLT_NR:
                LBUG();
        }
@@ -147,9 +150,10 @@ static inline char *llt2str(enum lov_layout_type llt)
  */
 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;
 }
 
@@ -433,8 +437,6 @@ struct lov_lock {
 
 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;
 };
@@ -463,11 +465,6 @@ struct lov_sublock_env {
         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;
@@ -507,7 +504,6 @@ struct lov_io_sub {
         * \see cl_env_get()
         */
        __u16                   sub_refcheck;
-       __u16                   sub_reenter;
 };
 
 /**
@@ -624,15 +620,16 @@ struct lov_io_sub *lov_sub_get(const struct lu_env *env, struct lov_io *lio,
 
 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);
@@ -781,13 +778,6 @@ static inline struct lov_page *cl2lov_page(const struct cl_page_slice *slice)
         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);
-}
-
 static inline struct lov_io *cl2lov_io(const struct lu_env *env,
                                 const struct cl_io_slice *ios)
 {