diff options
-rw-r--r-- | fs/ext3/super.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 541d5e4f7f6e..6900ff05e3ab 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -682,6 +682,26 @@ static struct dentry *ext3_fh_to_parent(struct super_block *sb, struct fid *fid, | |||
682 | ext3_nfs_get_inode); | 682 | ext3_nfs_get_inode); |
683 | } | 683 | } |
684 | 684 | ||
685 | /* | ||
686 | * Try to release metadata pages (indirect blocks, directories) which are | ||
687 | * mapped via the block device. Since these pages could have journal heads | ||
688 | * which would prevent try_to_free_buffers() from freeing them, we must use | ||
689 | * jbd layer's try_to_free_buffers() function to release them. | ||
690 | */ | ||
691 | static int bdev_try_to_free_page(struct super_block *sb, struct page *page, | ||
692 | gfp_t wait) | ||
693 | { | ||
694 | journal_t *journal = EXT3_SB(sb)->s_journal; | ||
695 | |||
696 | WARN_ON(PageChecked(page)); | ||
697 | if (!page_has_buffers(page)) | ||
698 | return 0; | ||
699 | if (journal) | ||
700 | return journal_try_to_free_buffers(journal, page, | ||
701 | wait & ~__GFP_WAIT); | ||
702 | return try_to_free_buffers(page); | ||
703 | } | ||
704 | |||
685 | #ifdef CONFIG_QUOTA | 705 | #ifdef CONFIG_QUOTA |
686 | #define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group") | 706 | #define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group") |
687 | #define QTYPE2MOPT(on, t) ((t)==USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) | 707 | #define QTYPE2MOPT(on, t) ((t)==USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) |
@@ -746,6 +766,7 @@ static const struct super_operations ext3_sops = { | |||
746 | .quota_read = ext3_quota_read, | 766 | .quota_read = ext3_quota_read, |
747 | .quota_write = ext3_quota_write, | 767 | .quota_write = ext3_quota_write, |
748 | #endif | 768 | #endif |
769 | .bdev_try_to_free_page = bdev_try_to_free_page, | ||
749 | }; | 770 | }; |
750 | 771 | ||
751 | static const struct export_operations ext3_export_ops = { | 772 | static const struct export_operations ext3_export_ops = { |