@@ -601,18 +601,8 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
601
601
}
602
602
break ;
603
603
case Opt_alloc_start :
604
- num = match_strdup (& args [0 ]);
605
- if (num ) {
606
- mutex_lock (& info -> chunk_mutex );
607
- info -> alloc_start = memparse (num , NULL );
608
- mutex_unlock (& info -> chunk_mutex );
609
- kfree (num );
610
- btrfs_info (info , "allocations start at %llu" ,
611
- info -> alloc_start );
612
- } else {
613
- ret = - ENOMEM ;
614
- goto out ;
615
- }
604
+ btrfs_info (info ,
605
+ "option alloc_start is obsolete, ignored" );
616
606
break ;
617
607
case Opt_acl :
618
608
#ifdef CONFIG_BTRFS_FS_POSIX_ACL
@@ -1232,8 +1222,6 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
1232
1222
seq_puts (seq , ",nobarrier" );
1233
1223
if (info -> max_inline != BTRFS_DEFAULT_MAX_INLINE )
1234
1224
seq_printf (seq , ",max_inline=%llu" , info -> max_inline );
1235
- if (info -> alloc_start != 0 )
1236
- seq_printf (seq , ",alloc_start=%llu" , info -> alloc_start );
1237
1225
if (info -> thread_pool_size != min_t (unsigned long ,
1238
1226
num_online_cpus () + 2 , 8 ))
1239
1227
seq_printf (seq , ",thread_pool=%d" , info -> thread_pool_size );
@@ -1716,7 +1704,6 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
1716
1704
unsigned long old_opts = fs_info -> mount_opt ;
1717
1705
unsigned long old_compress_type = fs_info -> compress_type ;
1718
1706
u64 old_max_inline = fs_info -> max_inline ;
1719
- u64 old_alloc_start = fs_info -> alloc_start ;
1720
1707
int old_thread_pool_size = fs_info -> thread_pool_size ;
1721
1708
unsigned int old_metadata_ratio = fs_info -> metadata_ratio ;
1722
1709
int ret ;
@@ -1855,9 +1842,6 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
1855
1842
fs_info -> mount_opt = old_opts ;
1856
1843
fs_info -> compress_type = old_compress_type ;
1857
1844
fs_info -> max_inline = old_max_inline ;
1858
- mutex_lock (& fs_info -> chunk_mutex );
1859
- fs_info -> alloc_start = old_alloc_start ;
1860
- mutex_unlock (& fs_info -> chunk_mutex );
1861
1845
btrfs_resize_thread_pool (fs_info ,
1862
1846
old_thread_pool_size , fs_info -> thread_pool_size );
1863
1847
fs_info -> metadata_ratio = old_metadata_ratio ;
@@ -1904,11 +1888,9 @@ static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info,
1904
1888
u64 skip_space ;
1905
1889
u64 type ;
1906
1890
u64 avail_space ;
1907
- u64 used_space ;
1908
1891
u64 min_stripe_size ;
1909
1892
int min_stripes = 1 , num_stripes = 1 ;
1910
1893
int i = 0 , nr_devices ;
1911
- int ret ;
1912
1894
1913
1895
/*
1914
1896
* We aren't under the device list lock, so this is racy-ish, but good
@@ -1948,8 +1930,6 @@ static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info,
1948
1930
else
1949
1931
min_stripe_size = BTRFS_STRIPE_LEN ;
1950
1932
1951
- if (fs_info -> alloc_start )
1952
- mutex_lock (& fs_devices -> device_list_mutex );
1953
1933
rcu_read_lock ();
1954
1934
list_for_each_entry_rcu (device , & fs_devices -> devices , dev_list ) {
1955
1935
if (!device -> in_fs_metadata || !device -> bdev ||
@@ -1972,34 +1952,6 @@ static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info,
1972
1952
*/
1973
1953
skip_space = SZ_1M ;
1974
1954
1975
- /* user can set the offset in fs_info->alloc_start. */
1976
- if (fs_info -> alloc_start &&
1977
- fs_info -> alloc_start + BTRFS_STRIPE_LEN <=
1978
- device -> total_bytes ) {
1979
- rcu_read_unlock ();
1980
- skip_space = max (fs_info -> alloc_start , skip_space );
1981
-
1982
- /*
1983
- * btrfs can not use the free space in
1984
- * [0, skip_space - 1], we must subtract it from the
1985
- * total. In order to implement it, we account the used
1986
- * space in this range first.
1987
- */
1988
- ret = btrfs_account_dev_extents_size (device , 0 ,
1989
- skip_space - 1 ,
1990
- & used_space );
1991
- if (ret ) {
1992
- kfree (devices_info );
1993
- mutex_unlock (& fs_devices -> device_list_mutex );
1994
- return ret ;
1995
- }
1996
-
1997
- rcu_read_lock ();
1998
-
1999
- /* calc the free space in [0, skip_space - 1] */
2000
- skip_space -= used_space ;
2001
- }
2002
-
2003
1955
/*
2004
1956
* we can use the free space in [0, skip_space - 1], subtract
2005
1957
* it from the total.
@@ -2018,8 +1970,6 @@ static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info,
2018
1970
i ++ ;
2019
1971
}
2020
1972
rcu_read_unlock ();
2021
- if (fs_info -> alloc_start )
2022
- mutex_unlock (& fs_devices -> device_list_mutex );
2023
1973
2024
1974
nr_devices = i ;
2025
1975
@@ -2056,10 +2006,9 @@ static int btrfs_calc_avail_data_space(struct btrfs_fs_info *fs_info,
2056
2006
* multiplier to scale the sizes.
2057
2007
*
2058
2008
* Unused device space usage is based on simulating the chunk allocator
2059
- * algorithm that respects the device sizes, order of allocations and the
2060
- * 'alloc_start' value, this is a close approximation of the actual use but
2061
- * there are other factors that may change the result (like a new metadata
2062
- * chunk).
2009
+ * algorithm that respects the device sizes and order of allocations. This is
2010
+ * a close approximation of the actual use but there are other factors that may
2011
+ * change the result (like a new metadata chunk).
2063
2012
*
2064
2013
* If metadata is exhausted, f_bavail will be 0.
2065
2014
*/
0 commit comments