On 2018/9/26 下午3:36, Anand Jain wrote:
> 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 was obsolete since then so clean it up.
> 
> Signed-off-by: Anand Jain <anand.j...@oracle.com>
> ---
>  mkfs/common.c | 29 -----------------------------
>  mkfs/common.h |  1 -
>  2 files changed, 30 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..18f5c3b66270 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

Wait for a minute, is_vol_small()'s declaration is not removed.

Did I miss something? Or it's already removed by some newer commit?

Thanks,
Qu

>  
>  /*
>   * Tree root blocks created during mkfs
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to