Lines Matching +full:re +full:- +full:attached
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc.
37 list_for_each_entry(lip, &tp->t_items, li_trans) { in xfs_trans_buf_item_match()
39 if (blip->bli_item.li_type == XFS_LI_BUF && in xfs_trans_buf_item_match()
40 blip->bli_buf->b_target == target && in xfs_trans_buf_item_match()
41 xfs_buf_daddr(blip->bli_buf) == map[0].bm_bn && in xfs_trans_buf_item_match()
42 blip->bli_buf->b_length == len) { in xfs_trans_buf_item_match()
43 ASSERT(blip->bli_buf->b_map_count == nmaps); in xfs_trans_buf_item_match()
44 return blip->bli_buf; in xfs_trans_buf_item_match()
68 ASSERT(bp->b_transp == NULL); in _xfs_trans_bjoin()
75 xfs_buf_item_init(bp, tp->t_mountp); in _xfs_trans_bjoin()
76 bip = bp->b_log_item; in _xfs_trans_bjoin()
77 ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); in _xfs_trans_bjoin()
78 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_CANCEL)); in _xfs_trans_bjoin()
79 ASSERT(!(bip->bli_flags & XFS_BLI_LOGGED)); in _xfs_trans_bjoin()
81 bip->bli_recur = 0; in _xfs_trans_bjoin()
86 atomic_inc(&bip->bli_refcount); in _xfs_trans_bjoin()
92 xfs_trans_add_item(tp, &bip->bli_item); in _xfs_trans_bjoin()
93 bp->b_transp = tp; in _xfs_trans_bjoin()
103 trace_xfs_trans_bjoin(bp->b_log_item); in xfs_trans_bjoin()
141 if (xfs_is_shutdown(tp->t_mountp)) { in xfs_trans_get_buf_map()
143 bp->b_flags |= XBF_DONE; in xfs_trans_get_buf_map()
146 ASSERT(bp->b_transp == tp); in xfs_trans_get_buf_map()
147 bip = bp->b_log_item; in xfs_trans_get_buf_map()
149 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_get_buf_map()
150 bip->bli_recur++; in xfs_trans_get_buf_map()
160 ASSERT(!bp->b_error); in xfs_trans_get_buf_map()
163 trace_xfs_trans_get_buf(bp->b_log_item); in xfs_trans_get_buf_map()
175 struct xfs_buf *bp = tp->t_mountp->m_sb_bp; in xfs_trans_getsb()
179 * attached to this transaction. in xfs_trans_getsb()
181 if (bp->b_transp == tp) { in xfs_trans_getsb()
182 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_getsb()
185 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_getsb()
186 bip->bli_recur++; in xfs_trans_getsb()
194 trace_xfs_trans_getsb(bp->b_log_item); in xfs_trans_getsb()
238 ASSERT(bp->b_transp == tp); in xfs_trans_read_buf_map()
239 ASSERT(bp->b_log_item != NULL); in xfs_trans_read_buf_map()
240 ASSERT(!bp->b_error); in xfs_trans_read_buf_map()
241 ASSERT(bp->b_flags & XBF_DONE); in xfs_trans_read_buf_map()
249 return -EIO; in xfs_trans_read_buf_map()
254 * already attached to the transaction yet has no buffer ops in xfs_trans_read_buf_map()
255 * assigned. Ops are usually attached when the buffer is in xfs_trans_read_buf_map()
256 * attached to the transaction, or by the read caller if in xfs_trans_read_buf_map()
264 ASSERT(bp->b_ops != NULL); in xfs_trans_read_buf_map()
269 if (tp->t_flags & XFS_TRANS_DIRTY) in xfs_trans_read_buf_map()
270 xfs_force_shutdown(tp->t_mountp, in xfs_trans_read_buf_map()
274 if (error == -EFSBADCRC) in xfs_trans_read_buf_map()
275 error = -EFSCORRUPTED; in xfs_trans_read_buf_map()
279 bip = bp->b_log_item; in xfs_trans_read_buf_map()
280 bip->bli_recur++; in xfs_trans_read_buf_map()
282 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_read_buf_map()
284 ASSERT(bp->b_ops != NULL || ops == NULL); in xfs_trans_read_buf_map()
295 if (tp && (tp->t_flags & XFS_TRANS_DIRTY)) in xfs_trans_read_buf_map()
296 xfs_force_shutdown(tp->t_mountp, SHUTDOWN_META_IO_ERROR); in xfs_trans_read_buf_map()
298 case -ENOMEM: in xfs_trans_read_buf_map()
299 case -EAGAIN: in xfs_trans_read_buf_map()
306 return -EIO; in xfs_trans_read_buf_map()
311 trace_xfs_trans_read_buf(bp->b_log_item); in xfs_trans_read_buf_map()
313 ASSERT(bp->b_ops != NULL || ops == NULL); in xfs_trans_read_buf_map()
324 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_buf_is_dirty()
328 ASSERT(bip->bli_item.li_type == XFS_LI_BUF); in xfs_trans_buf_is_dirty()
329 return test_bit(XFS_LI_DIRTY, &bip->bli_item.li_flags); in xfs_trans_buf_is_dirty()
349 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_brelse()
351 ASSERT(bp->b_transp == tp); in xfs_trans_brelse()
359 ASSERT(bip->bli_item.li_type == XFS_LI_BUF); in xfs_trans_brelse()
360 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_brelse()
366 if (bip->bli_recur > 0) { in xfs_trans_brelse()
367 bip->bli_recur--; in xfs_trans_brelse()
375 if (test_bit(XFS_LI_DIRTY, &bip->bli_item.li_flags)) in xfs_trans_brelse()
377 if (bip->bli_flags & XFS_BLI_STALE) in xfs_trans_brelse()
384 ASSERT(!(bip->bli_flags & XFS_BLI_LOGGED)); in xfs_trans_brelse()
385 xfs_trans_del_item(&bip->bli_item); in xfs_trans_brelse()
386 bip->bli_flags &= ~XFS_BLI_HOLD; in xfs_trans_brelse()
391 bp->b_transp = NULL; in xfs_trans_brelse()
405 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_bdetach()
408 ASSERT(bp->b_transp == tp); in xfs_trans_bdetach()
409 ASSERT(bip->bli_item.li_type == XFS_LI_BUF); in xfs_trans_bdetach()
410 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_bdetach()
415 * Erase all recursion count, since we're removing this buffer from the in xfs_trans_bdetach()
418 bip->bli_recur = 0; in xfs_trans_bdetach()
424 ASSERT(!test_bit(XFS_LI_DIRTY, &bip->bli_item.li_flags)); in xfs_trans_bdetach()
425 ASSERT(!(bip->bli_flags & XFS_BLI_DIRTY)); in xfs_trans_bdetach()
426 ASSERT(!(bip->bli_flags & XFS_BLI_HOLD)); in xfs_trans_bdetach()
427 ASSERT(!(bip->bli_flags & XFS_BLI_LOGGED)); in xfs_trans_bdetach()
428 ASSERT(!(bip->bli_flags & XFS_BLI_ORDERED)); in xfs_trans_bdetach()
429 ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); in xfs_trans_bdetach()
432 xfs_trans_del_item(&bip->bli_item); in xfs_trans_bdetach()
434 bp->b_transp = NULL; in xfs_trans_bdetach()
448 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_bhold()
450 ASSERT(bp->b_transp == tp); in xfs_trans_bhold()
452 ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); in xfs_trans_bhold()
453 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_CANCEL)); in xfs_trans_bhold()
454 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_bhold()
456 bip->bli_flags |= XFS_BLI_HOLD; in xfs_trans_bhold()
469 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_bhold_release()
471 ASSERT(bp->b_transp == tp); in xfs_trans_bhold_release()
473 ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); in xfs_trans_bhold_release()
474 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_CANCEL)); in xfs_trans_bhold_release()
475 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_bhold_release()
476 ASSERT(bip->bli_flags & XFS_BLI_HOLD); in xfs_trans_bhold_release()
478 bip->bli_flags &= ~XFS_BLI_HOLD; in xfs_trans_bhold_release()
490 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_dirty_buf()
492 ASSERT(bp->b_transp == tp); in xfs_trans_dirty_buf()
501 bp->b_flags |= XBF_DONE; in xfs_trans_dirty_buf()
503 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_dirty_buf()
507 * cancel the invalidation now that we're dirtying the buffer in xfs_trans_dirty_buf()
511 if (bip->bli_flags & XFS_BLI_STALE) { in xfs_trans_dirty_buf()
512 bip->bli_flags &= ~XFS_BLI_STALE; in xfs_trans_dirty_buf()
513 ASSERT(bp->b_flags & XBF_STALE); in xfs_trans_dirty_buf()
514 bp->b_flags &= ~XBF_STALE; in xfs_trans_dirty_buf()
515 bip->__bli_format.blf_flags &= ~XFS_BLF_CANCEL; in xfs_trans_dirty_buf()
517 bip->bli_flags |= XFS_BLI_DIRTY | XFS_BLI_LOGGED; in xfs_trans_dirty_buf()
519 tp->t_flags |= XFS_TRANS_DIRTY; in xfs_trans_dirty_buf()
520 set_bit(XFS_LI_DIRTY, &bip->bli_item.li_flags); in xfs_trans_dirty_buf()
539 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_log_buf()
541 ASSERT(first <= last && last < BBTOB(bp->b_length)); in xfs_trans_log_buf()
542 ASSERT(!(bip->bli_flags & XFS_BLI_ORDERED)); in xfs_trans_log_buf()
555 * need to prevent it from being written out when we're done. Allowing it
573 * Since we're invalidating the buffer, we also clear the state about which
578 * We set the stale bit in the buffer as well since we're getting rid of it.
585 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_binval()
588 ASSERT(bp->b_transp == tp); in xfs_trans_binval()
590 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_binval()
594 if (bip->bli_flags & XFS_BLI_STALE) { in xfs_trans_binval()
599 ASSERT(bp->b_flags & XBF_STALE); in xfs_trans_binval()
600 ASSERT(!(bip->bli_flags & (XFS_BLI_LOGGED | XFS_BLI_DIRTY))); in xfs_trans_binval()
601 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLF_INODE_BUF)); in xfs_trans_binval()
602 ASSERT(!(bip->__bli_format.blf_flags & XFS_BLFT_MASK)); in xfs_trans_binval()
603 ASSERT(bip->__bli_format.blf_flags & XFS_BLF_CANCEL); in xfs_trans_binval()
604 ASSERT(test_bit(XFS_LI_DIRTY, &bip->bli_item.li_flags)); in xfs_trans_binval()
605 ASSERT(tp->t_flags & XFS_TRANS_DIRTY); in xfs_trans_binval()
611 bip->bli_flags |= XFS_BLI_STALE; in xfs_trans_binval()
612 bip->bli_flags &= ~(XFS_BLI_INODE_BUF | XFS_BLI_LOGGED | XFS_BLI_DIRTY); in xfs_trans_binval()
613 bip->__bli_format.blf_flags &= ~XFS_BLF_INODE_BUF; in xfs_trans_binval()
614 bip->__bli_format.blf_flags |= XFS_BLF_CANCEL; in xfs_trans_binval()
615 bip->__bli_format.blf_flags &= ~XFS_BLFT_MASK; in xfs_trans_binval()
616 for (i = 0; i < bip->bli_format_count; i++) { in xfs_trans_binval()
617 memset(bip->bli_formats[i].blf_data_map, 0, in xfs_trans_binval()
618 (bip->bli_formats[i].blf_map_size * sizeof(uint))); in xfs_trans_binval()
620 set_bit(XFS_LI_DIRTY, &bip->bli_item.li_flags); in xfs_trans_binval()
621 tp->t_flags |= XFS_TRANS_DIRTY; in xfs_trans_binval()
625 * This call is used to indicate that the buffer contains on-disk inodes which
640 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_inode_buf()
642 ASSERT(bp->b_transp == tp); in xfs_trans_inode_buf()
644 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_inode_buf()
646 bip->bli_flags |= XFS_BLI_INODE_BUF; in xfs_trans_inode_buf()
647 bp->b_flags |= _XBF_INODES; in xfs_trans_inode_buf()
654 * special processing during unpin - where any inodes
665 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_stale_inode_buf()
667 ASSERT(bp->b_transp == tp); in xfs_trans_stale_inode_buf()
669 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_stale_inode_buf()
671 bip->bli_flags |= XFS_BLI_STALE_INODE; in xfs_trans_stale_inode_buf()
672 bp->b_flags |= _XBF_INODES; in xfs_trans_stale_inode_buf()
690 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_inode_alloc_buf()
692 ASSERT(bp->b_transp == tp); in xfs_trans_inode_alloc_buf()
694 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_inode_alloc_buf()
696 bip->bli_flags |= XFS_BLI_INODE_ALLOC_BUF; in xfs_trans_inode_alloc_buf()
697 bp->b_flags |= _XBF_INODES; in xfs_trans_inode_alloc_buf()
713 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_ordered_buf()
715 ASSERT(bp->b_transp == tp); in xfs_trans_ordered_buf()
717 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_ordered_buf()
722 bip->bli_flags |= XFS_BLI_ORDERED; in xfs_trans_ordered_buf()
743 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_buf_set_type()
748 ASSERT(bp->b_transp == tp); in xfs_trans_buf_set_type()
750 ASSERT(atomic_read(&bip->bli_refcount) > 0); in xfs_trans_buf_set_type()
752 xfs_blft_to_flags(&bip->__bli_format, type); in xfs_trans_buf_set_type()
760 struct xfs_buf_log_item *sbip = src_bp->b_log_item; in xfs_trans_buf_copy_type()
761 struct xfs_buf_log_item *dbip = dst_bp->b_log_item; in xfs_trans_buf_copy_type()
764 type = xfs_blft_from_flags(&sbip->__bli_format); in xfs_trans_buf_copy_type()
765 xfs_blft_to_flags(&dbip->__bli_format, type); in xfs_trans_buf_copy_type()
785 struct xfs_buf_log_item *bip = bp->b_log_item; in xfs_trans_dquot_buf()
791 bip->__bli_format.blf_flags |= type; in xfs_trans_dquot_buf()
808 bp->b_flags |= _XBF_DQUOTS; in xfs_trans_dquot_buf()