diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 20:14:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-01-08 20:14:59 -0500 |
commit | 2150edc6c5cf00f7adb54538b9ea2a3e9cedca3f (patch) | |
tree | f72a0d85e66f500b4cead348a231e3d3b9f357bc /fs/ext4/migrate.c | |
parent | cd764695b67386a81964f68e9c66efd9f13f4d29 (diff) | |
parent | 4b905671d2ea09fd48fed72c581df17e40823f39 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (57 commits)
jbd2: Fix oops in jbd2_journal_init_inode() on corrupted fs
ext4: Remove "extents" mount option
block: Add Kconfig help which notes that ext4 needs CONFIG_LBD
ext4: Make printk's consistently prefixed with "EXT4-fs: "
ext4: Add sanity checks for the superblock before mounting the filesystem
ext4: Add mount option to set kjournald's I/O priority
jbd2: Submit writes to the journal using WRITE_SYNC
jbd2: Add pid and journal device name to the "kjournald2 starting" message
ext4: Add markers for better debuggability
ext4: Remove code to create the journal inode
ext4: provide function to release metadata pages under memory pressure
ext3: provide function to release metadata pages under memory pressure
add releasepage hooks to block devices which can be used by file systems
ext4: Fix s_dirty_blocks_counter if block allocation failed with nodelalloc
ext4: Init the complete page while building buddy cache
ext4: Don't allow new groups to be added during block allocation
ext4: mark the blocks/inode bitmap beyond end of group as used
ext4: Use new buffer_head flag to check uninit group bitmaps initialization
ext4: Fix the race between read_inode_bitmap() and ext4_new_inode()
ext4: code cleanup
...
Diffstat (limited to 'fs/ext4/migrate.c')
-rw-r--r-- | fs/ext4/migrate.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/ext4/migrate.c b/fs/ext4/migrate.c index f2a9cf498ecd..734abca25e35 100644 --- a/fs/ext4/migrate.c +++ b/fs/ext4/migrate.c | |||
@@ -59,7 +59,8 @@ static int finish_range(handle_t *handle, struct inode *inode, | |||
59 | /* | 59 | /* |
60 | * Make sure the credit we accumalated is not really high | 60 | * Make sure the credit we accumalated is not really high |
61 | */ | 61 | */ |
62 | if (needed && handle->h_buffer_credits >= EXT4_RESERVE_TRANS_BLOCKS) { | 62 | if (needed && ext4_handle_has_enough_credits(handle, |
63 | EXT4_RESERVE_TRANS_BLOCKS)) { | ||
63 | retval = ext4_journal_restart(handle, needed); | 64 | retval = ext4_journal_restart(handle, needed); |
64 | if (retval) | 65 | if (retval) |
65 | goto err_out; | 66 | goto err_out; |
@@ -229,7 +230,7 @@ static int extend_credit_for_blkdel(handle_t *handle, struct inode *inode) | |||
229 | { | 230 | { |
230 | int retval = 0, needed; | 231 | int retval = 0, needed; |
231 | 232 | ||
232 | if (handle->h_buffer_credits > EXT4_RESERVE_TRANS_BLOCKS) | 233 | if (ext4_handle_has_enough_credits(handle, EXT4_RESERVE_TRANS_BLOCKS+1)) |
233 | return 0; | 234 | return 0; |
234 | /* | 235 | /* |
235 | * We are freeing a blocks. During this we touch | 236 | * We are freeing a blocks. During this we touch |
@@ -458,13 +459,13 @@ int ext4_ext_migrate(struct inode *inode) | |||
458 | struct list_blocks_struct lb; | 459 | struct list_blocks_struct lb; |
459 | unsigned long max_entries; | 460 | unsigned long max_entries; |
460 | 461 | ||
461 | if (!test_opt(inode->i_sb, EXTENTS)) | 462 | /* |
462 | /* | 463 | * If the filesystem does not support extents, or the inode |
463 | * if mounted with noextents we don't allow the migrate | 464 | * already is extent-based, error out. |
464 | */ | 465 | */ |
465 | return -EINVAL; | 466 | if (!EXT4_HAS_INCOMPAT_FEATURE(inode->i_sb, |
466 | 467 | EXT4_FEATURE_INCOMPAT_EXTENTS) || | |
467 | if ((EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) | 468 | (EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) |
468 | return -EINVAL; | 469 | return -EINVAL; |
469 | 470 | ||
470 | if (S_ISLNK(inode->i_mode) && inode->i_blocks == 0) | 471 | if (S_ISLNK(inode->i_mode) && inode->i_blocks == 0) |