[PATCH 5.15 061/110] jbd2: refactor wait logic for transaction updates into a common function