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:
1 parent
31a4390ca6
commit
1f65941572
3 files changed
+24
-25
No files matched your search
@@ -91,7 +91,6 @@ void reiserfs_read_bitmap_blocks (reiserfs_filsys_t );
|
||||
void reiserfs_free_bitmap_blocks (reiserfs_filsys_t );
|
||||
*/
|
||||
int no_reiserfs_found(reiserfs_filsys_t );
|
||||
int block_size_ok(int blocksize, int force);
|
||||
int is_block_count_correct(unsigned long block_of_super_block,
|
||||
unsigned int block_size, unsigned long block_count,
|
||||
unsigned long journal_size);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1227,30 +1227,6 @@ void make_sure_root_dir_exists(reiserfs_filsys_t fs,
|
||||
&parent_root_dir_key, ih_flags);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/* we only can use a file for filesystem or journal if it is either not
|
||||
mounted block device or regular file and we are forced to use it */
|
||||
int can_we_format_it(char *device_name, int force)
|
||||
|
||||
Reference in new issue
Block a user