diff options
Diffstat (limited to 'fs/ext3/super.c')
-rw-r--r-- | fs/ext3/super.c | 48 |
1 files changed, 4 insertions, 44 deletions
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 4a970411a458..9e5b8e387e1e 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -707,8 +707,6 @@ static int bdev_try_to_free_page(struct super_block *sb, struct page *page, | |||
707 | #define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group") | 707 | #define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group") |
708 | #define QTYPE2MOPT(on, t) ((t)==USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) | 708 | #define QTYPE2MOPT(on, t) ((t)==USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) |
709 | 709 | ||
710 | static int ext3_dquot_initialize(struct inode *inode, int type); | ||
711 | static int ext3_dquot_drop(struct inode *inode); | ||
712 | static int ext3_write_dquot(struct dquot *dquot); | 710 | static int ext3_write_dquot(struct dquot *dquot); |
713 | static int ext3_acquire_dquot(struct dquot *dquot); | 711 | static int ext3_acquire_dquot(struct dquot *dquot); |
714 | static int ext3_release_dquot(struct dquot *dquot); | 712 | static int ext3_release_dquot(struct dquot *dquot); |
@@ -723,8 +721,8 @@ static ssize_t ext3_quota_write(struct super_block *sb, int type, | |||
723 | const char *data, size_t len, loff_t off); | 721 | const char *data, size_t len, loff_t off); |
724 | 722 | ||
725 | static struct dquot_operations ext3_quota_operations = { | 723 | static struct dquot_operations ext3_quota_operations = { |
726 | .initialize = ext3_dquot_initialize, | 724 | .initialize = dquot_initialize, |
727 | .drop = ext3_dquot_drop, | 725 | .drop = dquot_drop, |
728 | .alloc_space = dquot_alloc_space, | 726 | .alloc_space = dquot_alloc_space, |
729 | .alloc_inode = dquot_alloc_inode, | 727 | .alloc_inode = dquot_alloc_inode, |
730 | .free_space = dquot_free_space, | 728 | .free_space = dquot_free_space, |
@@ -1438,7 +1436,7 @@ static void ext3_orphan_cleanup (struct super_block * sb, | |||
1438 | } | 1436 | } |
1439 | 1437 | ||
1440 | list_add(&EXT3_I(inode)->i_orphan, &EXT3_SB(sb)->s_orphan); | 1438 | list_add(&EXT3_I(inode)->i_orphan, &EXT3_SB(sb)->s_orphan); |
1441 | DQUOT_INIT(inode); | 1439 | vfs_dq_init(inode); |
1442 | if (inode->i_nlink) { | 1440 | if (inode->i_nlink) { |
1443 | printk(KERN_DEBUG | 1441 | printk(KERN_DEBUG |
1444 | "%s: truncating inode %lu to %Ld bytes\n", | 1442 | "%s: truncating inode %lu to %Ld bytes\n", |
@@ -2702,7 +2700,7 @@ static int ext3_statfs (struct dentry * dentry, struct kstatfs * buf) | |||
2702 | * Process 1 Process 2 | 2700 | * Process 1 Process 2 |
2703 | * ext3_create() quota_sync() | 2701 | * ext3_create() quota_sync() |
2704 | * journal_start() write_dquot() | 2702 | * journal_start() write_dquot() |
2705 | * DQUOT_INIT() down(dqio_mutex) | 2703 | * vfs_dq_init() down(dqio_mutex) |
2706 | * down(dqio_mutex) journal_start() | 2704 | * down(dqio_mutex) journal_start() |
2707 | * | 2705 | * |
2708 | */ | 2706 | */ |
@@ -2714,44 +2712,6 @@ static inline struct inode *dquot_to_inode(struct dquot *dquot) | |||
2714 | return sb_dqopt(dquot->dq_sb)->files[dquot->dq_type]; | 2712 | return sb_dqopt(dquot->dq_sb)->files[dquot->dq_type]; |
2715 | } | 2713 | } |
2716 | 2714 | ||
2717 | static int ext3_dquot_initialize(struct inode *inode, int type) | ||
2718 | { | ||
2719 | handle_t *handle; | ||
2720 | int ret, err; | ||
2721 | |||
2722 | /* We may create quota structure so we need to reserve enough blocks */ | ||
2723 | handle = ext3_journal_start(inode, 2*EXT3_QUOTA_INIT_BLOCKS(inode->i_sb)); | ||
2724 | if (IS_ERR(handle)) | ||
2725 | return PTR_ERR(handle); | ||
2726 | ret = dquot_initialize(inode, type); | ||
2727 | err = ext3_journal_stop(handle); | ||
2728 | if (!ret) | ||
2729 | ret = err; | ||
2730 | return ret; | ||
2731 | } | ||
2732 | |||
2733 | static int ext3_dquot_drop(struct inode *inode) | ||
2734 | { | ||
2735 | handle_t *handle; | ||
2736 | int ret, err; | ||
2737 | |||
2738 | /* We may delete quota structure so we need to reserve enough blocks */ | ||
2739 | handle = ext3_journal_start(inode, 2*EXT3_QUOTA_DEL_BLOCKS(inode->i_sb)); | ||
2740 | if (IS_ERR(handle)) { | ||
2741 | /* | ||
2742 | * We call dquot_drop() anyway to at least release references | ||
2743 | * to quota structures so that umount does not hang. | ||
2744 | */ | ||
2745 | dquot_drop(inode); | ||
2746 | return PTR_ERR(handle); | ||
2747 | } | ||
2748 | ret = dquot_drop(inode); | ||
2749 | err = ext3_journal_stop(handle); | ||
2750 | if (!ret) | ||
2751 | ret = err; | ||
2752 | return ret; | ||
2753 | } | ||
2754 | |||
2755 | static int ext3_write_dquot(struct dquot *dquot) | 2715 | static int ext3_write_dquot(struct dquot *dquot) |
2756 | { | 2716 | { |
2757 | int ret, err; | 2717 | int ret, err; |