Whamcloud - gitweb
LU-4528 llog: don't write llog in 3-steps 08/10108/10
authorMikhail Pershin <mike.pershin@intel.com>
Fri, 25 Apr 2014 19:01:51 +0000 (23:01 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 9 May 2014 14:43:35 +0000 (14:43 +0000)
commit7c243a561ffe8503a6abf5c4cafef0c3566192bc
tree071dc0cae0cbec57850319a382bd5b29da9bf839
parent46e82c4644108eac92ac7c813c16bd7dd3283a56
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:
lustre/include/lustre/lustre_idl.h
lustre/include/lustre_cfg.h
lustre/include/lustre_log.h
lustre/mdd/mdd_device.c
lustre/mdd/mdd_dir.c
lustre/mdt/mdt_hsm_cdt_actions.c
lustre/mgs/lproc_mgs.c
lustre/mgs/mgs_internal.h
lustre/mgs/mgs_llog.c
lustre/obdclass/llog.c
lustre/obdclass/llog_cat.c
lustre/obdclass/llog_internal.h
lustre/obdclass/llog_osd.c
lustre/obdclass/llog_test.c
lustre/obdclass/obd_config.c
lustre/obdclass/obd_mount.c
lustre/obdclass/obd_mount_server.c
lustre/osd-ldiskfs/osd_internal.h
lustre/osp/osp_sync.c
lustre/ptlrpc/sec_config.c
lustre/utils/lustre_cfg.c
lustre/utils/obd.c