diff options
author | Kiyoshi Ueda <k-ueda@ct.jp.nec.com> | 2008-10-01 10:14:46 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:21 -0400 |
commit | d00e29fd99dd63d1c51917604e35dee824ed567f (patch) | |
tree | 461c725d7ffaf2d5a69bc854ca4aa9977f530ea2 | |
parent | 99cd3386f290eaf61f2b7596d5a4cc2007771174 (diff) |
block: remove end_{queued|dequeued}_request()
This patch removes end_queued_request() and end_dequeued_request(),
which are no longer used.
As a results, users of __end_request() became only end_request().
So the actual code in __end_request() is moved to end_request()
and __end_request() is removed.
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | block/blk-core.c | 58 | ||||
-rw-r--r-- | include/linux/blkdev.h | 2 |
2 files changed, 7 insertions, 53 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index b2d0ac8b760e..2d053b584410 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1790,17 +1790,6 @@ static void end_that_request_last(struct request *req, int error) | |||
1790 | } | 1790 | } |
1791 | } | 1791 | } |
1792 | 1792 | ||
1793 | static inline void __end_request(struct request *rq, int uptodate, | ||
1794 | unsigned int nr_bytes) | ||
1795 | { | ||
1796 | int error = 0; | ||
1797 | |||
1798 | if (uptodate <= 0) | ||
1799 | error = uptodate ? uptodate : -EIO; | ||
1800 | |||
1801 | __blk_end_request(rq, error, nr_bytes); | ||
1802 | } | ||
1803 | |||
1804 | /** | 1793 | /** |
1805 | * blk_rq_bytes - Returns bytes left to complete in the entire request | 1794 | * blk_rq_bytes - Returns bytes left to complete in the entire request |
1806 | * @rq: the request being processed | 1795 | * @rq: the request being processed |
@@ -1831,41 +1820,6 @@ unsigned int blk_rq_cur_bytes(struct request *rq) | |||
1831 | EXPORT_SYMBOL_GPL(blk_rq_cur_bytes); | 1820 | EXPORT_SYMBOL_GPL(blk_rq_cur_bytes); |
1832 | 1821 | ||
1833 | /** | 1822 | /** |
1834 | * end_queued_request - end all I/O on a queued request | ||
1835 | * @rq: the request being processed | ||
1836 | * @uptodate: error value or %0/%1 uptodate flag | ||
1837 | * | ||
1838 | * Description: | ||
1839 | * Ends all I/O on a request, and removes it from the block layer queues. | ||
1840 | * Not suitable for normal I/O completion, unless the driver still has | ||
1841 | * the request attached to the block layer. | ||
1842 | * | ||
1843 | **/ | ||
1844 | void end_queued_request(struct request *rq, int uptodate) | ||
1845 | { | ||
1846 | __end_request(rq, uptodate, blk_rq_bytes(rq)); | ||
1847 | } | ||
1848 | EXPORT_SYMBOL(end_queued_request); | ||
1849 | |||
1850 | /** | ||
1851 | * end_dequeued_request - end all I/O on a dequeued request | ||
1852 | * @rq: the request being processed | ||
1853 | * @uptodate: error value or %0/%1 uptodate flag | ||
1854 | * | ||
1855 | * Description: | ||
1856 | * Ends all I/O on a request. The request must already have been | ||
1857 | * dequeued using blkdev_dequeue_request(), as is normally the case | ||
1858 | * for most drivers. | ||
1859 | * | ||
1860 | **/ | ||
1861 | void end_dequeued_request(struct request *rq, int uptodate) | ||
1862 | { | ||
1863 | __end_request(rq, uptodate, blk_rq_bytes(rq)); | ||
1864 | } | ||
1865 | EXPORT_SYMBOL(end_dequeued_request); | ||
1866 | |||
1867 | |||
1868 | /** | ||
1869 | * end_request - end I/O on the current segment of the request | 1823 | * end_request - end I/O on the current segment of the request |
1870 | * @req: the request being processed | 1824 | * @req: the request being processed |
1871 | * @uptodate: error value or %0/%1 uptodate flag | 1825 | * @uptodate: error value or %0/%1 uptodate flag |
@@ -1879,14 +1833,16 @@ EXPORT_SYMBOL(end_dequeued_request); | |||
1879 | * they have a residual value to account for. For that case this function | 1833 | * they have a residual value to account for. For that case this function |
1880 | * isn't really useful, unless the residual just happens to be the | 1834 | * isn't really useful, unless the residual just happens to be the |
1881 | * full current segment. In other words, don't use this function in new | 1835 | * full current segment. In other words, don't use this function in new |
1882 | * code. Use blk_end_request() or __blk_end_request() to end partial parts | 1836 | * code. Use blk_end_request() or __blk_end_request() to end a request. |
1883 | * of a request, or end_dequeued_request() and end_queued_request() to | ||
1884 | * completely end IO on a dequeued/queued request. | ||
1885 | * | ||
1886 | **/ | 1837 | **/ |
1887 | void end_request(struct request *req, int uptodate) | 1838 | void end_request(struct request *req, int uptodate) |
1888 | { | 1839 | { |
1889 | __end_request(req, uptodate, req->hard_cur_sectors << 9); | 1840 | int error = 0; |
1841 | |||
1842 | if (uptodate <= 0) | ||
1843 | error = uptodate ? uptodate : -EIO; | ||
1844 | |||
1845 | __blk_end_request(req, error, req->hard_cur_sectors << 9); | ||
1890 | } | 1846 | } |
1891 | EXPORT_SYMBOL(end_request); | 1847 | EXPORT_SYMBOL(end_request); |
1892 | 1848 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 9e0ee1a8254e..bfc18e497c7f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -793,8 +793,6 @@ extern int __blk_end_request(struct request *rq, int error, | |||
793 | extern int blk_end_bidi_request(struct request *rq, int error, | 793 | extern int blk_end_bidi_request(struct request *rq, int error, |
794 | unsigned int nr_bytes, unsigned int bidi_bytes); | 794 | unsigned int nr_bytes, unsigned int bidi_bytes); |
795 | extern void end_request(struct request *, int); | 795 | extern void end_request(struct request *, int); |
796 | extern void end_queued_request(struct request *, int); | ||
797 | extern void end_dequeued_request(struct request *, int); | ||
798 | extern int blk_end_request_callback(struct request *rq, int error, | 796 | extern int blk_end_request_callback(struct request *rq, int error, |
799 | unsigned int nr_bytes, | 797 | unsigned int nr_bytes, |
800 | int (drv_callback)(struct request *)); | 798 | int (drv_callback)(struct request *)); |