sys/vfs/hammer: Change ondisk vol_nblocks/blocksize to reserved
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 26 Mar 2016 05:03:55 +0000 (14:03 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sun, 27 Mar 2016 15:43:22 +0000 (00:43 +0900)
These were added in fbc6e32a in 2007 in the early stage of HAMMER,
but vol_nblocks wasn't used after 9480ff55 in 2008. vol_blocksize
was never used.

HAMMER volumes have these set by newfs_hammer and hammer volume-add,
but today they are just there for nothing (with obvious values).

The existing HAMMER volumes will keep having vol_nblocks/blocksize
fields initially set by newfs_hammer or added by hammer volume-add,
but new volumes created or added from now on will have 0 for these.
It doesn't erase what's in the existing volume headers.

(There shouldn't be external userspace code that refers to these)

sbin/newfs_hammer/newfs_hammer.c
sys/vfs/hammer/hammer_disk.h
sys/vfs/hammer/hammer_volume.c

index 535873a..98b5250 100644 (file)
@@ -493,9 +493,6 @@ format_volume(struct volume_info *vol, int nvols, const char *label)
                     vol->vol_no, vol->name);
        }
 
-       ondisk->vol_nblocks = vol_buf_size / HAMMER_BUFSIZE;
-       ondisk->vol_blocksize = HAMMER_BUFSIZE;
-
        ondisk->vol_rootvol = HAMMER_ROOT_VOLNO;
        ondisk->vol_signature = HAMMER_FSBUF_VOLUME;
 
index cb0cde1..1c54119 100644 (file)
@@ -670,9 +670,8 @@ struct hammer_volume_ondisk {
        uint32_t vol_reserved06;
        uint32_t vol_reserved07;
 
-       int32_t vol_blocksize;          /* for statfs only */
-       int32_t vol_reserved08;
-       int64_t vol_nblocks;            /* total allocatable hammer bufs */
+       int64_t vol_reserved08;
+       int64_t vol_reserved09;
 
        /*
         * These fields are initialized and space is reserved in every
index 73d6cdb..04106a5 100644 (file)
@@ -643,9 +643,6 @@ hammer_format_volume_header(struct hammer_mount *hmp,
                return(EFTYPE);
        }
 
-       ondisk->vol_nblocks = (ondisk->vol_buf_end - ondisk->vol_buf_beg) /
-                             HAMMER_BUFSIZE;
-       ondisk->vol_blocksize = HAMMER_BUFSIZE;
        return(0);
 }