transaction.c (d26fad5b38e1c4667d4f2604936e59c837caa54d) | transaction.c (743162013d40ca612b4cb53d3a200dff2d9ab26e) |
---|---|
1/* 2 * linux/fs/jbd2/transaction.c 3 * 4 * Written by Stephen C. Tweedie <sct@redhat.com>, 1998 5 * 6 * Copyright 1998 Red Hat corp --- All Rights Reserved 7 * 8 * This file is part of the Linux kernel and is made available under --- 749 unchanged lines hidden (view full) --- 758 759 printk(KERN_WARNING 760 "JBD2: Spotted dirty metadata buffer (dev = %s, blocknr = %llu). " 761 "There's a risk of filesystem corruption in case of system " 762 "crash.\n", 763 bdevname(bh->b_bdev, b), (unsigned long long)bh->b_blocknr); 764} 765 | 1/* 2 * linux/fs/jbd2/transaction.c 3 * 4 * Written by Stephen C. Tweedie <sct@redhat.com>, 1998 5 * 6 * Copyright 1998 Red Hat corp --- All Rights Reserved 7 * 8 * This file is part of the Linux kernel and is made available under --- 749 unchanged lines hidden (view full) --- 758 759 printk(KERN_WARNING 760 "JBD2: Spotted dirty metadata buffer (dev = %s, blocknr = %llu). " 761 "There's a risk of filesystem corruption in case of system " 762 "crash.\n", 763 bdevname(bh->b_bdev, b), (unsigned long long)bh->b_blocknr); 764} 765 |
766static int sleep_on_shadow_bh(void *word) 767{ 768 io_schedule(); 769 return 0; 770} 771 | |
772/* 773 * If the buffer is already part of the current transaction, then there 774 * is nothing we need to do. If it is already part of a prior 775 * transaction which we are still committing to disk, then we need to 776 * make sure that we do not overwrite the old copy: we do copy-out to 777 * preserve the copy going to disk. We also account the buffer against 778 * the handle's metadata buffer credits (unless the buffer is already 779 * part of the transaction, that is). --- 121 unchanged lines hidden (view full) --- 901 * right now. The essence of copy-out is that it is the 902 * extra copy, not the primary copy, which gets 903 * journaled. If the primary copy is already going to 904 * disk then we cannot do copy-out here. */ 905 906 if (buffer_shadow(bh)) { 907 JBUFFER_TRACE(jh, "on shadow: sleep"); 908 jbd_unlock_bh_state(bh); | 766/* 767 * If the buffer is already part of the current transaction, then there 768 * is nothing we need to do. If it is already part of a prior 769 * transaction which we are still committing to disk, then we need to 770 * make sure that we do not overwrite the old copy: we do copy-out to 771 * preserve the copy going to disk. We also account the buffer against 772 * the handle's metadata buffer credits (unless the buffer is already 773 * part of the transaction, that is). --- 121 unchanged lines hidden (view full) --- 895 * right now. The essence of copy-out is that it is the 896 * extra copy, not the primary copy, which gets 897 * journaled. If the primary copy is already going to 898 * disk then we cannot do copy-out here. */ 899 900 if (buffer_shadow(bh)) { 901 JBUFFER_TRACE(jh, "on shadow: sleep"); 902 jbd_unlock_bh_state(bh); |
909 wait_on_bit(&bh->b_state, BH_Shadow, 910 sleep_on_shadow_bh, TASK_UNINTERRUPTIBLE); | 903 wait_on_bit_io(&bh->b_state, BH_Shadow, 904 TASK_UNINTERRUPTIBLE); |
911 goto repeat; 912 } 913 914 /* 915 * Only do the copy if the currently-owning transaction still 916 * needs it. If buffer isn't on BJ_Metadata list, the 917 * committing transaction is past that stage (here we use the 918 * fact that BH_Shadow is set under bh_state lock together with --- 1568 unchanged lines hidden --- | 905 goto repeat; 906 } 907 908 /* 909 * Only do the copy if the currently-owning transaction still 910 * needs it. If buffer isn't on BJ_Metadata list, the 911 * committing transaction is past that stage (here we use the 912 * fact that BH_Shadow is set under bh_state lock together with --- 1568 unchanged lines hidden --- |