Whamcloud - gitweb
LU-80 lov: large stripe count support
[fs/lustre-release.git] / lustre / mds / mds_lov.c
index ce9ce98..df26eda 100644 (file)
@@ -201,12 +201,14 @@ static int mds_lov_update_max_ost(struct mds_obd *mds, obd_id index)
         /* workaround - New target not in objids file; increase mdsize */
         /* ld_tgt_count is used as the max index everywhere, despite its name. */
         if (data[off] == 0) {
+                __u32 max_easize;
                 __u32 stripes;
 
+                max_easize = mds->mds_obt.obt_osd_properties.osd_max_ea_size;
                 data[off] = 1;
                 mds->mds_lov_objid_count++;
-                stripes = min_t(__u32, LOV_MAX_STRIPE_COUNT,
-                                mds->mds_lov_objid_count);
+                stripes = min(lov_mds_md_stripecnt(max_easize, LOV_MAGIC_V3),
+                              mds->mds_lov_objid_count);
 
                 mds->mds_max_mdsize = lov_mds_md_size(stripes, LOV_MAGIC_V3);
                 mds->mds_max_cookiesize = stripes * sizeof(struct llog_cookie);
@@ -368,8 +370,8 @@ EXPORT_SYMBOL(mds_lov_update_objids);
 static int mds_lov_update_from_read(struct mds_obd *mds, obd_id *data,
                                     __u32 count)
 {
-        __u32 i;
-        __u32 stripes;
+        __u32 max_easize = mds->mds_obt.obt_osd_properties.osd_max_ea_size;
+        __u32 i, stripes;
 
         for (i = 0; i < count; i++) {
                 if (data[i] == 0)
@@ -378,7 +380,7 @@ static int mds_lov_update_from_read(struct mds_obd *mds, obd_id *data,
                 mds->mds_lov_objid_count++;
         }
 
-        stripes = min_t(__u32, LOV_MAX_STRIPE_COUNT,
+        stripes = min(lov_mds_md_stripecnt(max_easize, LOV_MAGIC_V3),
                          mds->mds_lov_objid_count);
 
         mds->mds_max_mdsize = lov_mds_md_size(stripes, LOV_MAGIC_V3);
@@ -717,12 +719,14 @@ int mds_lov_connect(struct obd_device *obd, char * lov_name)
                                   OBD_CONNECT_OSS_CAPA  | OBD_CONNECT_FULL20  |
                                   OBD_CONNECT_CHANGE_QS | OBD_CONNECT_AT      |
                                   OBD_CONNECT_MDS | OBD_CONNECT_SKIP_ORPHAN   |
-                                  OBD_CONNECT_SOM;
+                                  OBD_CONNECT_SOM | OBD_CONNECT_MAX_EASIZE;
 #ifdef HAVE_LRU_RESIZE_SUPPORT
         data->ocd_connect_flags |= OBD_CONNECT_LRU_RESIZE;
 #endif
         data->ocd_version = LUSTRE_VERSION_CODE;
         data->ocd_group = mdt_to_obd_objseq(mds->mds_id);
+        data->ocd_max_easize = mds->mds_obt.obt_osd_properties.osd_max_ea_size;
+
         /* send max bytes per rpc */
         data->ocd_brw_size = PTLRPC_MAX_BRW_PAGES << CFS_PAGE_SHIFT;
         /* send the list of supported checksum types */