aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3')
-rw-r--r--fs/ext3/balloc.c8
-rw-r--r--fs/ext3/ialloc.c12
-rw-r--r--fs/ext3/inode.c6
-rw-r--r--fs/ext3/namei.c6
-rw-r--r--fs/ext3/super.c48
-rw-r--r--fs/ext3/xattr.c6
6 files changed, 23 insertions, 63 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index 0dbf1c048475..225202db8974 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -676,7 +676,7 @@ void ext3_free_blocks(handle_t *handle, struct inode *inode,
676 } 676 }
677 ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks); 677 ext3_free_blocks_sb(handle, sb, block, count, &dquot_freed_blocks);
678 if (dquot_freed_blocks) 678 if (dquot_freed_blocks)
679 DQUOT_FREE_BLOCK(inode, dquot_freed_blocks); 679 vfs_dq_free_block(inode, dquot_freed_blocks);
680 return; 680 return;
681} 681}
682 682
@@ -1502,7 +1502,7 @@ ext3_fsblk_t ext3_new_blocks(handle_t *handle, struct inode *inode,
1502 /* 1502 /*
1503 * Check quota for allocation of this block. 1503 * Check quota for allocation of this block.
1504 */ 1504 */
1505 if (DQUOT_ALLOC_BLOCK(inode, num)) { 1505 if (vfs_dq_alloc_block(inode, num)) {
1506 *errp = -EDQUOT; 1506 *errp = -EDQUOT;
1507 return 0; 1507 return 0;
1508 } 1508 }
@@ -1714,7 +1714,7 @@ allocated:
1714 1714
1715 *errp = 0; 1715 *errp = 0;
1716 brelse(bitmap_bh); 1716 brelse(bitmap_bh);
1717 DQUOT_FREE_BLOCK(inode, *count-num); 1717 vfs_dq_free_block(inode, *count-num);
1718 *count = num; 1718 *count = num;
1719 return ret_block; 1719 return ret_block;
1720 1720
@@ -1729,7 +1729,7 @@ out:
1729 * Undo the block allocation 1729 * Undo the block allocation
1730 */ 1730 */
1731 if (!performed_allocation) 1731 if (!performed_allocation)
1732 DQUOT_FREE_BLOCK(inode, *count); 1732 vfs_dq_free_block(inode, *count);
1733 brelse(bitmap_bh); 1733 brelse(bitmap_bh);
1734 return 0; 1734 return 0;
1735} 1735}
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
index 8de6c720e510..dd13d60d524b 100644
--- a/fs/ext3/ialloc.c
+++ b/fs/ext3/ialloc.c
@@ -123,10 +123,10 @@ void ext3_free_inode (handle_t *handle, struct inode * inode)
123 * Note: we must free any quota before locking the superblock, 123 * Note: we must free any quota before locking the superblock,
124 * as writing the quota to disk may need the lock as well. 124 * as writing the quota to disk may need the lock as well.
125 */ 125 */
126 DQUOT_INIT(inode); 126 vfs_dq_init(inode);
127 ext3_xattr_delete_inode(handle, inode); 127 ext3_xattr_delete_inode(handle, inode);
128 DQUOT_FREE_INODE(inode); 128 vfs_dq_free_inode(inode);
129 DQUOT_DROP(inode); 129 vfs_dq_drop(inode);
130 130
131 is_directory = S_ISDIR(inode->i_mode); 131 is_directory = S_ISDIR(inode->i_mode);
132 132
@@ -589,7 +589,7 @@ got:
589 sizeof(struct ext3_inode) - EXT3_GOOD_OLD_INODE_SIZE : 0; 589 sizeof(struct ext3_inode) - EXT3_GOOD_OLD_INODE_SIZE : 0;
590 590
591 ret = inode; 591 ret = inode;
592 if(DQUOT_ALLOC_INODE(inode)) { 592 if (vfs_dq_alloc_inode(inode)) {
593 err = -EDQUOT; 593 err = -EDQUOT;
594 goto fail_drop; 594 goto fail_drop;
595 } 595 }
@@ -620,10 +620,10 @@ really_out:
620 return ret; 620 return ret;
621 621
622fail_free_drop: 622fail_free_drop:
623 DQUOT_FREE_INODE(inode); 623 vfs_dq_free_inode(inode);
624 624
625fail_drop: 625fail_drop:
626 DQUOT_DROP(inode); 626 vfs_dq_drop(inode);
627 inode->i_flags |= S_NOQUOTA; 627 inode->i_flags |= S_NOQUOTA;
628 inode->i_nlink = 0; 628 inode->i_nlink = 0;
629 unlock_new_inode(inode); 629 unlock_new_inode(inode);
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index 05e5c2e5c0d7..4a09ff169870 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -3063,7 +3063,7 @@ int ext3_setattr(struct dentry *dentry, struct iattr *attr)
3063 error = PTR_ERR(handle); 3063 error = PTR_ERR(handle);
3064 goto err_out; 3064 goto err_out;
3065 } 3065 }
3066 error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0; 3066 error = vfs_dq_transfer(inode, attr) ? -EDQUOT : 0;
3067 if (error) { 3067 if (error) {
3068 ext3_journal_stop(handle); 3068 ext3_journal_stop(handle);
3069 return error; 3069 return error;
@@ -3154,7 +3154,7 @@ static int ext3_writepage_trans_blocks(struct inode *inode)
3154 ret = 2 * (bpp + indirects) + 2; 3154 ret = 2 * (bpp + indirects) + 2;
3155 3155
3156#ifdef CONFIG_QUOTA 3156#ifdef CONFIG_QUOTA
3157 /* We know that structure was already allocated during DQUOT_INIT so 3157 /* We know that structure was already allocated during vfs_dq_init so
3158 * we will be updating only the data blocks + inodes */ 3158 * we will be updating only the data blocks + inodes */
3159 ret += 2*EXT3_QUOTA_TRANS_BLOCKS(inode->i_sb); 3159 ret += 2*EXT3_QUOTA_TRANS_BLOCKS(inode->i_sb);
3160#endif 3160#endif
@@ -3245,7 +3245,7 @@ int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode)
3245 * i_size has been changed by generic_commit_write() and we thus need 3245 * i_size has been changed by generic_commit_write() and we thus need
3246 * to include the updated inode in the current transaction. 3246 * to include the updated inode in the current transaction.
3247 * 3247 *
3248 * Also, DQUOT_ALLOC_SPACE() will always dirty the inode when blocks 3248 * Also, vfs_dq_alloc_space() will always dirty the inode when blocks
3249 * are allocated to the file. 3249 * are allocated to the file.
3250 * 3250 *
3251 * If the inode is marked synchronous, we don't honour that here - doing 3251 * If the inode is marked synchronous, we don't honour that here - doing
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index 4db4ffa1edad..e2fc63cbba8b 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -2049,7 +2049,7 @@ static int ext3_rmdir (struct inode * dir, struct dentry *dentry)
2049 2049
2050 /* Initialize quotas before so that eventual writes go in 2050 /* Initialize quotas before so that eventual writes go in
2051 * separate transaction */ 2051 * separate transaction */
2052 DQUOT_INIT(dentry->d_inode); 2052 vfs_dq_init(dentry->d_inode);
2053 handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb)); 2053 handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb));
2054 if (IS_ERR(handle)) 2054 if (IS_ERR(handle))
2055 return PTR_ERR(handle); 2055 return PTR_ERR(handle);
@@ -2108,7 +2108,7 @@ static int ext3_unlink(struct inode * dir, struct dentry *dentry)
2108 2108
2109 /* Initialize quotas before so that eventual writes go 2109 /* Initialize quotas before so that eventual writes go
2110 * in separate transaction */ 2110 * in separate transaction */
2111 DQUOT_INIT(dentry->d_inode); 2111 vfs_dq_init(dentry->d_inode);
2112 handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb)); 2112 handle = ext3_journal_start(dir, EXT3_DELETE_TRANS_BLOCKS(dir->i_sb));
2113 if (IS_ERR(handle)) 2113 if (IS_ERR(handle))
2114 return PTR_ERR(handle); 2114 return PTR_ERR(handle);
@@ -2272,7 +2272,7 @@ static int ext3_rename (struct inode * old_dir, struct dentry *old_dentry,
2272 /* Initialize quotas before so that eventual writes go 2272 /* Initialize quotas before so that eventual writes go
2273 * in separate transaction */ 2273 * in separate transaction */
2274 if (new_dentry->d_inode) 2274 if (new_dentry->d_inode)
2275 DQUOT_INIT(new_dentry->d_inode); 2275 vfs_dq_init(new_dentry->d_inode);
2276 handle = ext3_journal_start(old_dir, 2 * 2276 handle = ext3_journal_start(old_dir, 2 *
2277 EXT3_DATA_TRANS_BLOCKS(old_dir->i_sb) + 2277 EXT3_DATA_TRANS_BLOCKS(old_dir->i_sb) +
2278 EXT3_INDEX_EXTRA_TRANS_BLOCKS + 2); 2278 EXT3_INDEX_EXTRA_TRANS_BLOCKS + 2);
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
710static int ext3_dquot_initialize(struct inode *inode, int type);
711static int ext3_dquot_drop(struct inode *inode);
712static int ext3_write_dquot(struct dquot *dquot); 710static int ext3_write_dquot(struct dquot *dquot);
713static int ext3_acquire_dquot(struct dquot *dquot); 711static int ext3_acquire_dquot(struct dquot *dquot);
714static int ext3_release_dquot(struct dquot *dquot); 712static 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
725static struct dquot_operations ext3_quota_operations = { 723static 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
2717static 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
2733static 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
2755static int ext3_write_dquot(struct dquot *dquot) 2715static int ext3_write_dquot(struct dquot *dquot)
2756{ 2716{
2757 int ret, err; 2717 int ret, err;
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index 175414ac2210..83b7be849bd5 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -498,7 +498,7 @@ ext3_xattr_release_block(handle_t *handle, struct inode *inode,
498 error = ext3_journal_dirty_metadata(handle, bh); 498 error = ext3_journal_dirty_metadata(handle, bh);
499 if (IS_SYNC(inode)) 499 if (IS_SYNC(inode))
500 handle->h_sync = 1; 500 handle->h_sync = 1;
501 DQUOT_FREE_BLOCK(inode, 1); 501 vfs_dq_free_block(inode, 1);
502 ea_bdebug(bh, "refcount now=%d; releasing", 502 ea_bdebug(bh, "refcount now=%d; releasing",
503 le32_to_cpu(BHDR(bh)->h_refcount)); 503 le32_to_cpu(BHDR(bh)->h_refcount));
504 if (ce) 504 if (ce)
@@ -774,7 +774,7 @@ inserted:
774 /* The old block is released after updating 774 /* The old block is released after updating
775 the inode. */ 775 the inode. */
776 error = -EDQUOT; 776 error = -EDQUOT;
777 if (DQUOT_ALLOC_BLOCK(inode, 1)) 777 if (vfs_dq_alloc_block(inode, 1))
778 goto cleanup; 778 goto cleanup;
779 error = ext3_journal_get_write_access(handle, 779 error = ext3_journal_get_write_access(handle,
780 new_bh); 780 new_bh);
@@ -848,7 +848,7 @@ cleanup:
848 return error; 848 return error;
849 849
850cleanup_dquot: 850cleanup_dquot:
851 DQUOT_FREE_BLOCK(inode, 1); 851 vfs_dq_free_block(inode, 1);
852 goto cleanup; 852 goto cleanup;
853 853
854bad_block: 854bad_block: