]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/lock.c
tdb2: Correct the comment explaining tdb_brlock().
[ccan] / ccan / tdb2 / lock.c
index c5dd084e82bf04af7c1dee6b12996f25749276cc..b1799a7e1b9aa0ca9ec5652f573ba74ac7019761 100644 (file)
@@ -120,7 +120,7 @@ static int fcntl_unlock(struct tdb_context *tdb, int rw, off_t off, off_t len)
 }
 
 /* a byte range locking function - return 0 on success
-   this functions locks/unlocks 1 byte at the specified offset.
+   this functions locks len bytes at the specified offset.
 
    note that a len of zero means lock to end of file
 */
@@ -452,12 +452,6 @@ enum TDB_ERROR tdb_allrecord_lock(struct tdb_context *tdb, int ltype,
        enum TDB_ERROR ecode;
        tdb_bool_err berr;
 
-       /* FIXME: There are no locks on read-only dbs */
-       if (tdb->read_only) {
-               return tdb_logerr(tdb, TDB_ERR_LOCK, TDB_LOG_USE_ERROR,
-                                 "tdb_allrecord_lock: read-only");
-       }
-
        if (tdb->allrecord_lock.count
            && (ltype == F_RDLCK || tdb->allrecord_lock.ltype == F_WRLCK)) {
                tdb->allrecord_lock.count++;