summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2009-05-11 17:56:09 +0900
committerJens Axboe <jens.axboe@oracle.com>2009-05-11 11:06:48 +0200
commitb1f744937f1be3e6d3009382a755679133cf782d (patch)
tree0e90e43589ecfe28199030e8e396c0193199da7e /block
parente6bb7a96c2c36f20c05ef648f15bd3c2b1834c78 (diff)
block: move completion related functions back to blk-core.c
Let's put the completion related functions back to block/blk-core.c where they have lived. We can also unexport blk_end_bidi_request() and __blk_end_bidi_request(), which nobody uses. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-core.c128
1 files changed, 122 insertions, 6 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 93691d2ac5a0..a2d97de1a12c 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -2026,8 +2026,8 @@ static void blk_finish_request(struct request *req, int error)
* %false - we are done with this request
* %true - still buffers pending for this request
**/
-bool blk_end_bidi_request(struct request *rq, int error,
- unsigned int nr_bytes, unsigned int bidi_bytes)
+static bool blk_end_bidi_request(struct request *rq, int error,
+ unsigned int nr_bytes, unsigned int bidi_bytes)
{
struct request_queue *q = rq->q;
unsigned long flags;
@@ -2041,7 +2041,6 @@ bool blk_end_bidi_request(struct request *rq, int error,
return false;
}
-EXPORT_SYMBOL_GPL(blk_end_bidi_request);
/**
* __blk_end_bidi_request - Complete a bidi request with queue lock held
@@ -2058,8 +2057,8 @@ EXPORT_SYMBOL_GPL(blk_end_bidi_request);
* %false - we are done with this request
* %true - still buffers pending for this request
**/
-bool __blk_end_bidi_request(struct request *rq, int error,
- unsigned int nr_bytes, unsigned int bidi_bytes)
+static bool __blk_end_bidi_request(struct request *rq, int error,
+ unsigned int nr_bytes, unsigned int bidi_bytes)
{
if (blk_update_bidi_request(rq, error, nr_bytes, bidi_bytes))
return true;
@@ -2068,7 +2067,124 @@ bool __blk_end_bidi_request(struct request *rq, int error,
return false;
}
-EXPORT_SYMBOL_GPL(__blk_end_bidi_request);
+
+/**
+ * blk_end_request - Helper function for drivers to complete the request.
+ * @rq: the request being processed
+ * @error: %0 for success, < %0 for error
+ * @nr_bytes: number of bytes to complete
+ *
+ * Description:
+ * Ends I/O on a number of bytes attached to @rq.
+ * If @rq has leftover, sets it up for the next range of segments.
+ *
+ * Return:
+ * %false - we are done with this request
+ * %true - still buffers pending for this request
+ **/
+bool blk_end_request(struct request *rq, int error, unsigned int nr_bytes)
+{
+ return blk_end_bidi_request(rq, error, nr_bytes, 0);
+}
+EXPORT_SYMBOL_GPL(blk_end_request);
+
+/**
+ * blk_end_request_all - Helper function for drives to finish the request.
+ * @rq: the request to finish
+ * @err: %0 for success, < %0 for error
+ *
+ * Description:
+ * Completely finish @rq.
+ */
+void blk_end_request_all(struct request *rq, int error)
+{
+ bool pending;
+ unsigned int bidi_bytes = 0;
+
+ if (unlikely(blk_bidi_rq(rq)))
+ bidi_bytes = blk_rq_bytes(rq->next_rq);
+
+ pending = blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
+ BUG_ON(pending);
+}
+EXPORT_SYMBOL_GPL(blk_end_request_all);
+
+/**
+ * blk_end_request_cur - Helper function to finish the current request chunk.
+ * @rq: the request to finish the current chunk for
+ * @err: %0 for success, < %0 for error
+ *
+ * Description:
+ * Complete the current consecutively mapped chunk from @rq.
+ *
+ * Return:
+ * %false - we are done with this request
+ * %true - still buffers pending for this request
+ */
+bool blk_end_request_cur(struct request *rq, int error)
+{
+ return blk_end_request(rq, error, blk_rq_cur_bytes(rq));
+}
+EXPORT_SYMBOL_GPL(blk_end_request_cur);
+
+/**
+ * __blk_end_request - Helper function for drivers to complete the request.
+ * @rq: the request being processed
+ * @error: %0 for success, < %0 for error
+ * @nr_bytes: number of bytes to complete
+ *
+ * Description:
+ * Must be called with queue lock held unlike blk_end_request().
+ *
+ * Return:
+ * %false - we are done with this request
+ * %true - still buffers pending for this request
+ **/
+bool __blk_end_request(struct request *rq, int error, unsigned int nr_bytes)
+{
+ return __blk_end_bidi_request(rq, error, nr_bytes, 0);
+}
+EXPORT_SYMBOL_GPL(__blk_end_request);
+
+/**
+ * __blk_end_request_all - Helper function for drives to finish the request.
+ * @rq: the request to finish
+ * @err: %0 for success, < %0 for error
+ *
+ * Description:
+ * Completely finish @rq. Must be called with queue lock held.
+ */
+void __blk_end_request_all(struct request *rq, int error)
+{
+ bool pending;
+ unsigned int bidi_bytes = 0;
+
+ if (unlikely(blk_bidi_rq(rq)))
+ bidi_bytes = blk_rq_bytes(rq->next_rq);
+
+ pending = __blk_end_bidi_request(rq, error, blk_rq_bytes(rq), bidi_bytes);
+ BUG_ON(pending);
+}
+EXPORT_SYMBOL_GPL(__blk_end_request_all);
+
+/**
+ * __blk_end_request_cur - Helper function to finish the current request chunk.
+ * @rq: the request to finish the current chunk for
+ * @err: %0 for success, < %0 for error
+ *
+ * Description:
+ * Complete the current consecutively mapped chunk from @rq. Must
+ * be called with queue lock held.
+ *
+ * Return:
+ * %false - we are done with this request
+ * %true - still buffers pending for this request
+ */
+bool __blk_end_request_cur(struct request *rq, int error)
+{
+ return __blk_end_request(rq, error, blk_rq_cur_bytes(rq));
+}
+EXPORT_SYMBOL_GPL(__blk_end_request_cur);
void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
struct bio *bio)
e='feature/coretext'>feature/coretext main, development code repositoryroot
summaryrefslogtreecommitdiff
path: root/extras
AgeCommit message (Expand)AuthorFilesLines
2012-10-30extras: extra_fonts needs to be a ExternalPackageMichael Stahl3-188/+188
2012-09-30Update in Brazilian autocorrectionOlivier Hallot2-17/+18
2012-09-24Autocorrection improvements for pt-BROlivier Hallot3-5042/+3665
2012-09-21add pt-BR/acor/SentenceExceptList.xml to makefileAndras Timar1-0/+1
2012-09-21Update acor_pt-PT.dat and fix fdo#54362Olivier Hallot5-53/+107
2012-08-29fix typoDavid Tardon1-1/+1
2012-08-28Change Calc templates fontsOlivier Hallot18-0/+0
2012-08-25localize spreadsheet style template names runtimeAndras Timar453-466/+34
2012-08-24translate fax/letter/agenda/report templates runtimeIstvan Turi1756-1763/+116
2012-08-24soffice.html has been removedDavid Tardon1-1/+0
2012-08-24drop unused filesDavid Tardon74-1593/+0
2012-08-24gbuildize extrasDavid Tardon316-6310/+8087
2012-08-24remove unused soffice.htmlAndras Timar1-12/+0
2012-08-24fdo#52978 remove hardcoded page width/heightAndras Timar1-0/+0
2012-08-16idxexample.odt and html.stw cleanup (fdo#49101, fdo#49098)Istvan Turi52-41/+1
2012-08-15make all autocorrection manifest.xml have the same styleCaolán McNamara43-110/+93
2012-08-13fdo#49527 unzip autocorrect files, store contents in gitBence Babati294-33/+32994
2012-07-18re-base on ALv2 code. Includes:Michael Meeks95-839/+1507
2012-07-16Fix typo in template name: "VIntage" to "Vintage"Stefan Knorr (astron)1-0/+0
2012-07-04modernize the default set of Impress templates (masterpages)Alexander Wilms89-0/+0
2012-06-25ditch wizards schedule moduleCaolán McNamara18-0/+0
2012-06-16Updated autorrection for pt-BRRaimundo Moura1-0/+0
2012-06-05Revert "Revert "Remove ugly symbols""Andras Timar68-56/+0
2012-06-05Revert "Remove ugly symbols"libreoffice-3-6-branch-pointStefan Knorr (astron)68-0/+56
2012-06-05Remove ugly symbolsStefan Knorr (astron)68-56/+0
2012-05-28put white next to black in the color palette drop-downMichael Meeks1-1/+1
2012-05-26added the metropolis master pageAlexander Wilms1-0/+0
2012-05-05<fanboy>I love you Neil</fanboy>Caolán McNamara1-0/+0
2012-04-29make gbuild the default assumption of build.plBjoern Michaelsen1-0/+0
2012-04-13Translate <title> to EnglishPhilipp Weissenbacher1-2/+2
2012-03-26Adapt arrowhead pathes to corrected svg path z hanglingRegina Henschel1-4/+4
2012-03-26fdo#42328 Impress slide backgrounds with Liberation fontsOlivier Hallot1-0/+0
2012-03-26fdo#42328 Impress slide backgrounds with Liberation fontsOlivier Hallot24-0/+0
2012-03-23.css files don't need executable bitsMichael Stahl10-0/+0
2012-03-23.html files don't need executable bitsMichael Stahl1-0/+0
2012-03-23.stw files don't need executable bitsMichael Stahl3-0/+0
2012-03-14toggle on view all records in biblio.odbCaolán McNamara2-9/+7
2012-03-09document how to update the damn bibliography databaseCaolán McNamara1-0/+21
2012-03-09Resolves: fdo#45033 use LibreOffice references in bibliographyItalo Vignoli2-0/+0
2012-02-09Added and improved READMEs for modules in extensions, extras, postprocessJosh Heidenreich1-0/+1
2012-01-17fix zh-TW translation errors reported by Cheng-Chia Tseng in e-mailAndras Timar3-0/+0
2012-01-11add README to document how to bump the font versionCaolán McNamara1-0/+16
2012-01-10Fix for bug fdo#44110, New Math symbols issues in WindowsOlivier Hallot2-168/+167
2012-01-06Revert "Fix for bug fdo#44110, New Math symbols issues in Windows"Jan Holesovsky2-6739/+78522
2012-01-05Fix for bug fdo#44110, New Math symbols issues in WindowsOlivier Hallot