mkreiserfs: move block_size_ok out of reiserfscore

block_size_ok is only used in mkreiserfs. We can pull it out of the
library.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
This commit is contained in:
Jeff Mahoney committed 2014-01-24 11:21:19 -05:00
1 parent 31a4390ca6
commit 1f65941572
3 files changed
+24 -25

No files matched your search

+24
View File
@@ -543,6 +543,30 @@ static int select_format(void)
return REISERFS_FORMAT_3_5;
}
static int block_size_ok(int blocksize, int force)
{
int pagesize = getpagesize();
if (blocksize > 4096) {
reiserfs_warning(stderr, "Block sizes larger than 4k are not "
"supported on all architectures.\n");
if (blocksize > pagesize)
reiserfs_warning(stderr,
"The newly created filesystem will not "
"be mountable on this system.\n");
else
reiserfs_warning(stderr,
"The newly created filesystem may not "
"be mountable on other systems.\n");
check_forcing_ask_confirmation(force);
} else if (blocksize < 4096) {
reiserfs_warning(stderr, "Block sizes smaller than 4k "
"are not supported.\n");
return 0;
}
return 1;
}
int main(int argc, char **argv)
{
reiserfs_filsys_t fs;