aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2014-01-24 11:21:19 -0500
committerJeff Mahoney <jeffm@suse.com>2014-01-24 11:21:19 -0500
commit1f65941572d3f0a622e0d729e2179494eb5dd2e2 (patch)
treebc0ec3f8fcdb12f52814e8dbd87ebb313caa49be
parent31a4390ca65bc22197a66acaf8288aa67104dea6 (diff)
downloadreiserfsprogs-1f65941572d3f0a622e0d729e2179494eb5dd2e2.tar.gz
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>
-rw-r--r--include/reiserfs_lib.h1
-rw-r--r--mkreiserfs/mkreiserfs.c24
-rw-r--r--reiserfscore/reiserfslib.c24
3 files changed, 24 insertions, 25 deletions
diff --git a/include/reiserfs_lib.h b/include/reiserfs_lib.h
index fb97293..18a6a3e 100644
--- a/include/reiserfs_lib.h
+++ b/include/reiserfs_lib.h
@@ -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);
diff --git a/mkreiserfs/mkreiserfs.c b/mkreiserfs/mkreiserfs.c
index 21fd92d..889cda5 100644
--- a/mkreiserfs/mkreiserfs.c
+++ b/mkreiserfs/mkreiserfs.c
@@ -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;
diff --git a/reiserfscore/reiserfslib.c b/reiserfscore/reiserfslib.c
index 5c08ebb..53978d4 100644
--- a/reiserfscore/reiserfslib.c
+++ b/reiserfscore/reiserfslib.c
@@ -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)