forked from torvalds/linux
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
btrfs currently allocates multiple anonymous bdev numbers to hide the fact that inode numbers are not unique across "subvolumes". Each subvol gets a different device number. As described in a previous patch, this is incomplete, doesn't scale, and should be deprecated. This patch is another step to deprecation. With mount option "-o numdevs=many", which is the default, the current behaviour is preserved. With mount option "-o numdevs=1", the st_dev reported by stat() is exactly the number that appears in /proc/$PID/mountinfo (i.e. sb->s_dev). This will prevent "du -x", "find -xdev" and similar tools from keeping within a subvol, but is otherwise quite functional. If numdevs=1 and inumbits=0, then there will often be inode number reuse, so that combination is forbidden and the default fo inumbits changes to BITS_PER_LONG*7/8. With larger inumbits (close to BITS_PER_LONG), inode number reuse is still possible, but only with large or old filesystems. With mount option "-o numdevs=2", precisely two anon device numbers are allocated. Each subvol gets the number that its parent isn't using. When subvols are moved, the device number reported will change if needed to differentiate from its parent. If a subvol with dependent subvols is moved and the device numbers need to change, the numbers in dependent subvols that are currently in cache will NOT change. Fixing this is a stretch goal. Using numdevs=2 removes any problems with exhausting the number of available anon devs, and preserves the functionality of "du -x" and similar. It may be a useful option for sites that experience exhaustion problems. numdevs=1 is, at this stage, most useful for exploring the consequences of fully deprecating the use of multiple device numbers. It may also be useful for site that find they have no dependency on multiple device numbers. Signed-off-by: NeilBrown <neilb@suse.de>
- Loading branch information
1 parent
735f073
commit c5bae87
Showing
5 changed files
with
98 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters