]> git.ozlabs.org Git - ccan/commitdiff
tdb2: rename tdb_lock_type to tdb_lock
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 17 Mar 2011 11:42:21 +0000 (22:12 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 17 Mar 2011 11:42:21 +0000 (22:12 +1030)
Internal reshuffle which makes things shorter and neater.

ccan/tdb2/lock.c
ccan/tdb2/private.h

index 19da88e2c02a0e3cf96b39d951b211e31e57bc75..8e73c253cb5ba4eac0ba9cc3c54fbe62ecbc9132 100644 (file)
@@ -236,8 +236,7 @@ enum TDB_ERROR tdb_allrecord_upgrade(struct tdb_context *tdb)
                          "tdb_allrecord_upgrade failed");
 }
 
                          "tdb_allrecord_upgrade failed");
 }
 
-static struct tdb_lock_type *find_nestlock(struct tdb_context *tdb,
-                                          tdb_off_t offset)
+static struct tdb_lock *find_nestlock(struct tdb_context *tdb, tdb_off_t offset)
 {
        unsigned int i;
 
 {
        unsigned int i;
 
@@ -276,7 +275,7 @@ static enum TDB_ERROR tdb_nest_lock(struct tdb_context *tdb,
                                    tdb_off_t offset, int ltype,
                                    enum tdb_lock_flags flags)
 {
                                    tdb_off_t offset, int ltype,
                                    enum tdb_lock_flags flags)
 {
-       struct tdb_lock_type *new_lck;
+       struct tdb_lock *new_lck;
        enum TDB_ERROR ecode;
 
        if (offset > (TDB_HASH_LOCK_START + TDB_HASH_LOCK_RANGE
        enum TDB_ERROR ecode;
 
        if (offset > (TDB_HASH_LOCK_START + TDB_HASH_LOCK_RANGE
@@ -311,7 +310,7 @@ static enum TDB_ERROR tdb_nest_lock(struct tdb_context *tdb,
                                  "tdb_nest_lock: already have a hash lock?");
        }
 
                                  "tdb_nest_lock: already have a hash lock?");
        }
 
-       new_lck = (struct tdb_lock_type *)realloc(
+       new_lck = (struct tdb_lock *)realloc(
                tdb->file->lockrecs,
                sizeof(*tdb->file->lockrecs) * (tdb->file->num_lockrecs+1));
        if (new_lck == NULL) {
                tdb->file->lockrecs,
                sizeof(*tdb->file->lockrecs) * (tdb->file->num_lockrecs+1));
        if (new_lck == NULL) {
@@ -360,7 +359,7 @@ static enum TDB_ERROR tdb_nest_lock(struct tdb_context *tdb,
 static enum TDB_ERROR tdb_nest_unlock(struct tdb_context *tdb,
                                      tdb_off_t off, int ltype)
 {
 static enum TDB_ERROR tdb_nest_unlock(struct tdb_context *tdb,
                                      tdb_off_t off, int ltype)
 {
-       struct tdb_lock_type *lck;
+       struct tdb_lock *lck;
        enum TDB_ERROR ecode;
 
        if (tdb->flags & TDB_NOLOCK)
        enum TDB_ERROR ecode;
 
        if (tdb->flags & TDB_NOLOCK)
index 762cdd12442a06ab7370fd3c631d8389b80923dd..d1f12b5531ff6843a8f94bd8182cd7156709e765 100644 (file)
@@ -300,7 +300,7 @@ enum tdb_lock_flags {
        TDB_LOCK_NOCHECK = 4,
 };
 
        TDB_LOCK_NOCHECK = 4,
 };
 
-struct tdb_lock_type {
+struct tdb_lock {
        uint32_t off;
        uint32_t count;
        uint32_t ltype;
        uint32_t off;
        uint32_t count;
        uint32_t ltype;
@@ -329,9 +329,9 @@ struct tdb_file {
        int fd;
 
        /* Lock information */
        int fd;
 
        /* Lock information */
-       struct tdb_lock_type allrecord_lock;
+       struct tdb_lock allrecord_lock;
        size_t num_lockrecs;
        size_t num_lockrecs;
-       struct tdb_lock_type *lockrecs;
+       struct tdb_lock *lockrecs;
 
        /* Identity of this file. */
        dev_t device;
 
        /* Identity of this file. */
        dev_t device;