diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-25 14:13:26 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-02-25 14:13:26 -0500 |
commit | 638691a7a46a4ae9a7b56c603299e42d7f6e722e (patch) | |
tree | f744b3fbdd4704ef9ae122b67a14785b4a7a6b65 /fs/inode.c | |
parent | 0a93ea2e897bd793cc0aaaddc397eff32ac8d6fe (diff) | |
parent | f0b4f7e2f29af678bd9af43422c537dcb6008603 (diff) |
Merge branch 'for-linus' of git://neil.brown.name/md
* 'for-linus' of git://neil.brown.name/md:
md: Fix - again - partition detection when array becomes active
Fix over-zealous flush_disk when changing device size.
md: avoid spinlock problem in blk_throtl_exit
md: correctly handle probe of an 'mdp' device.
md: don't set_capacity before array is active.
md: Fix raid1->raid0 takeover
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c index 9c2b795ccc93..0647d80accf6 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -548,11 +548,14 @@ void evict_inodes(struct super_block *sb) | |||
548 | /** | 548 | /** |
549 | * invalidate_inodes - attempt to free all inodes on a superblock | 549 | * invalidate_inodes - attempt to free all inodes on a superblock |
550 | * @sb: superblock to operate on | 550 | * @sb: superblock to operate on |
551 | * @kill_dirty: flag to guide handling of dirty inodes | ||
551 | * | 552 | * |
552 | * Attempts to free all inodes for a given superblock. If there were any | 553 | * Attempts to free all inodes for a given superblock. If there were any |
553 | * busy inodes return a non-zero value, else zero. | 554 | * busy inodes return a non-zero value, else zero. |
555 | * If @kill_dirty is set, discard dirty inodes too, otherwise treat | ||
556 | * them as busy. | ||
554 | */ | 557 | */ |
555 | int invalidate_inodes(struct super_block *sb) | 558 | int invalidate_inodes(struct super_block *sb, bool kill_dirty) |
556 | { | 559 | { |
557 | int busy = 0; | 560 | int busy = 0; |
558 | struct inode *inode, *next; | 561 | struct inode *inode, *next; |
@@ -564,6 +567,10 @@ int invalidate_inodes(struct super_block *sb) | |||
564 | list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) { | 567 | list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) { |
565 | if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) | 568 | if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) |
566 | continue; | 569 | continue; |
570 | if (inode->i_state & I_DIRTY && !kill_dirty) { | ||
571 | busy = 1; | ||
572 | continue; | ||
573 | } | ||
567 | if (atomic_read(&inode->i_count)) { | 574 | if (atomic_read(&inode->i_count)) { |
568 | busy = 1; | 575 | busy = 1; |
569 | continue; | 576 | continue; |