#include <obd_class.h>
#include <lustre_disk.h>
#include <lustre_fid.h>
+#include <lustre/lustre_idl.h> /* LLOG_CHUNK_SIZE definition */
#include "osd_internal.h"
dmu_tx_hold_sa_create(oh->ot_tx, ZFS_SA_BASE_ATTR_SIZE);
}
+ /* XXX: we still miss for append declaration support in ZFS
+ * -1 means append which is used by llog mostly, llog
+ * can grow upto LLOG_CHUNK_SIZE*8 records */
+ if (pos == -1)
+ pos = max_t(loff_t, 256 * 8 * LLOG_CHUNK_SIZE,
+ obj->oo_attr.la_size + (2 << 20));
dmu_tx_hold_write(oh->ot_tx, oid, pos, buf->lb_len);
/* dt_declare_write() is usually called for system objects, such
continue;
}
- dmu_tx_hold_write(oh->ot_tx, obj->oo_db->db_object, offset,size);
-
+ dmu_tx_hold_write(oh->ot_tx, obj->oo_db->db_object,
+ offset, size);
/* estimating space that will be consumed by a write is rather
* complicated with ZFS. As a consequence, we don't account for
* indirect blocks and quota overrun will be adjusted once the
* operation is committed, if required. */
space += osd_count_not_mapped(obj, offset, size);
- offset = lnb->lnb_file_offset;
- size = lnb->len;
+ offset = lnb[i].lnb_file_offset;
+ size = lnb[i].len;
}
if (size) {
- dmu_tx_hold_write(oh->ot_tx, obj->oo_db->db_object, offset,size);
+ dmu_tx_hold_write(oh->ot_tx, obj->oo_db->db_object,
+ offset, size);
space += osd_count_not_mapped(obj, offset, size);
}