From: Tomohiro Kusumi Date: Mon, 21 Dec 2015 13:14:08 +0000 (+0900) Subject: sbin/hammer: Remove vol_alloc from volume_info X-Git-Tag: v4.6.0rc~1133 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/ef927d3e44e4c5152cfd810e0c2b95e0210866d3 sbin/hammer: Remove vol_alloc from volume_info vol_alloc is a fixed sized space before boot/mem/buf area that the filesystem doesn't recognize once initialized. (This area is currently used for nothing) --- diff --git a/sbin/hammer/hammer_util.h b/sbin/hammer/hammer_util.h index d0c06c963c..48469ee9e3 100644 --- a/sbin/hammer/hammer_util.h +++ b/sbin/hammer/hammer_util.h @@ -96,7 +96,6 @@ struct volume_info { struct cache_info cache; TAILQ_ENTRY(volume_info) entry; int vol_no; - hammer_off_t vol_alloc; /* volume-relative offset */ hammer_off_t vol_free_off; /* zone-2 offset */ hammer_off_t vol_free_end; /* zone-2 offset */ diff --git a/sbin/hammer/ondisk.c b/sbin/hammer/ondisk.c index cc02cd9503..cf2f922251 100644 --- a/sbin/hammer/ondisk.c +++ b/sbin/hammer/ondisk.c @@ -209,12 +209,6 @@ check_volume(struct volume_info *vol) vol->device_offset = pinfo.media_offset; vol->type = "DEVICE"; } - - /* - * Reserve space for (future) header junk, setup our poor-man's - * big-block allocator. - */ - vol->vol_alloc = HAMMER_BUFSIZE * 16; } struct volume_info * diff --git a/sbin/newfs_hammer/newfs_hammer.c b/sbin/newfs_hammer/newfs_hammer.c index 1256e210a0..63adbcfb10 100644 --- a/sbin/newfs_hammer/newfs_hammer.c +++ b/sbin/newfs_hammer/newfs_hammer.c @@ -456,6 +456,7 @@ format_volume(struct volume_info *vol, int nvols, const char *label) struct hammer_volume_ondisk *ondisk; int64_t freeblks; int64_t freebytes; + hammer_off_t vol_alloc; int i; /* @@ -470,15 +471,21 @@ format_volume(struct volume_info *vol, int nvols, const char *label) ondisk->vol_count = nvols; ondisk->vol_version = HammerVersion; - ondisk->vol_bot_beg = vol->vol_alloc; - vol->vol_alloc += BootAreaSize; - ondisk->vol_mem_beg = vol->vol_alloc; - vol->vol_alloc += MemAreaSize; + /* + * Reserve space for (future) header junk, setup our poor-man's + * big-block allocator. + */ + vol_alloc = HAMMER_BUFSIZE * 16; /* 262144 */ + + ondisk->vol_bot_beg = vol_alloc; + vol_alloc += BootAreaSize; + ondisk->vol_mem_beg = vol_alloc; + vol_alloc += MemAreaSize; /* * The remaining area is the zone 2 buffer allocation area. */ - ondisk->vol_buf_beg = vol->vol_alloc; + ondisk->vol_buf_beg = vol_alloc; ondisk->vol_buf_end = vol->size & ~(int64_t)HAMMER_BUFMASK; if (ondisk->vol_buf_end < ondisk->vol_buf_beg) {