]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Add heuristics to the mkfs command to make it guesstimate internal log size.
authorMartin K. Petersen <mkp@linuxcare.com>
Fri, 23 Mar 2001 22:09:53 +0000 (22:09 +0000)
committerMartin K. Petersen <mkp@linuxcare.com>
Fri, 23 Mar 2001 22:09:53 +0000 (22:09 +0000)
man/man8/mkfs.xfs.8
mkfs/xfs_mkfs.c

index 7366bcf6d399d00625700bb289d2b9e557c79493..8d0fe48c0fcf0b76aad80dd044b841c3e36cda9d 100644 (file)
@@ -118,9 +118,7 @@ In this case, the log section must be specified as
 (with a size, see the
 .B \-l
 option below) and there can be no real-time section.
-Note that the default log in this case is an internal log with
-at least 1000 blocks, actual size depending on the filesystem block
-size and the directory block size.
+Depending on the filesystem size, mkfs.xfs will try to 
 .IP
 The
 .B file
@@ -252,10 +250,16 @@ If the value is omitted, 1 is assumed.
 The
 .B size
 suboption is used to specify the size of the log section.
-This suboption is required if
-.B \-l internal[=1]
-is given.
-Otherwise, it is only needed if the log section of the filesystem
+.IP
+If the log is contained within the data section and 
+.B size
+isn't specified, mkfs will try to select a suitable log size depending
+on the size of the filesystem.  The actual logsize depends on the
+filesystem block size and the directory block size.
+.IP
+Otherwise, the
+.B size
+option is only needed if the log section of the filesystem
 should occupy less space than the size of the special file.
 The size is specified in bytes or blocks, with a \f3b\f1 suffix 
 meaning multiplication by the filesystem block size, as described above.
index 4c2cf51cca3cfe297b11c58d12a8a43a0f1afeee..aa913a91aa3f526f187c16f3b2e99486f56a5c33 100644 (file)
@@ -1215,8 +1215,11 @@ main(int argc, char **argv)
                usage();
        } else if (!loginternal && !xi.logdev)
                logblocks = 0;
-       else if (loginternal && !logsize)
+       else if (loginternal && !logsize) {
                logblocks = MAX(XFS_DFL_LOG_SIZE, i * XFS_DFL_LOG_FACTOR);
+                logblocks = MAX(logblocks, dblocks / 8192); 
+                logblocks = MIN(logblocks, XFS_MAX_LOG_BLOCKS); 
+        } 
        if (logblocks < min_logblocks) {
                fprintf(stderr,
                "log size %lld blocks too small, minimum size is %d blocks\n",