Lines Matching +full:re +full:- +full:attached

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
37 return INODE_ITEM(lip)->ili_inode->i_ino; in xfs_inode_item_sort()
45 struct xfs_mount *mp = ip->i_mount; in xfs_inode_item_precommit_check()
49 dip = kzalloc(mp->m_sb.sb_inodesize, GFP_KERNEL | GFP_NOFS); in xfs_inode_item_precommit_check()
57 fa = xfs_dinode_verify(mp, ip->i_ino, dip); in xfs_inode_item_precommit_check()
59 xfs_inode_verifier_error(ip, -EFSCORRUPTED, __func__, dip, in xfs_inode_item_precommit_check()
72 * per-modification inode state changes are applied. This includes VFS inode
78 * require AGI -> inode cluster buffer lock order. The inode cluster buffer is
79 * not locked until ->precommit, so it happens after everything else has been
82 * Further, we have AGI -> AGF lock ordering, and with O_TMPFILE handling we
83 * have AGI -> AGF -> iunlink item -> inode cluster buffer lock order. Hence we
90 * move the pinning of the inode cluster buffer to a ->precommit operation. This
93 * transaction. i.e. we ensure the lock order is always AGI -> AGF -> inode
106 struct xfs_inode *ip = iip->ili_inode; in xfs_inode_item_precommit()
108 unsigned int flags = iip->ili_dirty_flags; in xfs_inode_item_precommit()
112 * don't matter - we either will need an extra transaction in 24 hours in xfs_inode_item_precommit()
116 if (inode->i_state & I_DIRTY_TIME) { in xfs_inode_item_precommit()
117 spin_lock(&inode->i_lock); in xfs_inode_item_precommit()
118 inode->i_state &= ~I_DIRTY_TIME; in xfs_inode_item_precommit()
119 spin_unlock(&inode->i_lock); in xfs_inode_item_precommit()
123 * If we're updating the inode core or the timestamps and it's possible in xfs_inode_item_precommit()
127 xfs_has_bigtime(ip->i_mount) && in xfs_inode_item_precommit()
129 ip->i_diflags2 |= XFS_DIFLAG2_BIGTIME; in xfs_inode_item_precommit()
136 * and extszinherit flags set. If we're logging a directory that is in xfs_inode_item_precommit()
139 if ((ip->i_diflags & XFS_DIFLAG_RTINHERIT) && in xfs_inode_item_precommit()
140 (ip->i_diflags & XFS_DIFLAG_EXTSZINHERIT) && in xfs_inode_item_precommit()
141 xfs_extlen_to_rtxmod(ip->i_mount, ip->i_extsize) > 0) { in xfs_inode_item_precommit()
142 ip->i_diflags &= ~(XFS_DIFLAG_EXTSIZE | in xfs_inode_item_precommit()
144 ip->i_extsize = 0; in xfs_inode_item_precommit()
152 * to XFS_ILOG_CORE so that the actual on-disk dirty tracking in xfs_inode_item_precommit()
155 spin_lock(&iip->ili_lock); in xfs_inode_item_precommit()
156 iip->ili_fsync_fields |= (flags & ~XFS_ILOG_IVERSION); in xfs_inode_item_precommit()
160 if (!iip->ili_item.li_buf) { in xfs_inode_item_precommit()
167 * buffer attached to the item, we know that there is no IO in in xfs_inode_item_precommit()
173 spin_unlock(&iip->ili_lock); in xfs_inode_item_precommit()
174 error = xfs_imap_to_bp(ip->i_mount, tp, &ip->i_imap, &bp); in xfs_inode_item_precommit()
180 * don't want the buffer to remain attached to the transaction. in xfs_inode_item_precommit()
182 * we've attached the inode log item to the buffer log item in xfs_inode_item_precommit()
186 spin_lock(&iip->ili_lock); in xfs_inode_item_precommit()
187 iip->ili_item.li_buf = bp; in xfs_inode_item_precommit()
188 bp->b_flags |= _XBF_INODES; in xfs_inode_item_precommit()
189 list_add_tail(&iip->ili_item.li_bio_list, &bp->b_li_list); in xfs_inode_item_precommit()
199 iip->ili_fields |= (flags | iip->ili_last_fields); in xfs_inode_item_precommit()
200 spin_unlock(&iip->ili_lock); in xfs_inode_item_precommit()
208 iip->ili_dirty_flags = 0; in xfs_inode_item_precommit()
222 * inode gets -smaller- rather than stays the same size as the previously logged
232 struct xfs_inode *ip = iip->ili_inode; in xfs_inode_item_data_fork_size()
234 switch (ip->i_df.if_format) { in xfs_inode_item_data_fork_size()
236 if ((iip->ili_fields & XFS_ILOG_DEXT) && in xfs_inode_item_data_fork_size()
237 ip->i_df.if_nextents > 0 && in xfs_inode_item_data_fork_size()
238 ip->i_df.if_bytes > 0) { in xfs_inode_item_data_fork_size()
245 if ((iip->ili_fields & XFS_ILOG_DBROOT) && in xfs_inode_item_data_fork_size()
246 ip->i_df.if_broot_bytes > 0) { in xfs_inode_item_data_fork_size()
247 *nbytes += ip->i_df.if_broot_bytes; in xfs_inode_item_data_fork_size()
252 if ((iip->ili_fields & XFS_ILOG_DDATA) && in xfs_inode_item_data_fork_size()
253 ip->i_df.if_bytes > 0) { in xfs_inode_item_data_fork_size()
254 *nbytes += xlog_calc_iovec_len(ip->i_df.if_bytes); in xfs_inode_item_data_fork_size()
273 struct xfs_inode *ip = iip->ili_inode; in xfs_inode_item_attr_fork_size()
275 switch (ip->i_af.if_format) { in xfs_inode_item_attr_fork_size()
277 if ((iip->ili_fields & XFS_ILOG_AEXT) && in xfs_inode_item_attr_fork_size()
278 ip->i_af.if_nextents > 0 && in xfs_inode_item_attr_fork_size()
279 ip->i_af.if_bytes > 0) { in xfs_inode_item_attr_fork_size()
286 if ((iip->ili_fields & XFS_ILOG_ABROOT) && in xfs_inode_item_attr_fork_size()
287 ip->i_af.if_broot_bytes > 0) { in xfs_inode_item_attr_fork_size()
288 *nbytes += ip->i_af.if_broot_bytes; in xfs_inode_item_attr_fork_size()
293 if ((iip->ili_fields & XFS_ILOG_ADATA) && in xfs_inode_item_attr_fork_size()
294 ip->i_af.if_bytes > 0) { in xfs_inode_item_attr_fork_size()
295 *nbytes += xlog_calc_iovec_len(ip->i_af.if_bytes); in xfs_inode_item_attr_fork_size()
309 * inode core, and possibly one for the inode data/extents/b-tree root
310 * and one for the inode attribute data/extents/b-tree root.
319 struct xfs_inode *ip = iip->ili_inode; in xfs_inode_item_size()
323 xfs_log_dinode_size(ip->i_mount); in xfs_inode_item_size()
337 struct xfs_inode *ip = iip->ili_inode; in xfs_inode_item_format_data_fork()
340 switch (ip->i_df.if_format) { in xfs_inode_item_format_data_fork()
342 iip->ili_fields &= in xfs_inode_item_format_data_fork()
345 if ((iip->ili_fields & XFS_ILOG_DEXT) && in xfs_inode_item_format_data_fork()
346 ip->i_df.if_nextents > 0 && in xfs_inode_item_format_data_fork()
347 ip->i_df.if_bytes > 0) { in xfs_inode_item_format_data_fork()
350 ASSERT(xfs_iext_count(&ip->i_df) > 0); in xfs_inode_item_format_data_fork()
356 ASSERT(data_bytes <= ip->i_df.if_bytes); in xfs_inode_item_format_data_fork()
358 ilf->ilf_dsize = data_bytes; in xfs_inode_item_format_data_fork()
359 ilf->ilf_size++; in xfs_inode_item_format_data_fork()
361 iip->ili_fields &= ~XFS_ILOG_DEXT; in xfs_inode_item_format_data_fork()
365 iip->ili_fields &= in xfs_inode_item_format_data_fork()
368 if ((iip->ili_fields & XFS_ILOG_DBROOT) && in xfs_inode_item_format_data_fork()
369 ip->i_df.if_broot_bytes > 0) { in xfs_inode_item_format_data_fork()
370 ASSERT(ip->i_df.if_broot != NULL); in xfs_inode_item_format_data_fork()
372 ip->i_df.if_broot, in xfs_inode_item_format_data_fork()
373 ip->i_df.if_broot_bytes); in xfs_inode_item_format_data_fork()
374 ilf->ilf_dsize = ip->i_df.if_broot_bytes; in xfs_inode_item_format_data_fork()
375 ilf->ilf_size++; in xfs_inode_item_format_data_fork()
377 ASSERT(!(iip->ili_fields & in xfs_inode_item_format_data_fork()
379 iip->ili_fields &= ~XFS_ILOG_DBROOT; in xfs_inode_item_format_data_fork()
383 iip->ili_fields &= in xfs_inode_item_format_data_fork()
385 if ((iip->ili_fields & XFS_ILOG_DDATA) && in xfs_inode_item_format_data_fork()
386 ip->i_df.if_bytes > 0) { in xfs_inode_item_format_data_fork()
387 ASSERT(ip->i_df.if_data != NULL); in xfs_inode_item_format_data_fork()
388 ASSERT(ip->i_disk_size > 0); in xfs_inode_item_format_data_fork()
390 ip->i_df.if_data, ip->i_df.if_bytes); in xfs_inode_item_format_data_fork()
391 ilf->ilf_dsize = (unsigned)ip->i_df.if_bytes; in xfs_inode_item_format_data_fork()
392 ilf->ilf_size++; in xfs_inode_item_format_data_fork()
394 iip->ili_fields &= ~XFS_ILOG_DDATA; in xfs_inode_item_format_data_fork()
398 iip->ili_fields &= in xfs_inode_item_format_data_fork()
400 if (iip->ili_fields & XFS_ILOG_DEV) in xfs_inode_item_format_data_fork()
401 ilf->ilf_u.ilfu_rdev = sysv_encode_dev(VFS_I(ip)->i_rdev); in xfs_inode_item_format_data_fork()
416 struct xfs_inode *ip = iip->ili_inode; in xfs_inode_item_format_attr_fork()
419 switch (ip->i_af.if_format) { in xfs_inode_item_format_attr_fork()
421 iip->ili_fields &= in xfs_inode_item_format_attr_fork()
424 if ((iip->ili_fields & XFS_ILOG_AEXT) && in xfs_inode_item_format_attr_fork()
425 ip->i_af.if_nextents > 0 && in xfs_inode_item_format_attr_fork()
426 ip->i_af.if_bytes > 0) { in xfs_inode_item_format_attr_fork()
429 ASSERT(xfs_iext_count(&ip->i_af) == in xfs_inode_item_format_attr_fork()
430 ip->i_af.if_nextents); in xfs_inode_item_format_attr_fork()
436 ilf->ilf_asize = data_bytes; in xfs_inode_item_format_attr_fork()
437 ilf->ilf_size++; in xfs_inode_item_format_attr_fork()
439 iip->ili_fields &= ~XFS_ILOG_AEXT; in xfs_inode_item_format_attr_fork()
443 iip->ili_fields &= in xfs_inode_item_format_attr_fork()
446 if ((iip->ili_fields & XFS_ILOG_ABROOT) && in xfs_inode_item_format_attr_fork()
447 ip->i_af.if_broot_bytes > 0) { in xfs_inode_item_format_attr_fork()
448 ASSERT(ip->i_af.if_broot != NULL); in xfs_inode_item_format_attr_fork()
451 ip->i_af.if_broot, in xfs_inode_item_format_attr_fork()
452 ip->i_af.if_broot_bytes); in xfs_inode_item_format_attr_fork()
453 ilf->ilf_asize = ip->i_af.if_broot_bytes; in xfs_inode_item_format_attr_fork()
454 ilf->ilf_size++; in xfs_inode_item_format_attr_fork()
456 iip->ili_fields &= ~XFS_ILOG_ABROOT; in xfs_inode_item_format_attr_fork()
460 iip->ili_fields &= in xfs_inode_item_format_attr_fork()
463 if ((iip->ili_fields & XFS_ILOG_ADATA) && in xfs_inode_item_format_attr_fork()
464 ip->i_af.if_bytes > 0) { in xfs_inode_item_format_attr_fork()
465 ASSERT(ip->i_af.if_data != NULL); in xfs_inode_item_format_attr_fork()
467 ip->i_af.if_data, ip->i_af.if_bytes); in xfs_inode_item_format_attr_fork()
468 ilf->ilf_asize = (unsigned)ip->i_af.if_bytes; in xfs_inode_item_format_attr_fork()
469 ilf->ilf_size++; in xfs_inode_item_format_attr_fork()
471 iip->ili_fields &= ~XFS_ILOG_ADATA; in xfs_inode_item_format_attr_fork()
496 lits->t_sec = tv.tv_sec; in xfs_inode_to_log_dinode_ts()
497 lits->t_nsec = tv.tv_nsec; in xfs_inode_to_log_dinode_ts()
503 * The legacy DMAPI fields are only present in the on-disk and in-log inodes,
504 * but not in the in-memory one. But we are guaranteed to have an inode buffer
505 * in memory when logging an inode, so we can just copy it from the on-disk
506 * inode to the in-log inode here so that recovery of file system with these
507 * fields set to non-zero values doesn't lose them. For all other cases we zero
517 dip = xfs_buf_offset(ip->i_itemp->ili_item.li_buf, in xfs_copy_dm_fields_to_log_dinode()
518 ip->i_imap.im_boffset); in xfs_copy_dm_fields_to_log_dinode()
521 to->di_dmevmask = be32_to_cpu(dip->di_dmevmask); in xfs_copy_dm_fields_to_log_dinode()
522 to->di_dmstate = be16_to_cpu(dip->di_dmstate); in xfs_copy_dm_fields_to_log_dinode()
524 to->di_dmevmask = 0; in xfs_copy_dm_fields_to_log_dinode()
525 to->di_dmstate = 0; in xfs_copy_dm_fields_to_log_dinode()
535 to->di_big_nextents = xfs_ifork_nextents(&ip->i_df); in xfs_inode_to_log_dinode_iext_counters()
536 to->di_big_anextents = xfs_ifork_nextents(&ip->i_af); in xfs_inode_to_log_dinode_iext_counters()
537 to->di_nrext64_pad = 0; in xfs_inode_to_log_dinode_iext_counters()
539 to->di_nextents = xfs_ifork_nextents(&ip->i_df); in xfs_inode_to_log_dinode_iext_counters()
540 to->di_anextents = xfs_ifork_nextents(&ip->i_af); in xfs_inode_to_log_dinode_iext_counters()
552 to->di_magic = XFS_DINODE_MAGIC; in xfs_inode_to_log_dinode()
553 to->di_format = xfs_ifork_format(&ip->i_df); in xfs_inode_to_log_dinode()
554 to->di_uid = i_uid_read(inode); in xfs_inode_to_log_dinode()
555 to->di_gid = i_gid_read(inode); in xfs_inode_to_log_dinode()
556 to->di_projid_lo = ip->i_projid & 0xffff; in xfs_inode_to_log_dinode()
557 to->di_projid_hi = ip->i_projid >> 16; in xfs_inode_to_log_dinode()
559 memset(to->di_pad3, 0, sizeof(to->di_pad3)); in xfs_inode_to_log_dinode()
560 to->di_atime = xfs_inode_to_log_dinode_ts(ip, inode_get_atime(inode)); in xfs_inode_to_log_dinode()
561 to->di_mtime = xfs_inode_to_log_dinode_ts(ip, inode_get_mtime(inode)); in xfs_inode_to_log_dinode()
562 to->di_ctime = xfs_inode_to_log_dinode_ts(ip, inode_get_ctime(inode)); in xfs_inode_to_log_dinode()
563 to->di_nlink = inode->i_nlink; in xfs_inode_to_log_dinode()
564 to->di_gen = inode->i_generation; in xfs_inode_to_log_dinode()
565 to->di_mode = inode->i_mode; in xfs_inode_to_log_dinode()
567 to->di_size = ip->i_disk_size; in xfs_inode_to_log_dinode()
568 to->di_nblocks = ip->i_nblocks; in xfs_inode_to_log_dinode()
569 to->di_extsize = ip->i_extsize; in xfs_inode_to_log_dinode()
570 to->di_forkoff = ip->i_forkoff; in xfs_inode_to_log_dinode()
571 to->di_aformat = xfs_ifork_format(&ip->i_af); in xfs_inode_to_log_dinode()
572 to->di_flags = ip->i_diflags; in xfs_inode_to_log_dinode()
577 to->di_next_unlinked = NULLAGINO; in xfs_inode_to_log_dinode()
579 if (xfs_has_v3inodes(ip->i_mount)) { in xfs_inode_to_log_dinode()
580 to->di_version = 3; in xfs_inode_to_log_dinode()
581 to->di_changecount = inode_peek_iversion(inode); in xfs_inode_to_log_dinode()
582 to->di_crtime = xfs_inode_to_log_dinode_ts(ip, ip->i_crtime); in xfs_inode_to_log_dinode()
583 to->di_flags2 = ip->i_diflags2; in xfs_inode_to_log_dinode()
584 to->di_cowextsize = ip->i_cowextsize; in xfs_inode_to_log_dinode()
585 to->di_ino = ip->i_ino; in xfs_inode_to_log_dinode()
586 to->di_lsn = lsn; in xfs_inode_to_log_dinode()
587 memset(to->di_pad2, 0, sizeof(to->di_pad2)); in xfs_inode_to_log_dinode()
588 uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid); in xfs_inode_to_log_dinode()
589 to->di_v3_pad = 0; in xfs_inode_to_log_dinode()
592 to->di_crc = 0; in xfs_inode_to_log_dinode()
594 to->di_version = 2; in xfs_inode_to_log_dinode()
595 to->di_flushiter = ip->i_flushiter; in xfs_inode_to_log_dinode()
596 memset(to->di_v2_pad, 0, sizeof(to->di_v2_pad)); in xfs_inode_to_log_dinode()
616 xfs_inode_to_log_dinode(ip, dic, ip->i_itemp->ili_item.li_lsn); in xfs_inode_item_format_core()
617 xlog_finish_iovec(lv, *vecp, xfs_log_dinode_size(ip->i_mount)); in xfs_inode_item_format_core()
623 * the second with the on-disk inode structure, and a possible third and/or
624 * fourth with the inode data/extents/b-tree root and inode attributes
625 * data/extents/b-tree root.
638 struct xfs_inode *ip = iip->ili_inode; in xfs_inode_item_format()
643 ilf->ilf_type = XFS_LI_INODE; in xfs_inode_item_format()
644 ilf->ilf_ino = ip->i_ino; in xfs_inode_item_format()
645 ilf->ilf_blkno = ip->i_imap.im_blkno; in xfs_inode_item_format()
646 ilf->ilf_len = ip->i_imap.im_len; in xfs_inode_item_format()
647 ilf->ilf_boffset = ip->i_imap.im_boffset; in xfs_inode_item_format()
648 ilf->ilf_fields = XFS_ILOG_CORE; in xfs_inode_item_format()
649 ilf->ilf_size = 2; /* format + core */ in xfs_inode_item_format()
655 ilf->ilf_dsize = 0; in xfs_inode_item_format()
656 ilf->ilf_asize = 0; in xfs_inode_item_format()
657 ilf->ilf_pad = 0; in xfs_inode_item_format()
658 memset(&ilf->ilf_u, 0, sizeof(ilf->ilf_u)); in xfs_inode_item_format()
667 iip->ili_fields &= in xfs_inode_item_format()
672 ilf->ilf_fields |= (iip->ili_fields & ~XFS_ILOG_TIMESTAMP); in xfs_inode_item_format()
683 struct xfs_inode *ip = INODE_ITEM(lip)->ili_inode; in xfs_inode_item_pin()
686 ASSERT(lip->li_buf); in xfs_inode_item_pin()
689 atomic_inc(&ip->i_pincount); in xfs_inode_item_pin()
702 * will be no buffer attached to the log item, but the inode will be marked
710 struct xfs_inode *ip = INODE_ITEM(lip)->ili_inode; in xfs_inode_item_unpin()
713 ASSERT(lip->li_buf || xfs_iflags_test(ip, XFS_ISTALE)); in xfs_inode_item_unpin()
714 ASSERT(atomic_read(&ip->i_pincount) > 0); in xfs_inode_item_unpin()
715 if (atomic_dec_and_test(&ip->i_pincount)) in xfs_inode_item_unpin()
716 wake_up_bit(&ip->i_flags, __XFS_IPINNED_BIT); in xfs_inode_item_unpin()
723 __releases(&lip->li_ailp->ail_lock) in xfs_inode_item_push()
724 __acquires(&lip->li_ailp->ail_lock) in xfs_inode_item_push()
727 struct xfs_inode *ip = iip->ili_inode; in xfs_inode_item_push()
728 struct xfs_buf *bp = lip->li_buf; in xfs_inode_item_push()
732 if (!bp || (ip->i_flags & XFS_ISTALE)) { in xfs_inode_item_push()
751 spin_unlock(&lip->li_ailp->ail_lock); in xfs_inode_item_push()
770 if (error == -EAGAIN) in xfs_inode_item_push()
775 spin_lock(&lip->li_ailp->ail_lock); in xfs_inode_item_push()
787 struct xfs_inode *ip = iip->ili_inode; in xfs_inode_item_release()
790 ASSERT(ip->i_itemp != NULL); in xfs_inode_item_release()
793 lock_flags = iip->ili_lock_flags; in xfs_inode_item_release()
794 iip->ili_lock_flags = 0; in xfs_inode_item_release()
802 * at the given lsn. Since we always re-log all dirty data in an inode, the
807 * don't want to (re-)insert this inode into the AIL. There is a race condition
817 * To avoid this, just unpin the inode directly and return a LSN of -1 so the
827 struct xfs_inode *ip = iip->ili_inode; in xfs_inode_item_committed()
831 return -1; in xfs_inode_item_committed()
841 INODE_ITEM(lip)->ili_commit_seq = seq; in xfs_inode_item_committing()
860 * Initialize the inode log item for a newly allocated (in-core) inode.
869 ASSERT(ip->i_itemp == NULL); in xfs_inode_item_init()
870 iip = ip->i_itemp = kmem_cache_zalloc(xfs_ili_cache, in xfs_inode_item_init()
873 iip->ili_inode = ip; in xfs_inode_item_init()
874 spin_lock_init(&iip->ili_lock); in xfs_inode_item_init()
875 xfs_log_item_init(mp, &iip->ili_item, XFS_LI_INODE, in xfs_inode_item_init()
886 struct xfs_inode_log_item *iip = ip->i_itemp; in xfs_inode_item_destroy()
888 ASSERT(iip->ili_item.li_buf == NULL); in xfs_inode_item_destroy()
890 ip->i_itemp = NULL; in xfs_inode_item_destroy()
891 kvfree(iip->ili_item.li_lv_shadow); in xfs_inode_item_destroy()
910 spin_lock(&ailp->ail_lock); in xfs_iflush_ail_updates()
914 clear_bit(XFS_LI_FAILED, &lip->li_flags); in xfs_iflush_ail_updates()
915 if (INODE_ITEM(lip)->ili_flush_lsn != lip->li_lsn) in xfs_iflush_ail_updates()
924 if (!test_bit(XFS_LI_IN_AIL, &lip->li_flags)) { in xfs_iflush_ail_updates()
925 ASSERT(xlog_is_shutdown(lip->li_log)); in xfs_iflush_ail_updates()
953 spin_lock(&iip->ili_lock); in xfs_iflush_finish()
960 ASSERT(iip->ili_item.li_buf == bp); in xfs_iflush_finish()
961 if (!iip->ili_fields) { in xfs_iflush_finish()
962 iip->ili_item.li_buf = NULL; in xfs_iflush_finish()
963 list_del_init(&lip->li_bio_list); in xfs_iflush_finish()
966 iip->ili_last_fields = 0; in xfs_iflush_finish()
967 iip->ili_flush_lsn = 0; in xfs_iflush_finish()
968 clear_bit(XFS_LI_FLUSHING, &lip->li_flags); in xfs_iflush_finish()
969 spin_unlock(&iip->ili_lock); in xfs_iflush_finish()
970 xfs_iflags_clear(iip->ili_inode, XFS_IFLUSHING); in xfs_iflush_finish()
978 * attached to the buffer from the AIL if they have not been re-logged and
990 * Pull the attached inodes from the buffer one at a time and take the in xfs_buf_inode_iodone()
993 list_for_each_entry_safe(lip, n, &bp->b_li_list, li_bio_list) { in xfs_buf_inode_iodone()
996 if (xfs_iflags_test(iip->ili_inode, XFS_ISTALE)) { in xfs_buf_inode_iodone()
997 xfs_iflush_abort(iip->ili_inode); in xfs_buf_inode_iodone()
1000 if (!iip->ili_last_fields) in xfs_buf_inode_iodone()
1004 if (iip->ili_flush_lsn == lip->li_lsn || in xfs_buf_inode_iodone()
1005 test_bit(XFS_LI_FAILED, &lip->li_flags)) in xfs_buf_inode_iodone()
1006 list_move_tail(&lip->li_bio_list, &ail_updates); in xfs_buf_inode_iodone()
1008 list_move_tail(&lip->li_bio_list, &flushed_inodes); in xfs_buf_inode_iodone()
1012 xfs_iflush_ail_updates(bp->b_mount->m_ail, &ail_updates); in xfs_buf_inode_iodone()
1018 list_splice_tail(&flushed_inodes, &bp->b_li_list); in xfs_buf_inode_iodone()
1027 list_for_each_entry(lip, &bp->b_li_list, li_bio_list) { in xfs_buf_inode_io_fail()
1028 set_bit(XFS_LI_FAILED, &lip->li_flags); in xfs_buf_inode_io_fail()
1029 clear_bit(XFS_LI_FLUSHING, &lip->li_flags); in xfs_buf_inode_io_fail()
1043 iip->ili_last_fields = 0; in xfs_iflush_abort_clean()
1044 iip->ili_fields = 0; in xfs_iflush_abort_clean()
1045 iip->ili_fsync_fields = 0; in xfs_iflush_abort_clean()
1046 iip->ili_flush_lsn = 0; in xfs_iflush_abort_clean()
1047 iip->ili_item.li_buf = NULL; in xfs_iflush_abort_clean()
1048 list_del_init(&iip->ili_item.li_bio_list); in xfs_iflush_abort_clean()
1049 clear_bit(XFS_LI_FLUSHING, &iip->ili_item.li_flags); in xfs_iflush_abort_clean()
1056 * attached to a cluster buffer. It occurs when the inode and the backing
1068 struct xfs_inode_log_item *iip = ip->i_itemp; in xfs_iflush_abort()
1080 * pointer for push operations to access - it is only safe to remove the in xfs_iflush_abort()
1084 * as xfs_trans_ail_delete()->xfs_clear_li_failed() will release buffer in xfs_iflush_abort()
1088 clear_bit(XFS_LI_FAILED, &iip->ili_item.li_flags); in xfs_iflush_abort()
1089 xfs_trans_ail_delete(&iip->ili_item, 0); in xfs_iflush_abort()
1095 spin_lock(&iip->ili_lock); in xfs_iflush_abort()
1096 bp = iip->ili_item.li_buf; in xfs_iflush_abort()
1098 spin_unlock(&iip->ili_lock); in xfs_iflush_abort()
1108 * inode cluster buffer locked. If the inode is attached to a cluster buffer,
1115 struct xfs_inode_log_item *iip = ip->i_itemp; in xfs_iflush_shutdown_abort()
1124 spin_lock(&iip->ili_lock); in xfs_iflush_shutdown_abort()
1125 bp = iip->ili_item.li_buf; in xfs_iflush_shutdown_abort()
1127 spin_unlock(&iip->ili_lock); in xfs_iflush_shutdown_abort()
1139 spin_unlock(&iip->ili_lock); in xfs_iflush_shutdown_abort()
1142 spin_lock(&iip->ili_lock); in xfs_iflush_shutdown_abort()
1143 if (!iip->ili_item.li_buf) { in xfs_iflush_shutdown_abort()
1149 ASSERT(list_empty(&iip->ili_item.li_bio_list)); in xfs_iflush_shutdown_abort()
1150 ASSERT(!test_bit(XFS_LI_IN_AIL, &iip->ili_item.li_flags)); in xfs_iflush_shutdown_abort()
1152 spin_unlock(&iip->ili_lock); in xfs_iflush_shutdown_abort()
1165 ASSERT(iip->ili_item.li_buf == bp); in xfs_iflush_shutdown_abort()
1166 spin_unlock(&iip->ili_lock); in xfs_iflush_shutdown_abort()
1181 struct xfs_inode_log_format_32 *in_f32 = buf->i_addr; in xfs_inode_item_format_convert()
1183 if (buf->i_len != sizeof(*in_f32)) { in xfs_inode_item_format_convert()
1185 return -EFSCORRUPTED; in xfs_inode_item_format_convert()
1188 in_f->ilf_type = in_f32->ilf_type; in xfs_inode_item_format_convert()
1189 in_f->ilf_size = in_f32->ilf_size; in xfs_inode_item_format_convert()
1190 in_f->ilf_fields = in_f32->ilf_fields; in xfs_inode_item_format_convert()
1191 in_f->ilf_asize = in_f32->ilf_asize; in xfs_inode_item_format_convert()
1192 in_f->ilf_dsize = in_f32->ilf_dsize; in xfs_inode_item_format_convert()
1193 in_f->ilf_ino = in_f32->ilf_ino; in xfs_inode_item_format_convert()
1194 memcpy(&in_f->ilf_u, &in_f32->ilf_u, sizeof(in_f->ilf_u)); in xfs_inode_item_format_convert()
1195 in_f->ilf_blkno = in_f32->ilf_blkno; in xfs_inode_item_format_convert()
1196 in_f->ilf_len = in_f32->ilf_len; in xfs_inode_item_format_convert()
1197 in_f->ilf_boffset = in_f32->ilf_boffset; in xfs_inode_item_format_convert()