Whamcloud - gitweb
LU-4865 zfs: grow block size by write pattern
[fs/lustre-release.git] / lustre / osd-zfs / osd_object.c
index 9b5e11f..39b31ba 100644 (file)
@@ -1293,16 +1293,11 @@ static dmu_buf_t *osd_mkreg(const struct lu_env *env, struct osd_object *obj,
        if (rc)
                return ERR_PTR(rc);
 
-       /*
-        * XXX: This heuristic is non-optimal.  It would be better to
-        * increase the blocksize up to osd->od_max_blksz during the write.
-        * This is exactly how the ZPL behaves and it ensures that the right
-        * blocksize is selected based on the file size rather than the
-        * making broad assumptions based on the osd type.
-        */
        if (!lu_device_is_md(osd2lu_dev(osd))) {
+               /* uses 4K as default block size because clients write data
+                * with page size that is 4K at minimum */
                rc = -dmu_object_set_blocksize(osd->od_os, db->db_object,
-                                              osd->od_max_blksz, 0, oh->ot_tx);
+                                              4096, 0, oh->ot_tx);
                if (unlikely(rc)) {
                        CERROR("%s: can't change blocksize: %d\n",
                               osd->od_svname, rc);