]> git.pond.sub.org Git - empserver/commitdiff
file: Rename struct emptypedstr to ef_typedstr
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 9 Feb 2014 16:24:10 +0000 (17:24 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 1 Feb 2015 15:53:00 +0000 (16:53 +0100)
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
include/file.h
src/lib/common/file.c

index ac6f39e5b67792c3964180271d80e447e110b1bc..4c77060f9a7e0a3fdaabe81b5e26e63f4e74804d 100644 (file)
@@ -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 /
index f2326409e8b5106f75a69a00b1d5b880f7b9c8ef..c3e07a1f11e11eb77399198fbd9670623ff195ff 100644 (file)
@@ -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;