diff options
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/file.c | 3 | ||||
-rw-r--r-- | fs/ext4/ialloc.c | 16 | ||||
-rw-r--r-- | fs/ext4/inode.c | 27 | ||||
-rw-r--r-- | fs/ext4/mballoc.c | 6 | ||||
-rw-r--r-- | fs/ext4/namei.c | 23 | ||||
-rw-r--r-- | fs/ext4/super.c | 15 | ||||
-rw-r--r-- | fs/ext4/xattr.c | 8 |
7 files changed, 57 insertions, 41 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c index 503a48927402..d0776e410f34 100644 --- a/fs/ext4/file.c +++ b/fs/ext4/file.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/jbd2.h> | 23 | #include <linux/jbd2.h> |
24 | #include <linux/mount.h> | 24 | #include <linux/mount.h> |
25 | #include <linux/path.h> | 25 | #include <linux/path.h> |
26 | #include <linux/quotaops.h> | ||
26 | #include "ext4.h" | 27 | #include "ext4.h" |
27 | #include "ext4_jbd2.h" | 28 | #include "ext4_jbd2.h" |
28 | #include "xattr.h" | 29 | #include "xattr.h" |
@@ -125,7 +126,7 @@ static int ext4_file_open(struct inode * inode, struct file * filp) | |||
125 | sb->s_dirt = 1; | 126 | sb->s_dirt = 1; |
126 | } | 127 | } |
127 | } | 128 | } |
128 | return generic_file_open(inode, filp); | 129 | return dquot_file_open(inode, filp); |
129 | } | 130 | } |
130 | 131 | ||
131 | const struct file_operations ext4_file_operations = { | 132 | const struct file_operations ext4_file_operations = { |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 004c9da9e5c6..361c0b9962a8 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -214,10 +214,10 @@ void ext4_free_inode(handle_t *handle, struct inode *inode) | |||
214 | * Note: we must free any quota before locking the superblock, | 214 | * Note: we must free any quota before locking the superblock, |
215 | * as writing the quota to disk may need the lock as well. | 215 | * as writing the quota to disk may need the lock as well. |
216 | */ | 216 | */ |
217 | vfs_dq_init(inode); | 217 | dquot_initialize(inode); |
218 | ext4_xattr_delete_inode(handle, inode); | 218 | ext4_xattr_delete_inode(handle, inode); |
219 | vfs_dq_free_inode(inode); | 219 | dquot_free_inode(inode); |
220 | vfs_dq_drop(inode); | 220 | dquot_drop(inode); |
221 | 221 | ||
222 | is_directory = S_ISDIR(inode->i_mode); | 222 | is_directory = S_ISDIR(inode->i_mode); |
223 | 223 | ||
@@ -1029,10 +1029,10 @@ got: | |||
1029 | ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize; | 1029 | ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize; |
1030 | 1030 | ||
1031 | ret = inode; | 1031 | ret = inode; |
1032 | if (vfs_dq_alloc_inode(inode)) { | 1032 | dquot_initialize(inode); |
1033 | err = -EDQUOT; | 1033 | err = dquot_alloc_inode(inode); |
1034 | if (err) | ||
1034 | goto fail_drop; | 1035 | goto fail_drop; |
1035 | } | ||
1036 | 1036 | ||
1037 | err = ext4_init_acl(handle, inode, dir); | 1037 | err = ext4_init_acl(handle, inode, dir); |
1038 | if (err) | 1038 | if (err) |
@@ -1069,10 +1069,10 @@ really_out: | |||
1069 | return ret; | 1069 | return ret; |
1070 | 1070 | ||
1071 | fail_free_drop: | 1071 | fail_free_drop: |
1072 | vfs_dq_free_inode(inode); | 1072 | dquot_free_inode(inode); |
1073 | 1073 | ||
1074 | fail_drop: | 1074 | fail_drop: |
1075 | vfs_dq_drop(inode); | 1075 | dquot_drop(inode); |
1076 | inode->i_flags |= S_NOQUOTA; | 1076 | inode->i_flags |= S_NOQUOTA; |
1077 | inode->i_nlink = 0; | 1077 | inode->i_nlink = 0; |
1078 | unlock_new_inode(inode); | 1078 | unlock_new_inode(inode); |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index f977aade0d1b..986120f30066 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -171,6 +171,9 @@ void ext4_delete_inode(struct inode *inode) | |||
171 | handle_t *handle; | 171 | handle_t *handle; |
172 | int err; | 172 | int err; |
173 | 173 | ||
174 | if (!is_bad_inode(inode)) | ||
175 | dquot_initialize(inode); | ||
176 | |||
174 | if (ext4_should_order_data(inode)) | 177 | if (ext4_should_order_data(inode)) |
175 | ext4_begin_ordered_truncate(inode, 0); | 178 | ext4_begin_ordered_truncate(inode, 0); |
176 | truncate_inode_pages(&inode->i_data, 0); | 179 | truncate_inode_pages(&inode->i_data, 0); |
@@ -1108,9 +1111,9 @@ void ext4_da_update_reserve_space(struct inode *inode, | |||
1108 | 1111 | ||
1109 | /* Update quota subsystem */ | 1112 | /* Update quota subsystem */ |
1110 | if (quota_claim) { | 1113 | if (quota_claim) { |
1111 | vfs_dq_claim_block(inode, used); | 1114 | dquot_claim_block(inode, used); |
1112 | if (mdb_free) | 1115 | if (mdb_free) |
1113 | vfs_dq_release_reservation_block(inode, mdb_free); | 1116 | dquot_release_reservation_block(inode, mdb_free); |
1114 | } else { | 1117 | } else { |
1115 | /* | 1118 | /* |
1116 | * We did fallocate with an offset that is already delayed | 1119 | * We did fallocate with an offset that is already delayed |
@@ -1121,8 +1124,8 @@ void ext4_da_update_reserve_space(struct inode *inode, | |||
1121 | * that | 1124 | * that |
1122 | */ | 1125 | */ |
1123 | if (allocated_meta_blocks) | 1126 | if (allocated_meta_blocks) |
1124 | vfs_dq_claim_block(inode, allocated_meta_blocks); | 1127 | dquot_claim_block(inode, allocated_meta_blocks); |
1125 | vfs_dq_release_reservation_block(inode, mdb_free + used); | 1128 | dquot_release_reservation_block(inode, mdb_free + used); |
1126 | } | 1129 | } |
1127 | 1130 | ||
1128 | /* | 1131 | /* |
@@ -1857,6 +1860,7 @@ static int ext4_da_reserve_space(struct inode *inode, sector_t lblock) | |||
1857 | struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); | 1860 | struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); |
1858 | struct ext4_inode_info *ei = EXT4_I(inode); | 1861 | struct ext4_inode_info *ei = EXT4_I(inode); |
1859 | unsigned long md_needed, md_reserved; | 1862 | unsigned long md_needed, md_reserved; |
1863 | int ret; | ||
1860 | 1864 | ||
1861 | /* | 1865 | /* |
1862 | * recalculate the amount of metadata blocks to reserve | 1866 | * recalculate the amount of metadata blocks to reserve |
@@ -1875,11 +1879,12 @@ repeat: | |||
1875 | * later. Real quota accounting is done at pages writeout | 1879 | * later. Real quota accounting is done at pages writeout |
1876 | * time. | 1880 | * time. |
1877 | */ | 1881 | */ |
1878 | if (vfs_dq_reserve_block(inode, md_needed + 1)) | 1882 | ret = dquot_reserve_block(inode, md_needed + 1); |
1879 | return -EDQUOT; | 1883 | if (ret) |
1884 | return ret; | ||
1880 | 1885 | ||
1881 | if (ext4_claim_free_blocks(sbi, md_needed + 1)) { | 1886 | if (ext4_claim_free_blocks(sbi, md_needed + 1)) { |
1882 | vfs_dq_release_reservation_block(inode, md_needed + 1); | 1887 | dquot_release_reservation_block(inode, md_needed + 1); |
1883 | if (ext4_should_retry_alloc(inode->i_sb, &retries)) { | 1888 | if (ext4_should_retry_alloc(inode->i_sb, &retries)) { |
1884 | yield(); | 1889 | yield(); |
1885 | goto repeat; | 1890 | goto repeat; |
@@ -1936,7 +1941,7 @@ static void ext4_da_release_space(struct inode *inode, int to_free) | |||
1936 | 1941 | ||
1937 | spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); | 1942 | spin_unlock(&EXT4_I(inode)->i_block_reservation_lock); |
1938 | 1943 | ||
1939 | vfs_dq_release_reservation_block(inode, to_free); | 1944 | dquot_release_reservation_block(inode, to_free); |
1940 | } | 1945 | } |
1941 | 1946 | ||
1942 | static void ext4_da_page_release_reservation(struct page *page, | 1947 | static void ext4_da_page_release_reservation(struct page *page, |
@@ -5418,6 +5423,8 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) | |||
5418 | if (error) | 5423 | if (error) |
5419 | return error; | 5424 | return error; |
5420 | 5425 | ||
5426 | if (ia_valid & ATTR_SIZE) | ||
5427 | dquot_initialize(inode); | ||
5421 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || | 5428 | if ((ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) || |
5422 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { | 5429 | (ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid)) { |
5423 | handle_t *handle; | 5430 | handle_t *handle; |
@@ -5430,7 +5437,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) | |||
5430 | error = PTR_ERR(handle); | 5437 | error = PTR_ERR(handle); |
5431 | goto err_out; | 5438 | goto err_out; |
5432 | } | 5439 | } |
5433 | error = vfs_dq_transfer(inode, attr) ? -EDQUOT : 0; | 5440 | error = dquot_transfer(inode, attr); |
5434 | if (error) { | 5441 | if (error) { |
5435 | ext4_journal_stop(handle); | 5442 | ext4_journal_stop(handle); |
5436 | return error; | 5443 | return error; |
@@ -5816,7 +5823,7 @@ int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode) | |||
5816 | * i_size has been changed by generic_commit_write() and we thus need | 5823 | * i_size has been changed by generic_commit_write() and we thus need |
5817 | * to include the updated inode in the current transaction. | 5824 | * to include the updated inode in the current transaction. |
5818 | * | 5825 | * |
5819 | * Also, vfs_dq_alloc_block() will always dirty the inode when blocks | 5826 | * Also, dquot_alloc_block() will always dirty the inode when blocks |
5820 | * are allocated to the file. | 5827 | * are allocated to the file. |
5821 | * | 5828 | * |
5822 | * If the inode is marked synchronous, we don't honour that here - doing | 5829 | * If the inode is marked synchronous, we don't honour that here - doing |
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index abb11e328b65..506713a2ebd8 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c | |||
@@ -4240,7 +4240,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, | |||
4240 | return 0; | 4240 | return 0; |
4241 | } | 4241 | } |
4242 | reserv_blks = ar->len; | 4242 | reserv_blks = ar->len; |
4243 | while (ar->len && vfs_dq_alloc_block(ar->inode, ar->len)) { | 4243 | while (ar->len && dquot_alloc_block(ar->inode, ar->len)) { |
4244 | ar->flags |= EXT4_MB_HINT_NOPREALLOC; | 4244 | ar->flags |= EXT4_MB_HINT_NOPREALLOC; |
4245 | ar->len--; | 4245 | ar->len--; |
4246 | } | 4246 | } |
@@ -4317,7 +4317,7 @@ out2: | |||
4317 | kmem_cache_free(ext4_ac_cachep, ac); | 4317 | kmem_cache_free(ext4_ac_cachep, ac); |
4318 | out1: | 4318 | out1: |
4319 | if (inquota && ar->len < inquota) | 4319 | if (inquota && ar->len < inquota) |
4320 | vfs_dq_free_block(ar->inode, inquota - ar->len); | 4320 | dquot_free_block(ar->inode, inquota - ar->len); |
4321 | out3: | 4321 | out3: |
4322 | if (!ar->len) { | 4322 | if (!ar->len) { |
4323 | if (!EXT4_I(ar->inode)->i_delalloc_reserved_flag) | 4323 | if (!EXT4_I(ar->inode)->i_delalloc_reserved_flag) |
@@ -4631,7 +4631,7 @@ do_more: | |||
4631 | sb->s_dirt = 1; | 4631 | sb->s_dirt = 1; |
4632 | error_return: | 4632 | error_return: |
4633 | if (freed) | 4633 | if (freed) |
4634 | vfs_dq_free_block(inode, freed); | 4634 | dquot_free_block(inode, freed); |
4635 | brelse(bitmap_bh); | 4635 | brelse(bitmap_bh); |
4636 | ext4_std_error(sb, err); | 4636 | ext4_std_error(sb, err); |
4637 | if (ac) | 4637 | if (ac) |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 608d21f873ec..0c070fabd108 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -1759,6 +1759,8 @@ static int ext4_create(struct inode *dir, struct dentry *dentry, int mode, | |||
1759 | struct inode *inode; | 1759 | struct inode *inode; |
1760 | int err, retries = 0; | 1760 | int err, retries = 0; |
1761 | 1761 | ||
1762 | dquot_initialize(dir); | ||
1763 | |||
1762 | retry: | 1764 | retry: |
1763 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + | 1765 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + |
1764 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3 + | 1766 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3 + |
@@ -1793,6 +1795,8 @@ static int ext4_mknod(struct inode *dir, struct dentry *dentry, | |||
1793 | if (!new_valid_dev(rdev)) | 1795 | if (!new_valid_dev(rdev)) |
1794 | return -EINVAL; | 1796 | return -EINVAL; |
1795 | 1797 | ||
1798 | dquot_initialize(dir); | ||
1799 | |||
1796 | retry: | 1800 | retry: |
1797 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + | 1801 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + |
1798 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3 + | 1802 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3 + |
@@ -1830,6 +1834,8 @@ static int ext4_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
1830 | if (EXT4_DIR_LINK_MAX(dir)) | 1834 | if (EXT4_DIR_LINK_MAX(dir)) |
1831 | return -EMLINK; | 1835 | return -EMLINK; |
1832 | 1836 | ||
1837 | dquot_initialize(dir); | ||
1838 | |||
1833 | retry: | 1839 | retry: |
1834 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + | 1840 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + |
1835 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3 + | 1841 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 3 + |
@@ -2137,7 +2143,9 @@ static int ext4_rmdir(struct inode *dir, struct dentry *dentry) | |||
2137 | 2143 | ||
2138 | /* Initialize quotas before so that eventual writes go in | 2144 | /* Initialize quotas before so that eventual writes go in |
2139 | * separate transaction */ | 2145 | * separate transaction */ |
2140 | vfs_dq_init(dentry->d_inode); | 2146 | dquot_initialize(dir); |
2147 | dquot_initialize(dentry->d_inode); | ||
2148 | |||
2141 | handle = ext4_journal_start(dir, EXT4_DELETE_TRANS_BLOCKS(dir->i_sb)); | 2149 | handle = ext4_journal_start(dir, EXT4_DELETE_TRANS_BLOCKS(dir->i_sb)); |
2142 | if (IS_ERR(handle)) | 2150 | if (IS_ERR(handle)) |
2143 | return PTR_ERR(handle); | 2151 | return PTR_ERR(handle); |
@@ -2196,7 +2204,9 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry) | |||
2196 | 2204 | ||
2197 | /* Initialize quotas before so that eventual writes go | 2205 | /* Initialize quotas before so that eventual writes go |
2198 | * in separate transaction */ | 2206 | * in separate transaction */ |
2199 | vfs_dq_init(dentry->d_inode); | 2207 | dquot_initialize(dir); |
2208 | dquot_initialize(dentry->d_inode); | ||
2209 | |||
2200 | handle = ext4_journal_start(dir, EXT4_DELETE_TRANS_BLOCKS(dir->i_sb)); | 2210 | handle = ext4_journal_start(dir, EXT4_DELETE_TRANS_BLOCKS(dir->i_sb)); |
2201 | if (IS_ERR(handle)) | 2211 | if (IS_ERR(handle)) |
2202 | return PTR_ERR(handle); | 2212 | return PTR_ERR(handle); |
@@ -2251,6 +2261,8 @@ static int ext4_symlink(struct inode *dir, | |||
2251 | if (l > dir->i_sb->s_blocksize) | 2261 | if (l > dir->i_sb->s_blocksize) |
2252 | return -ENAMETOOLONG; | 2262 | return -ENAMETOOLONG; |
2253 | 2263 | ||
2264 | dquot_initialize(dir); | ||
2265 | |||
2254 | retry: | 2266 | retry: |
2255 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + | 2267 | handle = ext4_journal_start(dir, EXT4_DATA_TRANS_BLOCKS(dir->i_sb) + |
2256 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 5 + | 2268 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 5 + |
@@ -2309,6 +2321,8 @@ static int ext4_link(struct dentry *old_dentry, | |||
2309 | if (inode->i_nlink >= EXT4_LINK_MAX) | 2321 | if (inode->i_nlink >= EXT4_LINK_MAX) |
2310 | return -EMLINK; | 2322 | return -EMLINK; |
2311 | 2323 | ||
2324 | dquot_initialize(dir); | ||
2325 | |||
2312 | /* | 2326 | /* |
2313 | * Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing | 2327 | * Return -ENOENT if we've raced with unlink and i_nlink is 0. Doing |
2314 | * otherwise has the potential to corrupt the orphan inode list. | 2328 | * otherwise has the potential to corrupt the orphan inode list. |
@@ -2359,12 +2373,15 @@ static int ext4_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
2359 | struct ext4_dir_entry_2 *old_de, *new_de; | 2373 | struct ext4_dir_entry_2 *old_de, *new_de; |
2360 | int retval, force_da_alloc = 0; | 2374 | int retval, force_da_alloc = 0; |
2361 | 2375 | ||
2376 | dquot_initialize(old_dir); | ||
2377 | dquot_initialize(new_dir); | ||
2378 | |||
2362 | old_bh = new_bh = dir_bh = NULL; | 2379 | old_bh = new_bh = dir_bh = NULL; |
2363 | 2380 | ||
2364 | /* Initialize quotas before so that eventual writes go | 2381 | /* Initialize quotas before so that eventual writes go |
2365 | * in separate transaction */ | 2382 | * in separate transaction */ |
2366 | if (new_dentry->d_inode) | 2383 | if (new_dentry->d_inode) |
2367 | vfs_dq_init(new_dentry->d_inode); | 2384 | dquot_initialize(new_dentry->d_inode); |
2368 | handle = ext4_journal_start(old_dir, 2 * | 2385 | handle = ext4_journal_start(old_dir, 2 * |
2369 | EXT4_DATA_TRANS_BLOCKS(old_dir->i_sb) + | 2386 | EXT4_DATA_TRANS_BLOCKS(old_dir->i_sb) + |
2370 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 2); | 2387 | EXT4_INDEX_EXTRA_TRANS_BLOCKS + 2); |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index ad1ee5f21bab..2b83b96cb2eb 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -798,6 +798,7 @@ static void destroy_inodecache(void) | |||
798 | 798 | ||
799 | static void ext4_clear_inode(struct inode *inode) | 799 | static void ext4_clear_inode(struct inode *inode) |
800 | { | 800 | { |
801 | dquot_drop(inode); | ||
801 | ext4_discard_preallocations(inode); | 802 | ext4_discard_preallocations(inode); |
802 | if (EXT4_JOURNAL(inode)) | 803 | if (EXT4_JOURNAL(inode)) |
803 | jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal, | 804 | jbd2_journal_release_jbd_inode(EXT4_SB(inode->i_sb)->s_journal, |
@@ -1052,19 +1053,9 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type, | |||
1052 | const char *data, size_t len, loff_t off); | 1053 | const char *data, size_t len, loff_t off); |
1053 | 1054 | ||
1054 | static const struct dquot_operations ext4_quota_operations = { | 1055 | static const struct dquot_operations ext4_quota_operations = { |
1055 | .initialize = dquot_initialize, | ||
1056 | .drop = dquot_drop, | ||
1057 | .alloc_space = dquot_alloc_space, | ||
1058 | .reserve_space = dquot_reserve_space, | ||
1059 | .claim_space = dquot_claim_space, | ||
1060 | .release_rsv = dquot_release_reserved_space, | ||
1061 | #ifdef CONFIG_QUOTA | 1056 | #ifdef CONFIG_QUOTA |
1062 | .get_reserved_space = ext4_get_reserved_space, | 1057 | .get_reserved_space = ext4_get_reserved_space, |
1063 | #endif | 1058 | #endif |
1064 | .alloc_inode = dquot_alloc_inode, | ||
1065 | .free_space = dquot_free_space, | ||
1066 | .free_inode = dquot_free_inode, | ||
1067 | .transfer = dquot_transfer, | ||
1068 | .write_dquot = ext4_write_dquot, | 1059 | .write_dquot = ext4_write_dquot, |
1069 | .acquire_dquot = ext4_acquire_dquot, | 1060 | .acquire_dquot = ext4_acquire_dquot, |
1070 | .release_dquot = ext4_release_dquot, | 1061 | .release_dquot = ext4_release_dquot, |
@@ -2014,7 +2005,7 @@ static void ext4_orphan_cleanup(struct super_block *sb, | |||
2014 | } | 2005 | } |
2015 | 2006 | ||
2016 | list_add(&EXT4_I(inode)->i_orphan, &EXT4_SB(sb)->s_orphan); | 2007 | list_add(&EXT4_I(inode)->i_orphan, &EXT4_SB(sb)->s_orphan); |
2017 | vfs_dq_init(inode); | 2008 | dquot_initialize(inode); |
2018 | if (inode->i_nlink) { | 2009 | if (inode->i_nlink) { |
2019 | ext4_msg(sb, KERN_DEBUG, | 2010 | ext4_msg(sb, KERN_DEBUG, |
2020 | "%s: truncating inode %lu to %lld bytes", | 2011 | "%s: truncating inode %lu to %lld bytes", |
@@ -3801,7 +3792,7 @@ static int ext4_statfs(struct dentry *dentry, struct kstatfs *buf) | |||
3801 | * Process 1 Process 2 | 3792 | * Process 1 Process 2 |
3802 | * ext4_create() quota_sync() | 3793 | * ext4_create() quota_sync() |
3803 | * jbd2_journal_start() write_dquot() | 3794 | * jbd2_journal_start() write_dquot() |
3804 | * vfs_dq_init() down(dqio_mutex) | 3795 | * dquot_initialize() down(dqio_mutex) |
3805 | * down(dqio_mutex) jbd2_journal_start() | 3796 | * down(dqio_mutex) jbd2_journal_start() |
3806 | * | 3797 | * |
3807 | */ | 3798 | */ |
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index efc16a4b7ceb..b4c5aa8489d8 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
@@ -495,7 +495,7 @@ ext4_xattr_release_block(handle_t *handle, struct inode *inode, | |||
495 | error = ext4_handle_dirty_metadata(handle, inode, bh); | 495 | error = ext4_handle_dirty_metadata(handle, inode, bh); |
496 | if (IS_SYNC(inode)) | 496 | if (IS_SYNC(inode)) |
497 | ext4_handle_sync(handle); | 497 | ext4_handle_sync(handle); |
498 | vfs_dq_free_block(inode, 1); | 498 | dquot_free_block(inode, 1); |
499 | ea_bdebug(bh, "refcount now=%d; releasing", | 499 | ea_bdebug(bh, "refcount now=%d; releasing", |
500 | le32_to_cpu(BHDR(bh)->h_refcount)); | 500 | le32_to_cpu(BHDR(bh)->h_refcount)); |
501 | if (ce) | 501 | if (ce) |
@@ -787,8 +787,8 @@ inserted: | |||
787 | else { | 787 | else { |
788 | /* The old block is released after updating | 788 | /* The old block is released after updating |
789 | the inode. */ | 789 | the inode. */ |
790 | error = -EDQUOT; | 790 | error = dquot_alloc_block(inode, 1); |
791 | if (vfs_dq_alloc_block(inode, 1)) | 791 | if (error) |
792 | goto cleanup; | 792 | goto cleanup; |
793 | error = ext4_journal_get_write_access(handle, | 793 | error = ext4_journal_get_write_access(handle, |
794 | new_bh); | 794 | new_bh); |
@@ -876,7 +876,7 @@ cleanup: | |||
876 | return error; | 876 | return error; |
877 | 877 | ||
878 | cleanup_dquot: | 878 | cleanup_dquot: |
879 | vfs_dq_free_block(inode, 1); | 879 | dquot_free_block(inode, 1); |
880 | goto cleanup; | 880 | goto cleanup; |
881 | 881 | ||
882 | bad_block: | 882 | bad_block: |