]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Fix up AG queuing order in phase 4
authorBarry Naujok <bnaujok@sgi.com>
Wed, 15 Aug 2007 04:14:22 +0000 (04:14 +0000)
committerBarry Naujok <bnaujok@sgi.com>
Wed, 15 Aug 2007 04:14:22 +0000 (04:14 +0000)
Merge of master-melb:xfs-cmds:29388a by kenmcd.

  Fix up AG queuing order for prefetch in phase 4

repair/phase4.c

index 44bbac3140a9702b8b07552aae2b70aafbab735a..09353b75a008df8c7551a02792a7c54a53b8905b 100644 (file)
@@ -137,6 +137,7 @@ process_ags(
        xfs_mount_t             *mp)
 {
        int                     i, j;
+       xfs_agnumber_t          agno;
        work_queue_t            *queues;
        prefetch_args_t         *pf_args[2];
 
@@ -153,12 +154,13 @@ process_ags(
                        /*
                         * create one worker thread for each segment of the volume
                         */
-                       for (i = 0; i < thread_count; i++) {
+                       for (i = 0, agno = 0; i < thread_count; i++) {
                                create_work_queue(&queues[i], mp, 1);
                                pf_args[0] = NULL;
-                               for (j = i; j < mp->m_sb.sb_agcount; j += ag_stride) {
-                                       pf_args[0] = start_inode_prefetch(j, 0, pf_args[0]);
-                                       queue_work(&queues[i], process_ag_func, j, pf_args[0]);
+                               for (j = 0; j < ag_stride && agno < mp->m_sb.sb_agcount;
+                                               j++, agno++) {
+                                       pf_args[0] = start_inode_prefetch(agno, 0, pf_args[0]);
+                                       queue_work(&queues[i], process_ag_func, agno, pf_args[0]);
                                }
                        }
                        /*