From e70d8f07f955853c6eb8893d33d13196aa22f6d9 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 9 Feb 2014 17:24:10 +0100 Subject: [PATCH] file: Rename struct emptypedstr to ef_typedstr Signed-off-by: Markus Armbruster --- include/file.h | 4 ++-- src/lib/common/file.c | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/file.h b/include/file.h index ac6f39e5..4c77060f 100644 --- a/include/file.h +++ b/include/file.h @@ -86,7 +86,7 @@ struct empfile { void (*onresize)(int type); }; -struct emptypedstr { +struct ef_typedstr { signed ef_type: 8; unsigned seqno: 12; unsigned generation: 12; @@ -100,7 +100,7 @@ struct emptypedstr { * The remaining flags record how the table is being used. */ /* Immutable flags, fixed at compile-time */ -/* Dereferencing entry address cast to struct emptypedstr * is safe */ +/* Dereferencing entry address cast to struct ef_typedstr * is safe */ #define EFF_TYPED bit(0) /* * EFF_XY / EFF_OWNER / EFF_GROUP assert that coordinates / owner / diff --git a/src/lib/common/file.c b/src/lib/common/file.c index f2326409..c3e07a1f 100644 --- a/src/lib/common/file.c +++ b/src/lib/common/file.c @@ -469,7 +469,7 @@ do_write(struct empfile *ep, void *buf, int id, int count) { int i, n, ret; char *p; - struct emptypedstr *elt; + struct ef_typedstr *elt; time_t now; if (CANT_HAPPEN(ep->fd < 0 || id < 0 || count < 0)) @@ -482,7 +482,7 @@ do_write(struct empfile *ep, void *buf, int id, int count) * TODO Oopses here could be due to bad data corruption. * Fail instead of attempting to recover? */ - elt = (struct emptypedstr *)((char *)buf + i * ep->size); + elt = (struct ef_typedstr *)((char *)buf + i * ep->size); if (CANT_HAPPEN(elt->ef_type != ep->uid)) elt->ef_type = ep->uid; if (CANT_HAPPEN(elt->uid != id + i)) @@ -585,7 +585,7 @@ ef_write(int type, int id, void *from) void ef_set_uid(int type, void *buf, int uid) { - struct emptypedstr *elt; + struct ef_typedstr *elt; struct empfile *ep; if (ef_check(type) < 0) @@ -608,7 +608,7 @@ ef_set_uid(int type, void *buf, int uid) static unsigned get_seqno(struct empfile *ep, int id) { - struct emptypedstr *elt; + struct ef_typedstr *elt; if (!(ep->flags & EFF_TYPED)) return 0; @@ -637,7 +637,7 @@ get_seqno(struct empfile *ep, int id) static void new_seqno(struct empfile *ep, void *buf) { - struct emptypedstr *elt = buf; + struct ef_typedstr *elt = buf; unsigned old_seqno; if (!(ep->flags & EFF_TYPED)) @@ -673,13 +673,13 @@ ef_mark_fresh(int type, void *buf) ep = &empfile[type]; if (!(ep->flags & EFF_TYPED)) return; - ((struct emptypedstr *)buf)->generation = ef_generation; + ((struct ef_typedstr *)buf)->generation = ef_generation; } static void must_be_fresh(struct empfile *ep, void *buf) { - struct emptypedstr *elt = buf; + struct ef_typedstr *elt = buf; if (!(ep->flags & EFF_TYPED)) return; @@ -767,7 +767,7 @@ void ef_blank(int type, int id, void *buf) { struct empfile *ep; - struct emptypedstr *elt; + struct ef_typedstr *elt; if (ef_check(type) < 0) return; @@ -787,11 +787,11 @@ static void do_blank(struct empfile *ep, void *buf, int id, int count) { int i; - struct emptypedstr *elt; + struct ef_typedstr *elt; memset(buf, 0, count * ep->size); for (i = 0; i < count; i++) { - elt = (struct emptypedstr *)((char *)buf + i * ep->size); + elt = (struct ef_typedstr *)((char *)buf + i * ep->size); if (ep->flags & EFF_TYPED) { elt->ef_type = ep->uid; elt->uid = id + i;