LU-14187 osd-ldiskfs: fix locking in write commit
Restart transaction in osd layer break rules that
locks are taken afer transaction start.
This patch try to fix by moving transaction restart
to OFD layer.
We will record how many extents we declare with
@oh_declared_ext. And during IO we check if it
run out before we restart whole transaction.
We track an average extent bytes per filesystem and
use it as a hint during declare write commit. This
will avoid us restart transaction ofen if filesystem
is heavily fragmented.
Fixes:
0271b17b ("LU-14134 osd-ldiskfs: reduce credits for new writing")
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Change-Id: I289a3a6775befe159b7fef29004eaaaff873e2c6
Reviewed-on: https://review.whamcloud.com/40991
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>