sys/vfs/hammer: Use HAMMER_BUFFERS_PER_BIGBLOCK
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Fri, 10 Jul 2015 13:18:48 +0000 (22:18 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Fri, 10 Jul 2015 16:21:35 +0000 (01:21 +0900)
- It's been defined but not used and good to use it.

sys/vfs/hammer/hammer_disk.h
sys/vfs/hammer/hammer_ondisk.c
sys/vfs/hammer/hammer_volume.c

index 6473811..902faa8 100644 (file)
@@ -328,9 +328,9 @@ typedef struct hammer_blockmap_layer2 *hammer_blockmap_layer2_t;
        (HAMMER_BIGBLOCK_SIZE / sizeof(struct hammer_blockmap_layer2))
 
 #define HAMMER_BLOCKMAP_RADIX1_PERBUFFER       \
-       (HAMMER_BLOCKMAP_RADIX1 / (HAMMER_BIGBLOCK_SIZE / HAMMER_BUFSIZE))
+       (HAMMER_BLOCKMAP_RADIX1 / HAMMER_BUFFERS_PER_BIGBLOCK)
 #define HAMMER_BLOCKMAP_RADIX2_PERBUFFER       \
-       (HAMMER_BLOCKMAP_RADIX2 / (HAMMER_BIGBLOCK_SIZE / HAMMER_BUFSIZE))
+       (HAMMER_BLOCKMAP_RADIX2 / HAMMER_BUFFERS_PER_BIGBLOCK)
 
 #define HAMMER_BLOCKMAP_LAYER1 /* 18+19+23 - 1EB */            \
        (HAMMER_BLOCKMAP_RADIX1 * HAMMER_BLOCKMAP_LAYER2)
index adebae2..e58fae9 100644 (file)
@@ -226,9 +226,9 @@ hammer_install_volume(struct hammer_mount *hmp, const char *volname,
                        bp = NULL;
                }
                hmp->mp->mnt_stat.f_blocks += ondisk->vol0_stat_bigblocks *
-                       (HAMMER_BIGBLOCK_SIZE / HAMMER_BUFSIZE);
+                                               HAMMER_BUFFERS_PER_BIGBLOCK;
                hmp->mp->mnt_vstat.f_blocks += ondisk->vol0_stat_bigblocks *
-                       (HAMMER_BIGBLOCK_SIZE / HAMMER_BUFSIZE);
+                                               HAMMER_BUFFERS_PER_BIGBLOCK;
        }
 late_failure:
        if (bp)
index e6cf38b..134f967 100644 (file)
@@ -185,9 +185,9 @@ hammer_ioc_volume_add(hammer_transaction_t trans, hammer_inode_t ip,
         * Big-block count changed so recompute the total number of blocks.
         */
        mp->mnt_stat.f_blocks = trans->rootvol->ondisk->vol0_stat_bigblocks *
-           (HAMMER_BIGBLOCK_SIZE / HAMMER_BUFSIZE);
+                               HAMMER_BUFFERS_PER_BIGBLOCK;
        mp->mnt_vstat.f_blocks = trans->rootvol->ondisk->vol0_stat_bigblocks *
-           (HAMMER_BIGBLOCK_SIZE / HAMMER_BUFSIZE);
+                               HAMMER_BUFFERS_PER_BIGBLOCK;
 
        /*
         * Increase the number of free big-blocks
@@ -418,9 +418,9 @@ hammer_ioc_volume_del(hammer_transaction_t trans, hammer_inode_t ip,
         * Big-block count changed so recompute the total number of blocks.
         */
        mp->mnt_stat.f_blocks = trans->rootvol->ondisk->vol0_stat_bigblocks *
-           (HAMMER_BIGBLOCK_SIZE / HAMMER_BUFSIZE);
+                               HAMMER_BUFFERS_PER_BIGBLOCK;
        mp->mnt_vstat.f_blocks = trans->rootvol->ondisk->vol0_stat_bigblocks *
-           (HAMMER_BIGBLOCK_SIZE / HAMMER_BUFSIZE);
+                               HAMMER_BUFFERS_PER_BIGBLOCK;
 
        hammer_unlock(&hmp->blkmap_lock);
        hammer_sync_unlock(trans);