linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] btrfs-progs: dont break the string
@ 2014-07-15  8:02 Anand Jain
  2014-07-15  8:02 ` [PATCH 2/2] btrfs-progs: define BTRFS_MKFS_SMALL_VOLUME_SIZE for small volume Anand Jain
  0 siblings, 1 reply; 2+ messages in thread
From: Anand Jain @ 2014-07-15  8:02 UTC (permalink / raw)
  To: linux-btrfs

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 mkfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mkfs.c b/mkfs.c
index 52b9a8d..cba4f02 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1336,8 +1336,8 @@ int main(int ac, char **av)
 			case 'b':
 				block_count = parse_size(optarg);
 				if (block_count <= 1024*1024*1024) {
-					printf("SMALL VOLUME: forcing mixed "
-					       "metadata/data groups\n");
+					fprintf(stdout,
+				"SMALL VOLUME: forcing mixed metadata/data groups\n");
 					mixed = 1;
 				}
 				zero_end = 0;
-- 
2.0.0.153.g79dcccc


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] btrfs-progs: define BTRFS_MKFS_SMALL_VOLUME_SIZE for small volume
  2014-07-15  8:02 [PATCH 1/2] btrfs-progs: dont break the string Anand Jain
@ 2014-07-15  8:02 ` Anand Jain
  0 siblings, 0 replies; 2+ messages in thread
From: Anand Jain @ 2014-07-15  8:02 UTC (permalink / raw)
  To: linux-btrfs

mkfs cut of size '1024 * 1024 * 1024' to mark dev as small volume so to
force mixed group. Use a define for that.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 mkfs.c  | 2 +-
 utils.c | 4 ++--
 utils.h | 1 +
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/mkfs.c b/mkfs.c
index cba4f02..d980d4a 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1335,7 +1335,7 @@ int main(int ac, char **av)
 				break;
 			case 'b':
 				block_count = parse_size(optarg);
-				if (block_count <= 1024*1024*1024) {
+				if (block_count <= BTRFS_MKFS_SMALL_VOLUME_SIZE) {
 					fprintf(stdout,
 				"SMALL VOLUME: forcing mixed metadata/data groups\n");
 					mixed = 1;
diff --git a/utils.c b/utils.c
index 159f2a2..673134e 100644
--- a/utils.c
+++ b/utils.c
@@ -705,7 +705,7 @@ int btrfs_prepare_device(int fd, char *file, int zero_end, u64 *block_count_ret,
 	if (max_block_count)
 		block_count = min(block_count, max_block_count);
 
-	if (block_count < 1024 * 1024 * 1024 && !(*mixed)) {
+	if (block_count < BTRFS_MKFS_SMALL_VOLUME_SIZE && !(*mixed)) {
 		printf("SMALL VOLUME: forcing mixed metadata/data groups\n");
 		*mixed = 1;
 	}
@@ -2351,7 +2351,7 @@ int is_vol_small(char *file)
 		close(fd);
 		return -1;
 	}
-	if (size < 1024 * 1024 * 1024) {
+	if (size < BTRFS_MKFS_SMALL_VOLUME_SIZE) {
 		close(fd);
 		return 1;
 	} else {
diff --git a/utils.h b/utils.h
index 5bc22ec..ddf31cf 100644
--- a/utils.h
+++ b/utils.h
@@ -24,6 +24,7 @@
 #include <dirent.h>
 
 #define BTRFS_MKFS_SYSTEM_GROUP_SIZE (4 * 1024 * 1024)
+#define BTRFS_MKFS_SMALL_VOLUME_SIZE (1024 * 1024 * 1024)
 
 #define BTRFS_SCAN_PROC		(1ULL << 0)
 #define BTRFS_SCAN_DEV		(1ULL << 1)
-- 
2.0.0.153.g79dcccc


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-15  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-15  8:02 [PATCH 1/2] btrfs-progs: dont break the string Anand Jain
2014-07-15  8:02 ` [PATCH 2/2] btrfs-progs: define BTRFS_MKFS_SMALL_VOLUME_SIZE for small volume Anand Jain

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).