FileJournal: ignore osd journal size for block devices

Using part of a block device doesn't make much sense. This makes the
common case, where you partition a disk to act as several journals,
easier to configure.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Josh Durgin 2012-10-08 17:59:36 -07:00 committed by Sage Weil
parent df1d17fc4b
commit 97c2f196a3
2 changed files with 5 additions and 15 deletions

View File

@ -27,7 +27,7 @@
``osd journal size``
:Description: The size of the journal in megabytes. If this is 0, and the journal is a block device, the entire block device is used.
:Description: The size of the journal in megabytes. If this is 0, and the journal is a block device, the entire block device is used. Since v0.54, this is ignored if the journal is a block device, and the entire block device is used.
:Type: 32-bit Integer
:Default: ``1024``
:Recommended: Begin with 1GB. Should at least twice the product of the expected speed multiplied by ``filestore min sync interval``.

View File

@ -139,20 +139,10 @@ int FileJournal::_open_block_device()
int64_t conf_journal_sz(g_conf->osd_journal_size);
conf_journal_sz <<= 20;
if (conf_journal_sz == 0) {
dout(10) << __func__ << ": no journal size specified in configuration. "
<< "We'll use the entire block device (size: " << bdev_sz << ")" << dendl;
max_size = bdev_sz;
}
else if (bdev_sz > conf_journal_sz) {
dout(10) << __func__ << ": using " << conf_journal_sz << " bytes "
<< "of a " << bdev_sz << " byte block device." << dendl;
max_size = conf_journal_sz;
} else {
dout(0) << __func__ << ": WARNING: configured 'osd journal size' is "
<< conf_journal_sz << ", but " << fn << " is only "
<< bdev_sz << " bytes." << dendl;
}
dout(10) << __func__ << ": ignoring osd journal size. "
<< "We'll use the entire block device (size: " << bdev_sz << ")"
<< dendl;
max_size = bdev_sz;
/* block devices have to write in blocks of CEPH_PAGE_SIZE */
block_size = CEPH_PAGE_SIZE;