34 static inline struct xfs_efi_log_item *EFI_ITEM(
struct xfs_log_item *
lip)
36 return container_of(lip,
struct xfs_efi_log_item, efi_item);
41 struct xfs_efi_log_item *efip)
43 if (efip->efi_format.efi_nextents > XFS_EFI_MAX_FAST_EXTENTS)
59 struct xfs_efi_log_item *efip)
61 struct xfs_ail *ailp = efip->efi_item.li_ailp;
66 xfs_trans_ail_delete(ailp, &efip->efi_item,
67 SHUTDOWN_LOG_IO_ERROR);
79 struct xfs_log_item *
lip)
93 struct xfs_log_item *
lip,
96 struct xfs_efi_log_item *efip = EFI_ITEM(lip);
100 efip->efi_format.efi_nextents);
105 size += (efip->efi_format.efi_nextents - 1) *
sizeof(
xfs_extent_t);
106 efip->efi_format.efi_size = 1;
108 log_vector->
i_addr = &efip->efi_format;
120 struct xfs_log_item *
lip)
134 struct xfs_log_item *
lip,
137 struct xfs_efi_log_item *efip = EFI_ITEM(lip);
140 ASSERT(!(lip->li_flags & XFS_LI_IN_AIL));
158 struct xfs_log_item *
lip,
161 return XFS_ITEM_PINNED;
166 struct xfs_log_item *
lip)
168 if (lip->li_flags & XFS_LI_ABORTED)
181 struct xfs_log_item *
lip,
184 struct xfs_efi_log_item *efip = EFI_ITEM(lip);
186 set_bit(XFS_EFI_COMMITTED, &efip->efi_flags);
199 struct xfs_log_item *
lip,
207 static const struct xfs_item_ops xfs_efi_item_ops = {
222 struct xfs_efi_log_item *
224 struct xfs_mount *
mp,
228 struct xfs_efi_log_item *efip;
232 if (nextents > XFS_EFI_MAX_FAST_EXTENTS) {
233 size = (
uint)(
sizeof(xfs_efi_log_item_t) +
241 efip->efi_format.efi_nextents = nextents;
242 efip->efi_format.efi_id = (__psint_t)(
void*)efip;
262 uint len32 =
sizeof(xfs_efi_log_format_32_t) +
263 (src_efi_fmt->
efi_nextents - 1) *
sizeof(xfs_extent_32_t);
267 if (buf->
i_len == len) {
268 memcpy((
char *)dst_efi_fmt, (
char*)src_efi_fmt, len);
270 }
else if (buf->
i_len == len32) {
271 xfs_efi_log_format_32_t *src_efi_fmt_32 = buf->
i_addr;
273 dst_efi_fmt->
efi_type = src_efi_fmt_32->efi_type;
274 dst_efi_fmt->
efi_size = src_efi_fmt_32->efi_size;
275 dst_efi_fmt->
efi_nextents = src_efi_fmt_32->efi_nextents;
276 dst_efi_fmt->
efi_id = src_efi_fmt_32->efi_id;
279 src_efi_fmt_32->efi_extents[
i].ext_start;
281 src_efi_fmt_32->efi_extents[
i].ext_len;
284 }
else if (buf->
i_len == len64) {
317 static inline struct xfs_efd_log_item *EFD_ITEM(
struct xfs_log_item *
lip)
319 return container_of(lip,
struct xfs_efd_log_item, efd_item);
325 if (efdp->efd_format.efd_nextents > XFS_EFD_MAX_FAST_EXTENTS)
338 struct xfs_log_item *
lip)
352 struct xfs_log_item *
lip,
355 struct xfs_efd_log_item *efdp = EFD_ITEM(lip);
358 ASSERT(efdp->efd_next_extent == efdp->efd_format.efd_nextents);
363 size += (efdp->efd_format.efd_nextents - 1) *
sizeof(
xfs_extent_t);
364 efdp->efd_format.efd_size = 1;
366 log_vector->
i_addr = &efdp->efd_format;
377 struct xfs_log_item *
lip)
387 struct xfs_log_item *
lip,
398 struct xfs_log_item *
lip,
401 return XFS_ITEM_PINNED;
406 struct xfs_log_item *
lip)
408 if (lip->li_flags & XFS_LI_ABORTED)
421 struct xfs_log_item *
lip,
424 struct xfs_efd_log_item *efdp = EFD_ITEM(lip);
430 if (!(lip->li_flags & XFS_LI_ABORTED))
446 struct xfs_log_item *
lip,
454 static const struct xfs_item_ops xfs_efd_item_ops = {
468 struct xfs_efd_log_item *
470 struct xfs_mount *
mp,
471 struct xfs_efi_log_item *efip,
475 struct xfs_efd_log_item *efdp;
479 if (nextents > XFS_EFD_MAX_FAST_EXTENTS) {
480 size = (
uint)(
sizeof(xfs_efd_log_item_t) +
488 efdp->efd_efip = efip;
489 efdp->efd_format.efd_nextents = nextents;
490 efdp->efd_format.efd_efi_id = efip->efi_format.efi_id;