linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: Jeff Layton <laytonjb@att.net>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Size of journal?
Date: Sun, 10 Jan 2010 23:06:16 -0600	[thread overview]
Message-ID: <4B4AB1C8.3050601@redhat.com> (raw)
In-Reply-To: <4B4A228F.4000205@att.net>

Jeff Layton wrote:
> Good afternoon!
> 
> I was wondering what the default journal size is for ext4
> when it's built on a single partition? Or does it vary in size
> as needed?
> 
> TIA!
> 
> Jeff

See figure_journal_size() in mke2fs.c.  It's called w/ size == -1
if no other size is specified on the commandline so that goes
to ext2fs_default_journal_size(), which is pretty straightforward
in its scaling with nr of filesystem blocks:

/*
 * Find a reasonable journal file size (in blocks) given the number of blocks
 * in the filesystem.  For very small filesystems, it is not reasonable to
 * have a journal that fills more than half of the filesystem.
 */
int ext2fs_default_journal_size(__u64 blocks)
{
        if (blocks < 2048)
                return -1;
        if (blocks < 32768)
                return (1024);
        if (blocks < 256*1024)
                return (4096);
        if (blocks < 512*1024)
                return (8192);
        if (blocks < 1024*1024)
                return (16384);
        return 32768;
}

      reply	other threads:[~2010-01-11  5:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-10 18:55 Size of journal? Jeff Layton
2010-01-11  5:06 ` Eric Sandeen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B4AB1C8.3050601@redhat.com \
    --to=sandeen@redhat.com \
    --cc=laytonjb@att.net \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).