Commit 889a8e4c authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

White-space & comment cleanup

parent 5cbd8caa
......@@ -49,10 +49,10 @@
/*--------------------------------------------------------------------*/
struct vsm_range {
unsigned magic;
unsigned magic;
#define VSM_RANGE_MAGIC 0x8d30f14
VTAILQ_ENTRY(vsm_range) list;
ssize_t off;
ssize_t off;
ssize_t len;
double cool;
struct VSM_chunk *chunk;
......@@ -60,7 +60,7 @@ struct vsm_range {
};
struct vsm_sc {
unsigned magic;
unsigned magic;
#define VSM_SC_MAGIC 0x8b83270d
char *b;
ssize_t len;
......@@ -236,7 +236,7 @@ VSM_common_alloc(struct vsm_sc *sc, ssize_t size,
vr3 = VTAILQ_FIRST(&sc->r_used);
VTAILQ_INSERT_HEAD(&sc->r_used, vr, list);
if (vr3 != NULL) {
if (vr3 != NULL) {
AZ(vr3->chunk->next);
vr3->chunk->next = vr->off;
} else {
......
......@@ -26,62 +26,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*
* TODO:
*
* There is a risk that the child process might corrupt the VSM segment
* and we should capture that event and recover gracefully.
*
* A possible state diagram could be:
*
* [manager start]
* |
* v
* Open old VSM,
* check pid --------> exit/fail (-n message)
* |
* +<----------------------+
* | ^
* v |
* Create new VSM |
* | |
* v |
* Init header |
* Alloc VSL |
* Alloc VSC:Main |
* Alloc Args etc. |
* | |
* +<--------------+ |
* | ^ |
* v | |
* start worker | |
* | | |
* | | +<---- worker crash
* v | ^
* Reset VSL ptr. | |
* Reset VSC counters | |
* | | |
* +<------+ | |
* | ^ | |
* v | | |
* alloc dynamics | | |
* free dynamics | | |
* | | | |
* v | | |
* +------>+ | |
* | | |
* v | |
* stop worker | |
* | | |
* v | |
* Check consist---------- | ----->+
* | |
* v |
* Free dynamics |
* | |
* v |
* +-------------->+
*
*/
#include "config.h"
......@@ -241,7 +185,7 @@ mgt_SHM_Init(void)
bprintf(fnbuf, "%s.%jd", VSM_FILENAME, (intmax_t)getpid());
vsm_fd = vsm_zerofile(fnbuf, size);
if (vsm_fd < 0)
if (vsm_fd < 0)
exit(1);
p = (void *)mmap(NULL, size,
......
......@@ -212,7 +212,7 @@ VCLI_ReadResult(int fd, unsigned *status, char **ptr, double tmo)
break;
if (p[v] != '\n')
break;
p[v] = '\0';
if (ptr == NULL)
free(p);
......
......@@ -292,7 +292,7 @@ iter_call(const struct vsc *vsc, VSC_iter_f *func, void *priv,
int i; \
\
CHECK_OBJ_NOTNULL(vsc, VSC_MAGIC); \
st = vf->b; \
st = vf->b; \
sp.class = t; \
sp.ident = vf->chunk->ident;
......
......@@ -141,7 +141,7 @@ VSM_Delete(struct VSM_data *vd)
*
* Return:
* 0 = sucess
* <0 = failure
* <0 = failure
*
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment