]> arthur.barton.de Git - netatalk.git/commitdiff
Remove now unused txn stuff
authorFrank Lahm <franklahm@googlemail.com>
Mon, 18 Apr 2011 15:04:05 +0000 (17:04 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Mon, 18 Apr 2011 15:04:05 +0000 (17:04 +0200)
etc/cnid_dbd/cmd_dbd.c
etc/cnid_dbd/cmd_dbd_scanvol.c
etc/cnid_dbd/db_param.h
etc/cnid_dbd/dbif.c

index 002044497cb18c34b4bf94390c2a5fb91f10cc84..ed67a9a54bc14aecf0d38dd3e0a9c8610714a431 100644 (file)
@@ -95,7 +95,6 @@ static struct db_param db_param = {
     DEFAULT_MAXLOCKOBJS,        /* maxlockobjs */
     0,                          /* flush_interval */
     0,                          /* flush_frequency */
-    0,                       /* txn_frequency */
     0,                          /* usock_file */
     -1,                         /* fd_table_size */
     -1,                         /* idle_timeout */
index dd9ee85179cd1100c8c3016a1da858fc9bceae7c..49938af36e8a7e6e04d9b6700b92a718fcb64c71 100644 (file)
@@ -1082,8 +1082,6 @@ static void delete_orphaned_cnids(DBD *dbd, DBD *dbd_rebuild, dbd_flags_t flags)
     struct cnid_dbd_rqst rqst;
     struct cnid_dbd_rply rply;
 
-    dbd->db_param.txn_frequency = 0;
-
     /* jump over rootinfo key */
     if ( dbif_idwalk(dbd, &dbd_cnid, 0) != 1)
         return;
@@ -1198,7 +1196,6 @@ int cmd_dbd_scanvol(DBD *dbd_ref, struct volinfo *vi, dbd_flags_t flags)
     db_param.cachesize = 64 * 1024;         /* 64 MB */
     db_param.maxlocks = DEFAULT_MAXLOCKS;
     db_param.maxlockobjs = DEFAULT_MAXLOCKOBJS;
-    db_param.txn_frequency = 0;          /* close txn every 1000 objects */
     db_param.logfile_autoremove = 1;
 
     /* Make it accessible for all funcs */
index 302b16db93632b6f7617eeafbd635fb97926ea95..f3a4827a031a5f99e5fa055c2232d228539024f2 100644 (file)
@@ -28,7 +28,6 @@ struct db_param {
     int maxlockobjs;
     int flush_interval;
     int flush_frequency;
-    int txn_frequency;
     char usock_file[MAXPATHLEN + 1];    
     int fd_table_size;
     int idle_timeout;
index e8cfdd4cfc51dfa21db6c75161429938b5f134d8..646385cbe267d392e955e8261220c49ff80dc933 100644 (file)
@@ -1007,16 +1007,10 @@ int dbif_txn_abort(DBD *dbd)
 }
 
 /* 
-   ret = 2 -> commit txn regardless of db_param.txn_frequency
    ret = 1 -> commit txn if db_param.txn_frequency
    ret = 0 -> abort txn db_param.txn_frequency -> exit!
    anything else -> exit!
 
-   db_param of the db environment might specify txn_frequency > 1 in which case
-   we only close a txn every txn_frequency time. the `dbd` command uses this for the
-   temp rebuild db, cnid_dbd keeps it at 0. For increasing cnid_dbd throughput this
-   should be tuned and testes as well.
-
    @returns 0 on success (abort or commit), -1 on error
 */
 int dbif_txn_close(DBD *dbd, int ret)
@@ -1026,13 +1020,7 @@ int dbif_txn_close(DBD *dbd, int ret)
             LOG( log_error, logtype_cnid, "Fatal error aborting transaction. Exiting!");
             return -1;
         }
-    } else if (ret == 1 || ret == 2) {
-        static uint count;
-        if (ret != 2 && dbd->db_param.txn_frequency > 1) {
-            count++;
-            if ((count % dbd->db_param.txn_frequency) != 0)
-                return 0;
-        }
+    } else if (ret == 1) {
         ret = dbif_txn_commit(dbd);
         if (  ret < 0) {
             LOG( log_error, logtype_cnid, "Fatal error committing transaction. Exiting!");