diff options
| author | James Morris <jmorris@namei.org> | 2011-04-19 07:32:41 -0400 |
|---|---|---|
| committer | James Morris <jmorris@namei.org> | 2011-04-19 07:32:41 -0400 |
| commit | d4ab4e6a23f805abb8fc3cc34525eec3788aeca1 (patch) | |
| tree | eefd82c155bc27469a85667d759cd90facf4a6e3 /fs/xfs/linux-2.6/xfs_buf.c | |
| parent | c0fa797ae6cd02ff87c0bfe0d509368a3b45640e (diff) | |
| parent | 96fd2d57b8252e16dfacf8941f7a74a6119197f5 (diff) | |
Merge branch 'master'; commit 'v2.6.39-rc3' into next
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_buf.c')
| -rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 596bb2c9de42..9ef9ed2cfe2e 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
| @@ -120,7 +120,7 @@ xfs_buf_lru_add( | |||
| 120 | * The unlocked check is safe here because it only occurs when there are not | 120 | * The unlocked check is safe here because it only occurs when there are not |
| 121 | * b_lru_ref counts left on the inode under the pag->pag_buf_lock. it is there | 121 | * b_lru_ref counts left on the inode under the pag->pag_buf_lock. it is there |
| 122 | * to optimise the shrinker removing the buffer from the LRU and calling | 122 | * to optimise the shrinker removing the buffer from the LRU and calling |
| 123 | * xfs_buf_free(). i.e. it removes an unneccessary round trip on the | 123 | * xfs_buf_free(). i.e. it removes an unnecessary round trip on the |
| 124 | * bt_lru_lock. | 124 | * bt_lru_lock. |
| 125 | */ | 125 | */ |
| 126 | STATIC void | 126 | STATIC void |
| @@ -293,7 +293,6 @@ xfs_buf_allocate_memory( | |||
| 293 | size_t nbytes, offset; | 293 | size_t nbytes, offset; |
| 294 | gfp_t gfp_mask = xb_to_gfp(flags); | 294 | gfp_t gfp_mask = xb_to_gfp(flags); |
| 295 | unsigned short page_count, i; | 295 | unsigned short page_count, i; |
| 296 | pgoff_t first; | ||
| 297 | xfs_off_t end; | 296 | xfs_off_t end; |
| 298 | int error; | 297 | int error; |
| 299 | 298 | ||
| @@ -333,7 +332,6 @@ use_alloc_page: | |||
| 333 | return error; | 332 | return error; |
| 334 | 333 | ||
| 335 | offset = bp->b_offset; | 334 | offset = bp->b_offset; |
| 336 | first = bp->b_file_offset >> PAGE_SHIFT; | ||
| 337 | bp->b_flags |= _XBF_PAGES; | 335 | bp->b_flags |= _XBF_PAGES; |
| 338 | 336 | ||
| 339 | for (i = 0; i < bp->b_page_count; i++) { | 337 | for (i = 0; i < bp->b_page_count; i++) { |
| @@ -380,7 +378,7 @@ out_free_pages: | |||
| 380 | } | 378 | } |
| 381 | 379 | ||
| 382 | /* | 380 | /* |
| 383 | * Map buffer into kernel address-space if nessecary. | 381 | * Map buffer into kernel address-space if necessary. |
| 384 | */ | 382 | */ |
| 385 | STATIC int | 383 | STATIC int |
| 386 | _xfs_buf_map_pages( | 384 | _xfs_buf_map_pages( |
| @@ -657,8 +655,6 @@ xfs_buf_readahead( | |||
| 657 | xfs_off_t ioff, | 655 | xfs_off_t ioff, |
| 658 | size_t isize) | 656 | size_t isize) |
| 659 | { | 657 | { |
| 660 | struct backing_dev_info *bdi; | ||
| 661 | |||
| 662 | if (bdi_read_congested(target->bt_bdi)) | 658 | if (bdi_read_congested(target->bt_bdi)) |
| 663 | return; | 659 | return; |
| 664 | 660 | ||
| @@ -919,8 +915,6 @@ xfs_buf_lock( | |||
| 919 | 915 | ||
| 920 | if (atomic_read(&bp->b_pin_count) && (bp->b_flags & XBF_STALE)) | 916 | if (atomic_read(&bp->b_pin_count) && (bp->b_flags & XBF_STALE)) |
| 921 | xfs_log_force(bp->b_target->bt_mount, 0); | 917 | xfs_log_force(bp->b_target->bt_mount, 0); |
| 922 | if (atomic_read(&bp->b_io_remaining)) | ||
| 923 | blk_flush_plug(current); | ||
| 924 | down(&bp->b_sema); | 918 | down(&bp->b_sema); |
| 925 | XB_SET_OWNER(bp); | 919 | XB_SET_OWNER(bp); |
| 926 | 920 | ||
| @@ -1309,8 +1303,6 @@ xfs_buf_iowait( | |||
| 1309 | { | 1303 | { |
| 1310 | trace_xfs_buf_iowait(bp, _RET_IP_); | 1304 | trace_xfs_buf_iowait(bp, _RET_IP_); |
| 1311 | 1305 | ||
| 1312 | if (atomic_read(&bp->b_io_remaining)) | ||
| 1313 | blk_flush_plug(current); | ||
| 1314 | wait_for_completion(&bp->b_iowait); | 1306 | wait_for_completion(&bp->b_iowait); |
| 1315 | 1307 | ||
| 1316 | trace_xfs_buf_iowait_done(bp, _RET_IP_); | 1308 | trace_xfs_buf_iowait_done(bp, _RET_IP_); |
| @@ -1747,8 +1739,8 @@ xfsbufd( | |||
| 1747 | do { | 1739 | do { |
| 1748 | long age = xfs_buf_age_centisecs * msecs_to_jiffies(10); | 1740 | long age = xfs_buf_age_centisecs * msecs_to_jiffies(10); |
| 1749 | long tout = xfs_buf_timer_centisecs * msecs_to_jiffies(10); | 1741 | long tout = xfs_buf_timer_centisecs * msecs_to_jiffies(10); |
| 1750 | int count = 0; | ||
| 1751 | struct list_head tmp; | 1742 | struct list_head tmp; |
| 1743 | struct blk_plug plug; | ||
| 1752 | 1744 | ||
| 1753 | if (unlikely(freezing(current))) { | 1745 | if (unlikely(freezing(current))) { |
| 1754 | set_bit(XBT_FORCE_SLEEP, &target->bt_flags); | 1746 | set_bit(XBT_FORCE_SLEEP, &target->bt_flags); |
| @@ -1764,16 +1756,15 @@ xfsbufd( | |||
| 1764 | 1756 | ||
| 1765 | xfs_buf_delwri_split(target, &tmp, age); | 1757 | xfs_buf_delwri_split(target, &tmp, age); |
| 1766 | list_sort(NULL, &tmp, xfs_buf_cmp); | 1758 | list_sort(NULL, &tmp, xfs_buf_cmp); |
| 1759 | |||
| 1760 | blk_start_plug(&plug); | ||
| 1767 | while (!list_empty(&tmp)) { | 1761 | while (!list_empty(&tmp)) { |
| 1768 | struct xfs_buf *bp; | 1762 | struct xfs_buf *bp; |
| 1769 | bp = list_first_entry(&tmp, struct xfs_buf, b_list); | 1763 | bp = list_first_entry(&tmp, struct xfs_buf, b_list); |
| 1770 | list_del_init(&bp->b_list); | 1764 | list_del_init(&bp->b_list); |
| 1771 | xfs_bdstrat_cb(bp); | 1765 | xfs_bdstrat_cb(bp); |
| 1772 | count++; | ||
| 1773 | } | 1766 | } |
| 1774 | if (count) | 1767 | blk_finish_plug(&plug); |
| 1775 | blk_flush_plug(current); | ||
| 1776 | |||
| 1777 | } while (!kthread_should_stop()); | 1768 | } while (!kthread_should_stop()); |
| 1778 | 1769 | ||
| 1779 | return 0; | 1770 | return 0; |
| @@ -1793,6 +1784,7 @@ xfs_flush_buftarg( | |||
| 1793 | int pincount = 0; | 1784 | int pincount = 0; |
| 1794 | LIST_HEAD(tmp_list); | 1785 | LIST_HEAD(tmp_list); |
| 1795 | LIST_HEAD(wait_list); | 1786 | LIST_HEAD(wait_list); |
| 1787 | struct blk_plug plug; | ||
| 1796 | 1788 | ||
| 1797 | xfs_buf_runall_queues(xfsconvertd_workqueue); | 1789 | xfs_buf_runall_queues(xfsconvertd_workqueue); |
| 1798 | xfs_buf_runall_queues(xfsdatad_workqueue); | 1790 | xfs_buf_runall_queues(xfsdatad_workqueue); |
| @@ -1807,6 +1799,8 @@ xfs_flush_buftarg( | |||
| 1807 | * we do that after issuing all the IO. | 1799 | * we do that after issuing all the IO. |
| 1808 | */ | 1800 | */ |
| 1809 | list_sort(NULL, &tmp_list, xfs_buf_cmp); | 1801 | list_sort(NULL, &tmp_list, xfs_buf_cmp); |
| 1802 | |||
| 1803 | blk_start_plug(&plug); | ||
| 1810 | while (!list_empty(&tmp_list)) { | 1804 | while (!list_empty(&tmp_list)) { |
| 1811 | bp = list_first_entry(&tmp_list, struct xfs_buf, b_list); | 1805 | bp = list_first_entry(&tmp_list, struct xfs_buf, b_list); |
| 1812 | ASSERT(target == bp->b_target); | 1806 | ASSERT(target == bp->b_target); |
| @@ -1817,10 +1811,10 @@ xfs_flush_buftarg( | |||
| 1817 | } | 1811 | } |
| 1818 | xfs_bdstrat_cb(bp); | 1812 | xfs_bdstrat_cb(bp); |
| 1819 | } | 1813 | } |
| 1814 | blk_finish_plug(&plug); | ||
| 1820 | 1815 | ||
| 1821 | if (wait) { | 1816 | if (wait) { |
| 1822 | /* Expedite and wait for IO to complete. */ | 1817 | /* Wait for IO to complete. */ |
| 1823 | blk_flush_plug(current); | ||
| 1824 | while (!list_empty(&wait_list)) { | 1818 | while (!list_empty(&wait_list)) { |
| 1825 | bp = list_first_entry(&wait_list, struct xfs_buf, b_list); | 1819 | bp = list_first_entry(&wait_list, struct xfs_buf, b_list); |
| 1826 | 1820 | ||
