diff options
Diffstat (limited to 'fs/xfs/xfs_buf_item.c')
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 228 |
1 files changed, 104 insertions, 124 deletions
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 02a80984aa05..1b09d7a280df 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include "xfs_trans.h" | 24 | #include "xfs_trans.h" |
25 | #include "xfs_sb.h" | 25 | #include "xfs_sb.h" |
26 | #include "xfs_ag.h" | 26 | #include "xfs_ag.h" |
27 | #include "xfs_dmapi.h" | ||
28 | #include "xfs_mount.h" | 27 | #include "xfs_mount.h" |
29 | #include "xfs_buf_item.h" | 28 | #include "xfs_buf_item.h" |
30 | #include "xfs_trans_priv.h" | 29 | #include "xfs_trans_priv.h" |
@@ -34,6 +33,12 @@ | |||
34 | 33 | ||
35 | kmem_zone_t *xfs_buf_item_zone; | 34 | kmem_zone_t *xfs_buf_item_zone; |
36 | 35 | ||
36 | static inline struct xfs_buf_log_item *BUF_ITEM(struct xfs_log_item *lip) | ||
37 | { | ||
38 | return container_of(lip, struct xfs_buf_log_item, bli_item); | ||
39 | } | ||
40 | |||
41 | |||
37 | #ifdef XFS_TRANS_DEBUG | 42 | #ifdef XFS_TRANS_DEBUG |
38 | /* | 43 | /* |
39 | * This function uses an alternate strategy for tracking the bytes | 44 | * This function uses an alternate strategy for tracking the bytes |
@@ -151,12 +156,13 @@ STATIC void xfs_buf_do_callbacks(xfs_buf_t *bp, xfs_log_item_t *lip); | |||
151 | */ | 156 | */ |
152 | STATIC uint | 157 | STATIC uint |
153 | xfs_buf_item_size( | 158 | xfs_buf_item_size( |
154 | xfs_buf_log_item_t *bip) | 159 | struct xfs_log_item *lip) |
155 | { | 160 | { |
156 | uint nvecs; | 161 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); |
157 | int next_bit; | 162 | struct xfs_buf *bp = bip->bli_buf; |
158 | int last_bit; | 163 | uint nvecs; |
159 | xfs_buf_t *bp; | 164 | int next_bit; |
165 | int last_bit; | ||
160 | 166 | ||
161 | ASSERT(atomic_read(&bip->bli_refcount) > 0); | 167 | ASSERT(atomic_read(&bip->bli_refcount) > 0); |
162 | if (bip->bli_flags & XFS_BLI_STALE) { | 168 | if (bip->bli_flags & XFS_BLI_STALE) { |
@@ -170,7 +176,6 @@ xfs_buf_item_size( | |||
170 | return 1; | 176 | return 1; |
171 | } | 177 | } |
172 | 178 | ||
173 | bp = bip->bli_buf; | ||
174 | ASSERT(bip->bli_flags & XFS_BLI_LOGGED); | 179 | ASSERT(bip->bli_flags & XFS_BLI_LOGGED); |
175 | nvecs = 1; | 180 | nvecs = 1; |
176 | last_bit = xfs_next_bit(bip->bli_format.blf_data_map, | 181 | last_bit = xfs_next_bit(bip->bli_format.blf_data_map, |
@@ -219,13 +224,13 @@ xfs_buf_item_size( | |||
219 | */ | 224 | */ |
220 | STATIC void | 225 | STATIC void |
221 | xfs_buf_item_format( | 226 | xfs_buf_item_format( |
222 | xfs_buf_log_item_t *bip, | 227 | struct xfs_log_item *lip, |
223 | xfs_log_iovec_t *log_vector) | 228 | struct xfs_log_iovec *vecp) |
224 | { | 229 | { |
230 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); | ||
231 | struct xfs_buf *bp = bip->bli_buf; | ||
225 | uint base_size; | 232 | uint base_size; |
226 | uint nvecs; | 233 | uint nvecs; |
227 | xfs_log_iovec_t *vecp; | ||
228 | xfs_buf_t *bp; | ||
229 | int first_bit; | 234 | int first_bit; |
230 | int last_bit; | 235 | int last_bit; |
231 | int next_bit; | 236 | int next_bit; |
@@ -235,8 +240,6 @@ xfs_buf_item_format( | |||
235 | ASSERT(atomic_read(&bip->bli_refcount) > 0); | 240 | ASSERT(atomic_read(&bip->bli_refcount) > 0); |
236 | ASSERT((bip->bli_flags & XFS_BLI_LOGGED) || | 241 | ASSERT((bip->bli_flags & XFS_BLI_LOGGED) || |
237 | (bip->bli_flags & XFS_BLI_STALE)); | 242 | (bip->bli_flags & XFS_BLI_STALE)); |
238 | bp = bip->bli_buf; | ||
239 | vecp = log_vector; | ||
240 | 243 | ||
241 | /* | 244 | /* |
242 | * The size of the base structure is the size of the | 245 | * The size of the base structure is the size of the |
@@ -248,7 +251,7 @@ xfs_buf_item_format( | |||
248 | base_size = | 251 | base_size = |
249 | (uint)(sizeof(xfs_buf_log_format_t) + | 252 | (uint)(sizeof(xfs_buf_log_format_t) + |
250 | ((bip->bli_format.blf_map_size - 1) * sizeof(uint))); | 253 | ((bip->bli_format.blf_map_size - 1) * sizeof(uint))); |
251 | vecp->i_addr = (xfs_caddr_t)&bip->bli_format; | 254 | vecp->i_addr = &bip->bli_format; |
252 | vecp->i_len = base_size; | 255 | vecp->i_len = base_size; |
253 | vecp->i_type = XLOG_REG_TYPE_BFORMAT; | 256 | vecp->i_type = XLOG_REG_TYPE_BFORMAT; |
254 | vecp++; | 257 | vecp++; |
@@ -263,7 +266,7 @@ xfs_buf_item_format( | |||
263 | */ | 266 | */ |
264 | if (bip->bli_flags & XFS_BLI_INODE_BUF) { | 267 | if (bip->bli_flags & XFS_BLI_INODE_BUF) { |
265 | if (!((bip->bli_flags & XFS_BLI_INODE_ALLOC_BUF) && | 268 | if (!((bip->bli_flags & XFS_BLI_INODE_ALLOC_BUF) && |
266 | xfs_log_item_in_current_chkpt(&bip->bli_item))) | 269 | xfs_log_item_in_current_chkpt(lip))) |
267 | bip->bli_format.blf_flags |= XFS_BLF_INODE_BUF; | 270 | bip->bli_format.blf_flags |= XFS_BLF_INODE_BUF; |
268 | bip->bli_flags &= ~XFS_BLI_INODE_BUF; | 271 | bip->bli_flags &= ~XFS_BLI_INODE_BUF; |
269 | } | 272 | } |
@@ -356,66 +359,90 @@ xfs_buf_item_format( | |||
356 | 359 | ||
357 | /* | 360 | /* |
358 | * This is called to pin the buffer associated with the buf log item in memory | 361 | * This is called to pin the buffer associated with the buf log item in memory |
359 | * so it cannot be written out. Simply call bpin() on the buffer to do this. | 362 | * so it cannot be written out. |
360 | * | 363 | * |
361 | * We also always take a reference to the buffer log item here so that the bli | 364 | * We also always take a reference to the buffer log item here so that the bli |
362 | * is held while the item is pinned in memory. This means that we can | 365 | * is held while the item is pinned in memory. This means that we can |
363 | * unconditionally drop the reference count a transaction holds when the | 366 | * unconditionally drop the reference count a transaction holds when the |
364 | * transaction is completed. | 367 | * transaction is completed. |
365 | */ | 368 | */ |
366 | |||
367 | STATIC void | 369 | STATIC void |
368 | xfs_buf_item_pin( | 370 | xfs_buf_item_pin( |
369 | xfs_buf_log_item_t *bip) | 371 | struct xfs_log_item *lip) |
370 | { | 372 | { |
371 | xfs_buf_t *bp; | 373 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); |
372 | 374 | ||
373 | bp = bip->bli_buf; | 375 | ASSERT(XFS_BUF_ISBUSY(bip->bli_buf)); |
374 | ASSERT(XFS_BUF_ISBUSY(bp)); | ||
375 | ASSERT(atomic_read(&bip->bli_refcount) > 0); | 376 | ASSERT(atomic_read(&bip->bli_refcount) > 0); |
376 | ASSERT((bip->bli_flags & XFS_BLI_LOGGED) || | 377 | ASSERT((bip->bli_flags & XFS_BLI_LOGGED) || |
377 | (bip->bli_flags & XFS_BLI_STALE)); | 378 | (bip->bli_flags & XFS_BLI_STALE)); |
378 | atomic_inc(&bip->bli_refcount); | 379 | |
379 | trace_xfs_buf_item_pin(bip); | 380 | trace_xfs_buf_item_pin(bip); |
380 | xfs_bpin(bp); | ||
381 | } | ||
382 | 381 | ||
382 | atomic_inc(&bip->bli_refcount); | ||
383 | atomic_inc(&bip->bli_buf->b_pin_count); | ||
384 | } | ||
383 | 385 | ||
384 | /* | 386 | /* |
385 | * This is called to unpin the buffer associated with the buf log | 387 | * This is called to unpin the buffer associated with the buf log |
386 | * item which was previously pinned with a call to xfs_buf_item_pin(). | 388 | * item which was previously pinned with a call to xfs_buf_item_pin(). |
387 | * Just call bunpin() on the buffer to do this. | ||
388 | * | 389 | * |
389 | * Also drop the reference to the buf item for the current transaction. | 390 | * Also drop the reference to the buf item for the current transaction. |
390 | * If the XFS_BLI_STALE flag is set and we are the last reference, | 391 | * If the XFS_BLI_STALE flag is set and we are the last reference, |
391 | * then free up the buf log item and unlock the buffer. | 392 | * then free up the buf log item and unlock the buffer. |
393 | * | ||
394 | * If the remove flag is set we are called from uncommit in the | ||
395 | * forced-shutdown path. If that is true and the reference count on | ||
396 | * the log item is going to drop to zero we need to free the item's | ||
397 | * descriptor in the transaction. | ||
392 | */ | 398 | */ |
393 | STATIC void | 399 | STATIC void |
394 | xfs_buf_item_unpin( | 400 | xfs_buf_item_unpin( |
395 | xfs_buf_log_item_t *bip) | 401 | struct xfs_log_item *lip, |
402 | int remove) | ||
396 | { | 403 | { |
397 | struct xfs_ail *ailp; | 404 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); |
398 | xfs_buf_t *bp; | 405 | xfs_buf_t *bp = bip->bli_buf; |
399 | int freed; | 406 | struct xfs_ail *ailp = lip->li_ailp; |
400 | int stale = bip->bli_flags & XFS_BLI_STALE; | 407 | int stale = bip->bli_flags & XFS_BLI_STALE; |
408 | int freed; | ||
401 | 409 | ||
402 | bp = bip->bli_buf; | ||
403 | ASSERT(bp != NULL); | ||
404 | ASSERT(XFS_BUF_FSPRIVATE(bp, xfs_buf_log_item_t *) == bip); | 410 | ASSERT(XFS_BUF_FSPRIVATE(bp, xfs_buf_log_item_t *) == bip); |
405 | ASSERT(atomic_read(&bip->bli_refcount) > 0); | 411 | ASSERT(atomic_read(&bip->bli_refcount) > 0); |
412 | |||
406 | trace_xfs_buf_item_unpin(bip); | 413 | trace_xfs_buf_item_unpin(bip); |
407 | 414 | ||
408 | freed = atomic_dec_and_test(&bip->bli_refcount); | 415 | freed = atomic_dec_and_test(&bip->bli_refcount); |
409 | ailp = bip->bli_item.li_ailp; | 416 | |
410 | xfs_bunpin(bp); | 417 | if (atomic_dec_and_test(&bp->b_pin_count)) |
418 | wake_up_all(&bp->b_waiters); | ||
419 | |||
411 | if (freed && stale) { | 420 | if (freed && stale) { |
412 | ASSERT(bip->bli_flags & XFS_BLI_STALE); | 421 | ASSERT(bip->bli_flags & XFS_BLI_STALE); |
413 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); | 422 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); |
414 | ASSERT(!(XFS_BUF_ISDELAYWRITE(bp))); | 423 | ASSERT(!(XFS_BUF_ISDELAYWRITE(bp))); |
415 | ASSERT(XFS_BUF_ISSTALE(bp)); | 424 | ASSERT(XFS_BUF_ISSTALE(bp)); |
416 | ASSERT(bip->bli_format.blf_flags & XFS_BLF_CANCEL); | 425 | ASSERT(bip->bli_format.blf_flags & XFS_BLF_CANCEL); |
426 | |||
417 | trace_xfs_buf_item_unpin_stale(bip); | 427 | trace_xfs_buf_item_unpin_stale(bip); |
418 | 428 | ||
429 | if (remove) { | ||
430 | /* | ||
431 | * We have to remove the log item from the transaction | ||
432 | * as we are about to release our reference to the | ||
433 | * buffer. If we don't, the unlock that occurs later | ||
434 | * in xfs_trans_uncommit() will ry to reference the | ||
435 | * buffer which we no longer have a hold on. | ||
436 | */ | ||
437 | xfs_trans_del_item(lip); | ||
438 | |||
439 | /* | ||
440 | * Since the transaction no longer refers to the buffer, | ||
441 | * the buffer should no longer refer to the transaction. | ||
442 | */ | ||
443 | XFS_BUF_SET_FSPRIVATE2(bp, NULL); | ||
444 | } | ||
445 | |||
419 | /* | 446 | /* |
420 | * If we get called here because of an IO error, we may | 447 | * If we get called here because of an IO error, we may |
421 | * or may not have the item on the AIL. xfs_trans_ail_delete() | 448 | * or may not have the item on the AIL. xfs_trans_ail_delete() |
@@ -437,48 +464,6 @@ xfs_buf_item_unpin( | |||
437 | } | 464 | } |
438 | 465 | ||
439 | /* | 466 | /* |
440 | * this is called from uncommit in the forced-shutdown path. | ||
441 | * we need to check to see if the reference count on the log item | ||
442 | * is going to drop to zero. If so, unpin will free the log item | ||
443 | * so we need to free the item's descriptor (that points to the item) | ||
444 | * in the transaction. | ||
445 | */ | ||
446 | STATIC void | ||
447 | xfs_buf_item_unpin_remove( | ||
448 | xfs_buf_log_item_t *bip, | ||
449 | xfs_trans_t *tp) | ||
450 | { | ||
451 | /* will xfs_buf_item_unpin() call xfs_buf_item_relse()? */ | ||
452 | if ((atomic_read(&bip->bli_refcount) == 1) && | ||
453 | (bip->bli_flags & XFS_BLI_STALE)) { | ||
454 | /* | ||
455 | * yes -- We can safely do some work here and then call | ||
456 | * buf_item_unpin to do the rest because we are | ||
457 | * are holding the buffer locked so no one else will be | ||
458 | * able to bump up the refcount. We have to remove the | ||
459 | * log item from the transaction as we are about to release | ||
460 | * our reference to the buffer. If we don't, the unlock that | ||
461 | * occurs later in the xfs_trans_uncommit() will try to | ||
462 | * reference the buffer which we no longer have a hold on. | ||
463 | */ | ||
464 | struct xfs_log_item_desc *lidp; | ||
465 | |||
466 | ASSERT(XFS_BUF_VALUSEMA(bip->bli_buf) <= 0); | ||
467 | trace_xfs_buf_item_unpin_stale(bip); | ||
468 | |||
469 | lidp = xfs_trans_find_item(tp, (xfs_log_item_t *)bip); | ||
470 | xfs_trans_free_item(tp, lidp); | ||
471 | |||
472 | /* | ||
473 | * Since the transaction no longer refers to the buffer, the | ||
474 | * buffer should no longer refer to the transaction. | ||
475 | */ | ||
476 | XFS_BUF_SET_FSPRIVATE2(bip->bli_buf, NULL); | ||
477 | } | ||
478 | xfs_buf_item_unpin(bip); | ||
479 | } | ||
480 | |||
481 | /* | ||
482 | * This is called to attempt to lock the buffer associated with this | 467 | * This is called to attempt to lock the buffer associated with this |
483 | * buf log item. Don't sleep on the buffer lock. If we can't get | 468 | * buf log item. Don't sleep on the buffer lock. If we can't get |
484 | * the lock right away, return 0. If we can get the lock, take a | 469 | * the lock right away, return 0. If we can get the lock, take a |
@@ -488,11 +473,11 @@ xfs_buf_item_unpin_remove( | |||
488 | */ | 473 | */ |
489 | STATIC uint | 474 | STATIC uint |
490 | xfs_buf_item_trylock( | 475 | xfs_buf_item_trylock( |
491 | xfs_buf_log_item_t *bip) | 476 | struct xfs_log_item *lip) |
492 | { | 477 | { |
493 | xfs_buf_t *bp; | 478 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); |
479 | struct xfs_buf *bp = bip->bli_buf; | ||
494 | 480 | ||
495 | bp = bip->bli_buf; | ||
496 | if (XFS_BUF_ISPINNED(bp)) | 481 | if (XFS_BUF_ISPINNED(bp)) |
497 | return XFS_ITEM_PINNED; | 482 | return XFS_ITEM_PINNED; |
498 | if (!XFS_BUF_CPSEMA(bp)) | 483 | if (!XFS_BUF_CPSEMA(bp)) |
@@ -529,13 +514,12 @@ xfs_buf_item_trylock( | |||
529 | */ | 514 | */ |
530 | STATIC void | 515 | STATIC void |
531 | xfs_buf_item_unlock( | 516 | xfs_buf_item_unlock( |
532 | xfs_buf_log_item_t *bip) | 517 | struct xfs_log_item *lip) |
533 | { | 518 | { |
534 | int aborted; | 519 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); |
535 | xfs_buf_t *bp; | 520 | struct xfs_buf *bp = bip->bli_buf; |
536 | uint hold; | 521 | int aborted; |
537 | 522 | uint hold; | |
538 | bp = bip->bli_buf; | ||
539 | 523 | ||
540 | /* Clear the buffer's association with this transaction. */ | 524 | /* Clear the buffer's association with this transaction. */ |
541 | XFS_BUF_SET_FSPRIVATE2(bp, NULL); | 525 | XFS_BUF_SET_FSPRIVATE2(bp, NULL); |
@@ -546,7 +530,7 @@ xfs_buf_item_unlock( | |||
546 | * (cancelled) buffers at unpin time, but we'll never go through the | 530 | * (cancelled) buffers at unpin time, but we'll never go through the |
547 | * pin/unpin cycle if we abort inside commit. | 531 | * pin/unpin cycle if we abort inside commit. |
548 | */ | 532 | */ |
549 | aborted = (bip->bli_item.li_flags & XFS_LI_ABORTED) != 0; | 533 | aborted = (lip->li_flags & XFS_LI_ABORTED) != 0; |
550 | 534 | ||
551 | /* | 535 | /* |
552 | * Before possibly freeing the buf item, determine if we should | 536 | * Before possibly freeing the buf item, determine if we should |
@@ -607,16 +591,16 @@ xfs_buf_item_unlock( | |||
607 | */ | 591 | */ |
608 | STATIC xfs_lsn_t | 592 | STATIC xfs_lsn_t |
609 | xfs_buf_item_committed( | 593 | xfs_buf_item_committed( |
610 | xfs_buf_log_item_t *bip, | 594 | struct xfs_log_item *lip, |
611 | xfs_lsn_t lsn) | 595 | xfs_lsn_t lsn) |
612 | { | 596 | { |
597 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); | ||
598 | |||
613 | trace_xfs_buf_item_committed(bip); | 599 | trace_xfs_buf_item_committed(bip); |
614 | 600 | ||
615 | if ((bip->bli_flags & XFS_BLI_INODE_ALLOC_BUF) && | 601 | if ((bip->bli_flags & XFS_BLI_INODE_ALLOC_BUF) && lip->li_lsn != 0) |
616 | (bip->bli_item.li_lsn != 0)) { | 602 | return lip->li_lsn; |
617 | return bip->bli_item.li_lsn; | 603 | return lsn; |
618 | } | ||
619 | return (lsn); | ||
620 | } | 604 | } |
621 | 605 | ||
622 | /* | 606 | /* |
@@ -626,15 +610,16 @@ xfs_buf_item_committed( | |||
626 | */ | 610 | */ |
627 | STATIC void | 611 | STATIC void |
628 | xfs_buf_item_push( | 612 | xfs_buf_item_push( |
629 | xfs_buf_log_item_t *bip) | 613 | struct xfs_log_item *lip) |
630 | { | 614 | { |
631 | xfs_buf_t *bp; | 615 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); |
616 | struct xfs_buf *bp = bip->bli_buf; | ||
632 | 617 | ||
633 | ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); | 618 | ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); |
619 | ASSERT(!XFS_BUF_ISDELAYWRITE(bp)); | ||
620 | |||
634 | trace_xfs_buf_item_push(bip); | 621 | trace_xfs_buf_item_push(bip); |
635 | 622 | ||
636 | bp = bip->bli_buf; | ||
637 | ASSERT(!XFS_BUF_ISDELAYWRITE(bp)); | ||
638 | xfs_buf_relse(bp); | 623 | xfs_buf_relse(bp); |
639 | } | 624 | } |
640 | 625 | ||
@@ -646,22 +631,24 @@ xfs_buf_item_push( | |||
646 | */ | 631 | */ |
647 | STATIC void | 632 | STATIC void |
648 | xfs_buf_item_pushbuf( | 633 | xfs_buf_item_pushbuf( |
649 | xfs_buf_log_item_t *bip) | 634 | struct xfs_log_item *lip) |
650 | { | 635 | { |
651 | xfs_buf_t *bp; | 636 | struct xfs_buf_log_item *bip = BUF_ITEM(lip); |
637 | struct xfs_buf *bp = bip->bli_buf; | ||
652 | 638 | ||
653 | ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); | 639 | ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); |
640 | ASSERT(XFS_BUF_ISDELAYWRITE(bp)); | ||
641 | |||
654 | trace_xfs_buf_item_pushbuf(bip); | 642 | trace_xfs_buf_item_pushbuf(bip); |
655 | 643 | ||
656 | bp = bip->bli_buf; | ||
657 | ASSERT(XFS_BUF_ISDELAYWRITE(bp)); | ||
658 | xfs_buf_delwri_promote(bp); | 644 | xfs_buf_delwri_promote(bp); |
659 | xfs_buf_relse(bp); | 645 | xfs_buf_relse(bp); |
660 | } | 646 | } |
661 | 647 | ||
662 | /* ARGSUSED */ | ||
663 | STATIC void | 648 | STATIC void |
664 | xfs_buf_item_committing(xfs_buf_log_item_t *bip, xfs_lsn_t commit_lsn) | 649 | xfs_buf_item_committing( |
650 | struct xfs_log_item *lip, | ||
651 | xfs_lsn_t commit_lsn) | ||
665 | { | 652 | { |
666 | } | 653 | } |
667 | 654 | ||
@@ -669,21 +656,16 @@ xfs_buf_item_committing(xfs_buf_log_item_t *bip, xfs_lsn_t commit_lsn) | |||
669 | * This is the ops vector shared by all buf log items. | 656 | * This is the ops vector shared by all buf log items. |
670 | */ | 657 | */ |
671 | static struct xfs_item_ops xfs_buf_item_ops = { | 658 | static struct xfs_item_ops xfs_buf_item_ops = { |
672 | .iop_size = (uint(*)(xfs_log_item_t*))xfs_buf_item_size, | 659 | .iop_size = xfs_buf_item_size, |
673 | .iop_format = (void(*)(xfs_log_item_t*, xfs_log_iovec_t*)) | 660 | .iop_format = xfs_buf_item_format, |
674 | xfs_buf_item_format, | 661 | .iop_pin = xfs_buf_item_pin, |
675 | .iop_pin = (void(*)(xfs_log_item_t*))xfs_buf_item_pin, | 662 | .iop_unpin = xfs_buf_item_unpin, |
676 | .iop_unpin = (void(*)(xfs_log_item_t*))xfs_buf_item_unpin, | 663 | .iop_trylock = xfs_buf_item_trylock, |
677 | .iop_unpin_remove = (void(*)(xfs_log_item_t*, xfs_trans_t *)) | 664 | .iop_unlock = xfs_buf_item_unlock, |
678 | xfs_buf_item_unpin_remove, | 665 | .iop_committed = xfs_buf_item_committed, |
679 | .iop_trylock = (uint(*)(xfs_log_item_t*))xfs_buf_item_trylock, | 666 | .iop_push = xfs_buf_item_push, |
680 | .iop_unlock = (void(*)(xfs_log_item_t*))xfs_buf_item_unlock, | 667 | .iop_pushbuf = xfs_buf_item_pushbuf, |
681 | .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) | 668 | .iop_committing = xfs_buf_item_committing |
682 | xfs_buf_item_committed, | ||
683 | .iop_push = (void(*)(xfs_log_item_t*))xfs_buf_item_push, | ||
684 | .iop_pushbuf = (void(*)(xfs_log_item_t*))xfs_buf_item_pushbuf, | ||
685 | .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t)) | ||
686 | xfs_buf_item_committing | ||
687 | }; | 669 | }; |
688 | 670 | ||
689 | 671 | ||
@@ -712,7 +694,6 @@ xfs_buf_item_init( | |||
712 | */ | 694 | */ |
713 | if (bp->b_mount != mp) | 695 | if (bp->b_mount != mp) |
714 | bp->b_mount = mp; | 696 | bp->b_mount = mp; |
715 | XFS_BUF_SET_BDSTRAT_FUNC(bp, xfs_bdstrat_cb); | ||
716 | if (XFS_BUF_FSPRIVATE(bp, void *) != NULL) { | 697 | if (XFS_BUF_FSPRIVATE(bp, void *) != NULL) { |
717 | lip = XFS_BUF_FSPRIVATE(bp, xfs_log_item_t *); | 698 | lip = XFS_BUF_FSPRIVATE(bp, xfs_log_item_t *); |
718 | if (lip->li_type == XFS_LI_BUF) { | 699 | if (lip->li_type == XFS_LI_BUF) { |
@@ -1098,15 +1079,14 @@ xfs_buf_error_relse( | |||
1098 | * It is called by xfs_buf_iodone_callbacks() above which will take | 1079 | * It is called by xfs_buf_iodone_callbacks() above which will take |
1099 | * care of cleaning up the buffer itself. | 1080 | * care of cleaning up the buffer itself. |
1100 | */ | 1081 | */ |
1101 | /* ARGSUSED */ | ||
1102 | void | 1082 | void |
1103 | xfs_buf_iodone( | 1083 | xfs_buf_iodone( |
1104 | xfs_buf_t *bp, | 1084 | struct xfs_buf *bp, |
1105 | xfs_buf_log_item_t *bip) | 1085 | struct xfs_log_item *lip) |
1106 | { | 1086 | { |
1107 | struct xfs_ail *ailp = bip->bli_item.li_ailp; | 1087 | struct xfs_ail *ailp = lip->li_ailp; |
1108 | 1088 | ||
1109 | ASSERT(bip->bli_buf == bp); | 1089 | ASSERT(BUF_ITEM(lip)->bli_buf == bp); |
1110 | 1090 | ||
1111 | xfs_buf_rele(bp); | 1091 | xfs_buf_rele(bp); |
1112 | 1092 | ||
@@ -1120,6 +1100,6 @@ xfs_buf_iodone( | |||
1120 | * Either way, AIL is useless if we're forcing a shutdown. | 1100 | * Either way, AIL is useless if we're forcing a shutdown. |
1121 | */ | 1101 | */ |
1122 | spin_lock(&ailp->xa_lock); | 1102 | spin_lock(&ailp->xa_lock); |
1123 | xfs_trans_ail_delete(ailp, (xfs_log_item_t *)bip); | 1103 | xfs_trans_ail_delete(ailp, lip); |
1124 | xfs_buf_item_free(bip); | 1104 | xfs_buf_item_free(BUF_ITEM(lip)); |
1125 | } | 1105 | } |