file: Rename struct emptypedstr to ef_typedstr

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2014-02-09 17:24:10 +01:00
parent 8afb9c8cb7
commit e70d8f07f9
2 changed files with 12 additions and 12 deletions

View file

@ -86,7 +86,7 @@ struct empfile {
void (*onresize)(int type); void (*onresize)(int type);
}; };
struct emptypedstr { struct ef_typedstr {
signed ef_type: 8; signed ef_type: 8;
unsigned seqno: 12; unsigned seqno: 12;
unsigned generation: 12; unsigned generation: 12;
@ -100,7 +100,7 @@ struct emptypedstr {
* The remaining flags record how the table is being used. * The remaining flags record how the table is being used.
*/ */
/* Immutable flags, fixed at compile-time */ /* 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) #define EFF_TYPED bit(0)
/* /*
* EFF_XY / EFF_OWNER / EFF_GROUP assert that coordinates / owner / * EFF_XY / EFF_OWNER / EFF_GROUP assert that coordinates / owner /

View file

@ -469,7 +469,7 @@ do_write(struct empfile *ep, void *buf, int id, int count)
{ {
int i, n, ret; int i, n, ret;
char *p; char *p;
struct emptypedstr *elt; struct ef_typedstr *elt;
time_t now; time_t now;
if (CANT_HAPPEN(ep->fd < 0 || id < 0 || count < 0)) 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. * TODO Oopses here could be due to bad data corruption.
* Fail instead of attempting to recover? * 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)) if (CANT_HAPPEN(elt->ef_type != ep->uid))
elt->ef_type = ep->uid; elt->ef_type = ep->uid;
if (CANT_HAPPEN(elt->uid != id + i)) if (CANT_HAPPEN(elt->uid != id + i))
@ -585,7 +585,7 @@ ef_write(int type, int id, void *from)
void void
ef_set_uid(int type, void *buf, int uid) ef_set_uid(int type, void *buf, int uid)
{ {
struct emptypedstr *elt; struct ef_typedstr *elt;
struct empfile *ep; struct empfile *ep;
if (ef_check(type) < 0) if (ef_check(type) < 0)
@ -608,7 +608,7 @@ ef_set_uid(int type, void *buf, int uid)
static unsigned static unsigned
get_seqno(struct empfile *ep, int id) get_seqno(struct empfile *ep, int id)
{ {
struct emptypedstr *elt; struct ef_typedstr *elt;
if (!(ep->flags & EFF_TYPED)) if (!(ep->flags & EFF_TYPED))
return 0; return 0;
@ -637,7 +637,7 @@ get_seqno(struct empfile *ep, int id)
static void static void
new_seqno(struct empfile *ep, void *buf) new_seqno(struct empfile *ep, void *buf)
{ {
struct emptypedstr *elt = buf; struct ef_typedstr *elt = buf;
unsigned old_seqno; unsigned old_seqno;
if (!(ep->flags & EFF_TYPED)) if (!(ep->flags & EFF_TYPED))
@ -673,13 +673,13 @@ ef_mark_fresh(int type, void *buf)
ep = &empfile[type]; ep = &empfile[type];
if (!(ep->flags & EFF_TYPED)) if (!(ep->flags & EFF_TYPED))
return; return;
((struct emptypedstr *)buf)->generation = ef_generation; ((struct ef_typedstr *)buf)->generation = ef_generation;
} }
static void static void
must_be_fresh(struct empfile *ep, void *buf) must_be_fresh(struct empfile *ep, void *buf)
{ {
struct emptypedstr *elt = buf; struct ef_typedstr *elt = buf;
if (!(ep->flags & EFF_TYPED)) if (!(ep->flags & EFF_TYPED))
return; return;
@ -767,7 +767,7 @@ void
ef_blank(int type, int id, void *buf) ef_blank(int type, int id, void *buf)
{ {
struct empfile *ep; struct empfile *ep;
struct emptypedstr *elt; struct ef_typedstr *elt;
if (ef_check(type) < 0) if (ef_check(type) < 0)
return; return;
@ -787,11 +787,11 @@ static void
do_blank(struct empfile *ep, void *buf, int id, int count) do_blank(struct empfile *ep, void *buf, int id, int count)
{ {
int i; int i;
struct emptypedstr *elt; struct ef_typedstr *elt;
memset(buf, 0, count * ep->size); memset(buf, 0, count * ep->size);
for (i = 0; i < count; i++) { 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) { if (ep->flags & EFF_TYPED) {
elt->ef_type = ep->uid; elt->ef_type = ep->uid;
elt->uid = id + i; elt->uid = id + i;