X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftdb2%2Ftest%2Flock-tracking.c;h=e253db9f710e6860ef2c4d7758daa5e010693a71;hp=05dba32fd3fb9d0fa34999dd11dfc0453706c902;hb=380372e733416c2b348d5307f536d0a0807e95df;hpb=5e8b9af5e7fe5f1ccac407873a3b782b8a629782 diff --git a/ccan/tdb2/test/lock-tracking.c b/ccan/tdb2/test/lock-tracking.c index 05dba32f..e253db9f 100644 --- a/ccan/tdb2/test/lock-tracking.c +++ b/ccan/tdb2/test/lock-tracking.c @@ -1,10 +1,10 @@ /* We save the locks so we can reaquire them. */ +#include #include #include #include #include #include -#include #include "lock-tracking.h" struct lock { @@ -110,6 +110,17 @@ int fcntl_with_lockcheck(int fd, int cmd, ... /* arg */ ) i->type = F_WRLCK; goto done; } + /* allrecord upgrade for tdb1. */ + if (i->type == F_RDLCK && fl->l_type == F_WRLCK + && i->off == TDB1_FREELIST_TOP + && fl->l_start == TDB1_FREELIST_TOP + && i->len == 0 + && fl->l_len == 0) { + if (ret == 0) + i->type = F_WRLCK; + goto done; + } + if (!suppress_lockcheck) { diag("%s lock %u@%u overlaps %u@%u", fl->l_type == F_WRLCK ? "write" : "read",