[PATCH v2] btrfs-progs: delete unused is_vol_small() and BTRFS_MKFS_SMALL_VOLUME_SIZE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since commit c11e36a29e84 (Btrfs-progs: Do not force mixed block group
creation unless '-M' option is specified) we don't have automatic
mixed mode, and the function is_vol_small() and
the define BTRFS_MKFS_SMALL_VOLUME_SIZE become obsolete, so clean it up.

Signed-off-by: Anand Jain <anand.jain@xxxxxxxxxx>
---
v1->v2: drop is_vol_small() in mkfs/common.h
 mkfs/common.c | 29 -----------------------------
 mkfs/common.h |  2 --
 2 files changed, 31 deletions(-)

diff --git a/mkfs/common.c b/mkfs/common.c
index 0ace262b0e5f..c59e1d8eda4a 100644
--- a/mkfs/common.c
+++ b/mkfs/common.c
@@ -772,35 +772,6 @@ int test_status_for_mkfs(const char *file, bool force_overwrite)
 	return 0;
 }
 
-int is_vol_small(const char *file)
-{
-	int fd = -1;
-	int e;
-	struct stat st;
-	u64 size;
-
-	fd = open(file, O_RDONLY);
-	if (fd < 0)
-		return -errno;
-	if (fstat(fd, &st) < 0) {
-		e = -errno;
-		close(fd);
-		return e;
-	}
-	size = btrfs_device_size(fd, &st);
-	if (size == 0) {
-		close(fd);
-		return -1;
-	}
-	if (size < BTRFS_MKFS_SMALL_VOLUME_SIZE) {
-		close(fd);
-		return 1;
-	} else {
-		close(fd);
-		return 0;
-	}
-}
-
 int test_minimum_size(const char *file, u64 min_dev_size)
 {
 	int fd;
diff --git a/mkfs/common.h b/mkfs/common.h
index 28912906d0a9..b0ac3e35c6e9 100644
--- a/mkfs/common.h
+++ b/mkfs/common.h
@@ -26,7 +26,6 @@
 #include "common-defs.h"
 
 #define BTRFS_MKFS_SYSTEM_GROUP_SIZE SZ_4M
-#define BTRFS_MKFS_SMALL_VOLUME_SIZE SZ_1G
 
 /*
  * Tree root blocks created during mkfs
@@ -69,7 +68,6 @@ int make_btrfs(int fd, struct btrfs_mkfs_config *cfg);
 u64 btrfs_min_dev_size(u32 nodesize, int mixed, u64 meta_profile,
 		       u64 data_profile);
 int test_minimum_size(const char *file, u64 min_dev_size);
-int is_vol_small(const char *file);
 int test_num_disk_vs_raid(u64 metadata_profile, u64 data_profile,
 	u64 dev_cnt, int mixed, int ssd);
 int test_status_for_mkfs(const char *file, bool force_overwrite);
-- 
1.8.3.1




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux