diff options
author | Andreas Dilger <adilger@sun.com> | 2009-06-13 11:45:35 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-06-13 11:45:35 -0400 |
commit | 11013911daea4820147ae6d7094dd7c6894e8651 (patch) | |
tree | f8e9f9d2058e0dfc826d4df3d88a7eb18a56b3f3 /fs/ext4/migrate.c | |
parent | f157a4aa98a18bd3817a72bea90d48494e2586e7 (diff) |
ext4: teach the inode allocator to use a goal inode number
Enhance the inode allocator to take a goal inode number as a
paremeter; if it is specified, it takes precedence over Orlov or
parent directory inode allocation algorithms.
The extents migration function uses the goal inode number so that the
extent trees allocated the migration function use the correct flex_bg.
In the future, the goal inode functionality will also be used to
allocate an adjacent inode for the extended attributes.
Also, for testing purposes the goal inode number can be specified via
/sys/fs/{dev}/inode_goal. This can be useful for testing inode
allocation beyond 2^32 blocks on very large filesystems.
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/migrate.c')
-rw-r--r-- | fs/ext4/migrate.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c index 80d075b8aeaf..313a50b39741 100644 --- a/fs/ext4/migrate.c +++ b/fs/ext4/migrate.c | |||
@@ -458,6 +458,7 @@ int ext4_ext_migrate(struct inode *inode) | |||
458 | struct inode *tmp_inode = NULL; | 458 | struct inode *tmp_inode = NULL; |
459 | struct list_blocks_struct lb; | 459 | struct list_blocks_struct lb; |
460 | unsigned long max_entries; | 460 | unsigned long max_entries; |
461 | __u32 goal; | ||
461 | 462 | ||
462 | /* | 463 | /* |
463 | * If the filesystem does not support extents, or the inode | 464 | * If the filesystem does not support extents, or the inode |
@@ -483,8 +484,10 @@ int ext4_ext_migrate(struct inode *inode) | |||
483 | retval = PTR_ERR(handle); | 484 | retval = PTR_ERR(handle); |
484 | return retval; | 485 | return retval; |
485 | } | 486 | } |
487 | goal = (((inode->i_ino - 1) / EXT4_INODES_PER_GROUP(inode->i_sb)) * | ||
488 | EXT4_INODES_PER_GROUP(inode->i_sb)) + 1; | ||
486 | tmp_inode = ext4_new_inode(handle, inode->i_sb->s_root->d_inode, | 489 | tmp_inode = ext4_new_inode(handle, inode->i_sb->s_root->d_inode, |
487 | S_IFREG, 0); | 490 | S_IFREG, 0, goal); |
488 | if (IS_ERR(tmp_inode)) { | 491 | if (IS_ERR(tmp_inode)) { |
489 | retval = -ENOMEM; | 492 | retval = -ENOMEM; |
490 | ext4_journal_stop(handle); | 493 | ext4_journal_stop(handle); |