diff options
author | Matthew Wilcox <mawilcox@microsoft.com> | 2017-12-22 09:32:16 -0500 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2018-01-01 14:40:27 -0500 |
commit | 14ebc28e07e68ff412aa42f7d8b67969e2f63d00 (patch) | |
tree | 7d5aa02eba4a70f4d8da61e51eae16e0c7956567 /lib/errseq.c | |
parent | aa931b44ae3e32329b054e3cd8ba1a4f1aa9e0d8 (diff) |
errseq: Add to documentation tree
- Move errseq.rst into core-api
- Add errseq to the core-api index
- Promote the header to a more prominent header type, otherwise we get three
entries in the table of contents.
- Reformat the table to look nicer and be a little more proportional in
terms of horizontal width per bit (the SF bit is still disproportionately
large, but there's no way to fix that).
- Include errseq kernel-doc in the errseq.rst
- Neaten some kernel-doc markup
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'lib/errseq.c')
-rw-r--r-- | lib/errseq.c | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/lib/errseq.c b/lib/errseq.c index 79cc66897db4..df782418b333 100644 --- a/lib/errseq.c +++ b/lib/errseq.c | |||
@@ -46,14 +46,14 @@ | |||
46 | * @eseq: errseq_t field that should be set | 46 | * @eseq: errseq_t field that should be set |
47 | * @err: error to set (must be between -1 and -MAX_ERRNO) | 47 | * @err: error to set (must be between -1 and -MAX_ERRNO) |
48 | * | 48 | * |
49 | * This function sets the error in *eseq, and increments the sequence counter | 49 | * This function sets the error in @eseq, and increments the sequence counter |
50 | * if the last sequence was sampled at some point in the past. | 50 | * if the last sequence was sampled at some point in the past. |
51 | * | 51 | * |
52 | * Any error set will always overwrite an existing error. | 52 | * Any error set will always overwrite an existing error. |
53 | * | 53 | * |
54 | * We do return the latest value here, primarily for debugging purposes. The | 54 | * Return: The previous value, primarily for debugging purposes. The |
55 | * return value should not be used as a previously sampled value in later calls | 55 | * return value should not be used as a previously sampled value in later |
56 | * as it will not have the SEEN flag set. | 56 | * calls as it will not have the SEEN flag set. |
57 | */ | 57 | */ |
58 | errseq_t errseq_set(errseq_t *eseq, int err) | 58 | errseq_t errseq_set(errseq_t *eseq, int err) |
59 | { | 59 | { |
@@ -108,11 +108,13 @@ errseq_t errseq_set(errseq_t *eseq, int err) | |||
108 | EXPORT_SYMBOL(errseq_set); | 108 | EXPORT_SYMBOL(errseq_set); |
109 | 109 | ||
110 | /** | 110 | /** |
111 | * errseq_sample - grab current errseq_t value | 111 | * errseq_sample() - Grab current errseq_t value. |
112 | * @eseq: pointer to errseq_t to be sampled | 112 | * @eseq: Pointer to errseq_t to be sampled. |
113 | * | 113 | * |
114 | * This function allows callers to sample an errseq_t value, marking it as | 114 | * This function allows callers to sample an errseq_t value, marking it as |
115 | * "seen" if required. | 115 | * "seen" if required. |
116 | * | ||
117 | * Return: The current errseq value. | ||
116 | */ | 118 | */ |
117 | errseq_t errseq_sample(errseq_t *eseq) | 119 | errseq_t errseq_sample(errseq_t *eseq) |
118 | { | 120 | { |
@@ -134,15 +136,15 @@ errseq_t errseq_sample(errseq_t *eseq) | |||
134 | EXPORT_SYMBOL(errseq_sample); | 136 | EXPORT_SYMBOL(errseq_sample); |
135 | 137 | ||
136 | /** | 138 | /** |
137 | * errseq_check - has an error occurred since a particular sample point? | 139 | * errseq_check() - Has an error occurred since a particular sample point? |
138 | * @eseq: pointer to errseq_t value to be checked | 140 | * @eseq: Pointer to errseq_t value to be checked. |
139 | * @since: previously-sampled errseq_t from which to check | 141 | * @since: Previously-sampled errseq_t from which to check. |
140 | * | 142 | * |
141 | * Grab the value that eseq points to, and see if it has changed "since" | 143 | * Grab the value that eseq points to, and see if it has changed @since |
142 | * the given value was sampled. The "since" value is not advanced, so there | 144 | * the given value was sampled. The @since value is not advanced, so there |
143 | * is no need to mark the value as seen. | 145 | * is no need to mark the value as seen. |
144 | * | 146 | * |
145 | * Returns the latest error set in the errseq_t or 0 if it hasn't changed. | 147 | * Return: The latest error set in the errseq_t or 0 if it hasn't changed. |
146 | */ | 148 | */ |
147 | int errseq_check(errseq_t *eseq, errseq_t since) | 149 | int errseq_check(errseq_t *eseq, errseq_t since) |
148 | { | 150 | { |
@@ -155,11 +157,11 @@ int errseq_check(errseq_t *eseq, errseq_t since) | |||
155 | EXPORT_SYMBOL(errseq_check); | 157 | EXPORT_SYMBOL(errseq_check); |
156 | 158 | ||
157 | /** | 159 | /** |
158 | * errseq_check_and_advance - check an errseq_t and advance to current value | 160 | * errseq_check_and_advance() - Check an errseq_t and advance to current value. |
159 | * @eseq: pointer to value being checked and reported | 161 | * @eseq: Pointer to value being checked and reported. |
160 | * @since: pointer to previously-sampled errseq_t to check against and advance | 162 | * @since: Pointer to previously-sampled errseq_t to check against and advance. |
161 | * | 163 | * |
162 | * Grab the eseq value, and see whether it matches the value that "since" | 164 | * Grab the eseq value, and see whether it matches the value that @since |
163 | * points to. If it does, then just return 0. | 165 | * points to. If it does, then just return 0. |
164 | * | 166 | * |
165 | * If it doesn't, then the value has changed. Set the "seen" flag, and try to | 167 | * If it doesn't, then the value has changed. Set the "seen" flag, and try to |
@@ -170,6 +172,9 @@ EXPORT_SYMBOL(errseq_check); | |||
170 | * value. The caller must provide that if necessary. Because of this, callers | 172 | * value. The caller must provide that if necessary. Because of this, callers |
171 | * may want to do a lockless errseq_check before taking the lock and calling | 173 | * may want to do a lockless errseq_check before taking the lock and calling |
172 | * this. | 174 | * this. |
175 | * | ||
176 | * Return: Negative errno if one has been stored, or 0 if no new error has | ||
177 | * occurred. | ||
173 | */ | 178 | */ |
174 | int errseq_check_and_advance(errseq_t *eseq, errseq_t *since) | 179 | int errseq_check_and_advance(errseq_t *eseq, errseq_t *since) |
175 | { | 180 | { |