Whamcloud - gitweb
LU-4528 llog: don't write llog in 3-steps
The llog record my be written by passing just buffer
and writting its header and tail separately. If any write fails
then that cause partially written buffer and corrupted llog. There is
special undo procedure to clean things up after that but that demands
twice more credits for normal operations and for undo case which
is critical in case of wide striping.
Such 3-steps write can be avoided by preparing correct llog record
before calling llog_write().
Patch does the following:
- remove all cases with passing separate buffer for llog_write(),
llog_add(), llog_cat_add() and change API according with that.
- special allocation case for lustre_cfg if it is going to be written
to the llog, it allocates llog header/tail and initialize it.
- uniform error checks after lustre_cfg_new() call to check for NULL
result always instead of ERR_PTR()
- remove 3-steps write in llog_osd code completely
- write llog padding record in single step too
- remove duplicated code from llog_cat_new_log(). Previously it
assigned the next index for the record, changed bitmap and called
llog_write with new index, so that was considered as 'modification'
of record but not append. Meanwhile the llog_osd_write_rec() does
the same intenally for append request. Now llog_cat_new_log() just
calls llog_write() with -1 index (append), avoiding all header
changes outside that call.
- remove numcookie parameter from llog_write_rec() because it is
always 1 anyway
- remove cookie parameter from llog_write() because it is not used,
note, the cookie remains as parameter of llog_write_rec() for llog
catalog purposes.
Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: Ibf231021ece9d7cb8a3c4288e12077e11f691661
Reviewed-on: http://review.whamcloud.com/10108
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
22 files changed: