]> arthur.barton.de Git - netatalk.git/blobdiff - libatalk/cnid/cdb/cnid_cdb_rebuild_add.c
Support for using $u username variable in AFP volume definitions
[netatalk.git] / libatalk / cnid / cdb / cnid_cdb_rebuild_add.c
index 8dc58240b9954603505771ad939917d383d288d8..951674656c85931f45edd6cdf7a4fa8c99fe8a4b 100644 (file)
@@ -1,5 +1,4 @@
 /*
- * $Id: cnid_cdb_rebuild_add.c,v 1.4 2009-10-29 13:17:29 didg Exp $
  *
  * All Rights Reserved. See COPYRIGHT.
  *
@@ -73,16 +72,14 @@ cleanup:
     return CNID_INVALID;
 }
 
-/* ------------------------ */
 cnid_t cnid_cdb_rebuild_add(struct _cnid_db *cdb, const struct stat *st,
-                const cnid_t did, char *name, const size_t len, 
-               cnid_t hint)
+                            cnid_t did, const char *name, size_t len, cnid_t hint)
 {
     CNID_private *db;
     DBT key, data;
     int rc;
 
-    if (!cdb || !(db = cdb->_private) || !st || !name || hint == CNID_INVALID || hint < CNID_START) {
+    if (!cdb || !(db = cdb->cnid_db_private) || !st || !name || hint == CNID_INVALID || hint < CNID_START) {
         errno = CNID_ERR_PARAM;
         return CNID_INVALID;
     }
@@ -94,7 +91,7 @@ cnid_t cnid_cdb_rebuild_add(struct _cnid_db *cdb, const struct stat *st,
     /* ... Return id if it is valid, or if Rootinfo is read-only. */
     if (id || (db->flags & CNIDFLAG_DB_RO)) {
 #ifdef DEBUG
-        LOG(log_debug, logtype_default, "cnid_add: Looked up did %u, name %s as %u", ntohl(did), name, ntohl(id));
+        LOG(log_debug9, logtype_default, "cnid_add: Looked up did %u, name %s as %u", ntohl(did), name, ntohl(id));
 #endif
         return id;
     }
@@ -104,7 +101,7 @@ cnid_t cnid_cdb_rebuild_add(struct _cnid_db *cdb, const struct stat *st,
     memset(&key, 0, sizeof(key));
     memset(&data, 0, sizeof(data));
 
-    if ((data.data = make_cnid_data(st, did, name, len)) == NULL) {
+    if ((data.data = make_cnid_data(cdb->cnid_db_flags, st, did, name, len)) == NULL) {
         LOG(log_error, logtype_default, "cnid_add: Path name is too long");
         errno = CNID_ERR_PATH;
         return CNID_INVALID;
@@ -131,7 +128,7 @@ cnid_t cnid_cdb_rebuild_add(struct _cnid_db *cdb, const struct stat *st,
     }
 
 #ifdef DEBUG
-    LOG(log_debug, logtype_default, "cnid_add: Returned CNID for did %u, name %s as %u", ntohl(did), name, ntohl(hint));
+    LOG(log_debug9, logtype_default, "cnid_add: Returned CNID for did %u, name %s as %u", ntohl(did), name, ntohl(hint));
 #endif
 
     return hint;