diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-05 16:20:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-05 16:20:53 -0500 |
commit | e213e26ab3988c516c06eba4dcd030ac052f6dc9 (patch) | |
tree | 6e26fbdbb842b387697d73daf6e70cf718269a77 /fs/reiserfs | |
parent | c812a51d11bbe983f4c24e32b59b265705ddd3c2 (diff) | |
parent | efd8f0e6f6c1faa041f228d7113bd3a9db802d49 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: (33 commits)
quota: stop using QUOTA_OK / NO_QUOTA
dquot: cleanup dquot initialize routine
dquot: move dquot initialization responsibility into the filesystem
dquot: cleanup dquot drop routine
dquot: move dquot drop responsibility into the filesystem
dquot: cleanup dquot transfer routine
dquot: move dquot transfer responsibility into the filesystem
dquot: cleanup inode allocation / freeing routines
dquot: cleanup space allocation / freeing routines
ext3: add writepage sanity checks
ext3: Truncate allocated blocks if direct IO write fails to update i_size
quota: Properly invalidate caches even for filesystems with blocksize < pagesize
quota: generalize quota transfer interface
quota: sb_quota state flags cleanup
jbd: Delay discarding buffers in journal_unmap_buffer
ext3: quota_write cross block boundary behaviour
quota: drop permission checks from xfs_fs_set_xstate/xfs_fs_set_xquota
quota: split out compat_sys_quotactl support from quota.c
quota: split out netlink notification support from quota.c
quota: remove invalid optimization from quota_sync_all
...
Fixed trivial conflicts in fs/namei.c and fs/ufs/inode.c
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/bitmap.c | 10 | ||||
-rw-r--r-- | fs/reiserfs/file.c | 2 | ||||
-rw-r--r-- | fs/reiserfs/inode.c | 20 | ||||
-rw-r--r-- | fs/reiserfs/namei.c | 23 | ||||
-rw-r--r-- | fs/reiserfs/stree.c | 20 | ||||
-rw-r--r-- | fs/reiserfs/super.c | 15 | ||||
-rw-r--r-- | fs/reiserfs/xattr.c | 4 |
7 files changed, 56 insertions, 38 deletions
diff --git a/fs/reiserfs/bitmap.c b/fs/reiserfs/bitmap.c index 65c872761177..dc014f7def05 100644 --- a/fs/reiserfs/bitmap.c +++ b/fs/reiserfs/bitmap.c | |||
@@ -425,7 +425,7 @@ static void _reiserfs_free_block(struct reiserfs_transaction_handle *th, | |||
425 | 425 | ||
426 | journal_mark_dirty(th, s, sbh); | 426 | journal_mark_dirty(th, s, sbh); |
427 | if (for_unformatted) | 427 | if (for_unformatted) |
428 | vfs_dq_free_block_nodirty(inode, 1); | 428 | dquot_free_block_nodirty(inode, 1); |
429 | } | 429 | } |
430 | 430 | ||
431 | void reiserfs_free_block(struct reiserfs_transaction_handle *th, | 431 | void reiserfs_free_block(struct reiserfs_transaction_handle *th, |
@@ -1049,7 +1049,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start | |||
1049 | amount_needed, hint->inode->i_uid); | 1049 | amount_needed, hint->inode->i_uid); |
1050 | #endif | 1050 | #endif |
1051 | quota_ret = | 1051 | quota_ret = |
1052 | vfs_dq_alloc_block_nodirty(hint->inode, amount_needed); | 1052 | dquot_alloc_block_nodirty(hint->inode, amount_needed); |
1053 | if (quota_ret) /* Quota exceeded? */ | 1053 | if (quota_ret) /* Quota exceeded? */ |
1054 | return QUOTA_EXCEEDED; | 1054 | return QUOTA_EXCEEDED; |
1055 | if (hint->preallocate && hint->prealloc_size) { | 1055 | if (hint->preallocate && hint->prealloc_size) { |
@@ -1058,7 +1058,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start | |||
1058 | "reiserquota: allocating (prealloc) %d blocks id=%u", | 1058 | "reiserquota: allocating (prealloc) %d blocks id=%u", |
1059 | hint->prealloc_size, hint->inode->i_uid); | 1059 | hint->prealloc_size, hint->inode->i_uid); |
1060 | #endif | 1060 | #endif |
1061 | quota_ret = vfs_dq_prealloc_block_nodirty(hint->inode, | 1061 | quota_ret = dquot_prealloc_block_nodirty(hint->inode, |
1062 | hint->prealloc_size); | 1062 | hint->prealloc_size); |
1063 | if (quota_ret) | 1063 | if (quota_ret) |
1064 | hint->preallocate = hint->prealloc_size = 0; | 1064 | hint->preallocate = hint->prealloc_size = 0; |
@@ -1092,7 +1092,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start | |||
1092 | hint->inode->i_uid); | 1092 | hint->inode->i_uid); |
1093 | #endif | 1093 | #endif |
1094 | /* Free not allocated blocks */ | 1094 | /* Free not allocated blocks */ |
1095 | vfs_dq_free_block_nodirty(hint->inode, | 1095 | dquot_free_block_nodirty(hint->inode, |
1096 | amount_needed + hint->prealloc_size - | 1096 | amount_needed + hint->prealloc_size - |
1097 | nr_allocated); | 1097 | nr_allocated); |
1098 | } | 1098 | } |
@@ -1125,7 +1125,7 @@ static inline int blocknrs_and_prealloc_arrays_from_search_start | |||
1125 | REISERFS_I(hint->inode)->i_prealloc_count, | 1125 | REISERFS_I(hint->inode)->i_prealloc_count, |
1126 | hint->inode->i_uid); | 1126 | hint->inode->i_uid); |
1127 | #endif | 1127 | #endif |
1128 | vfs_dq_free_block_nodirty(hint->inode, amount_needed + | 1128 | dquot_free_block_nodirty(hint->inode, amount_needed + |
1129 | hint->prealloc_size - nr_allocated - | 1129 | hint->prealloc_size - nr_allocated - |
1130 | REISERFS_I(hint->inode)-> | 1130 | REISERFS_I(hint->inode)-> |
1131 | i_prealloc_count); | 1131 | i_prealloc_count); |
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index da2dba082e2d..1d9c12714c5c 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c | |||
@@ -289,7 +289,7 @@ const struct file_operations reiserfs_file_operations = { | |||
289 | .compat_ioctl = reiserfs_compat_ioctl, | 289 | .compat_ioctl = reiserfs_compat_ioctl, |
290 | #endif | 290 | #endif |
291 | .mmap = reiserfs_file_mmap, | 291 | .mmap = reiserfs_file_mmap, |
292 | .open = generic_file_open, | 292 | .open = dquot_file_open, |
293 | .release = reiserfs_file_release, | 293 | .release = reiserfs_file_release, |
294 | .fsync = reiserfs_sync_file, | 294 | .fsync = reiserfs_sync_file, |
295 | .aio_read = generic_file_aio_read, | 295 | .aio_read = generic_file_aio_read, |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 0d651f980a8d..d1da94b82d8f 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -34,6 +34,9 @@ void reiserfs_delete_inode(struct inode *inode) | |||
34 | int depth; | 34 | int depth; |
35 | int err; | 35 | int err; |
36 | 36 | ||
37 | if (!is_bad_inode(inode)) | ||
38 | dquot_initialize(inode); | ||
39 | |||
37 | truncate_inode_pages(&inode->i_data, 0); | 40 | truncate_inode_pages(&inode->i_data, 0); |
38 | 41 | ||
39 | depth = reiserfs_write_lock_once(inode->i_sb); | 42 | depth = reiserfs_write_lock_once(inode->i_sb); |
@@ -54,7 +57,7 @@ void reiserfs_delete_inode(struct inode *inode) | |||
54 | * after delete_object so that quota updates go into the same transaction as | 57 | * after delete_object so that quota updates go into the same transaction as |
55 | * stat data deletion */ | 58 | * stat data deletion */ |
56 | if (!err) | 59 | if (!err) |
57 | vfs_dq_free_inode(inode); | 60 | dquot_free_inode(inode); |
58 | 61 | ||
59 | if (journal_end(&th, inode->i_sb, jbegin_count)) | 62 | if (journal_end(&th, inode->i_sb, jbegin_count)) |
60 | goto out; | 63 | goto out; |
@@ -1765,10 +1768,10 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
1765 | 1768 | ||
1766 | BUG_ON(!th->t_trans_id); | 1769 | BUG_ON(!th->t_trans_id); |
1767 | 1770 | ||
1768 | if (vfs_dq_alloc_inode(inode)) { | 1771 | dquot_initialize(inode); |
1769 | err = -EDQUOT; | 1772 | err = dquot_alloc_inode(inode); |
1773 | if (err) | ||
1770 | goto out_end_trans; | 1774 | goto out_end_trans; |
1771 | } | ||
1772 | if (!dir->i_nlink) { | 1775 | if (!dir->i_nlink) { |
1773 | err = -EPERM; | 1776 | err = -EPERM; |
1774 | goto out_bad_inode; | 1777 | goto out_bad_inode; |
@@ -1959,12 +1962,12 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th, | |||
1959 | INODE_PKEY(inode)->k_objectid = 0; | 1962 | INODE_PKEY(inode)->k_objectid = 0; |
1960 | 1963 | ||
1961 | /* Quota change must be inside a transaction for journaling */ | 1964 | /* Quota change must be inside a transaction for journaling */ |
1962 | vfs_dq_free_inode(inode); | 1965 | dquot_free_inode(inode); |
1963 | 1966 | ||
1964 | out_end_trans: | 1967 | out_end_trans: |
1965 | journal_end(th, th->t_super, th->t_blocks_allocated); | 1968 | journal_end(th, th->t_super, th->t_blocks_allocated); |
1966 | /* Drop can be outside and it needs more credits so it's better to have it outside */ | 1969 | /* Drop can be outside and it needs more credits so it's better to have it outside */ |
1967 | vfs_dq_drop(inode); | 1970 | dquot_drop(inode); |
1968 | inode->i_flags |= S_NOQUOTA; | 1971 | inode->i_flags |= S_NOQUOTA; |
1969 | make_bad_inode(inode); | 1972 | make_bad_inode(inode); |
1970 | 1973 | ||
@@ -3073,6 +3076,8 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
3073 | 3076 | ||
3074 | depth = reiserfs_write_lock_once(inode->i_sb); | 3077 | depth = reiserfs_write_lock_once(inode->i_sb); |
3075 | if (attr->ia_valid & ATTR_SIZE) { | 3078 | if (attr->ia_valid & ATTR_SIZE) { |
3079 | dquot_initialize(inode); | ||
3080 | |||
3076 | /* version 2 items will be caught by the s_maxbytes check | 3081 | /* version 2 items will be caught by the s_maxbytes check |
3077 | ** done for us in vmtruncate | 3082 | ** done for us in vmtruncate |
3078 | */ | 3083 | */ |
@@ -3134,8 +3139,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) | |||
3134 | jbegin_count); | 3139 | jbegin_count); |
3135 | if (error) | 3140 | if (error) |
3136 | goto out; | 3141 | goto out; |
3137 | error = | 3142 | error = dquot_transfer(inode, attr); |
3138 | vfs_dq_transfer(inode, attr) ? -EDQUOT : 0; | ||
3139 | if (error) { | 3143 | if (error) { |
3140 | journal_end(&th, inode->i_sb, | 3144 | journal_end(&th, inode->i_sb, |
3141 | jbegin_count); | 3145 | jbegin_count); |
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index 9d4dcf0b07cb..96e4cbbfaa18 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -546,7 +546,7 @@ static int reiserfs_add_entry(struct reiserfs_transaction_handle *th, | |||
546 | */ | 546 | */ |
547 | static int drop_new_inode(struct inode *inode) | 547 | static int drop_new_inode(struct inode *inode) |
548 | { | 548 | { |
549 | vfs_dq_drop(inode); | 549 | dquot_drop(inode); |
550 | make_bad_inode(inode); | 550 | make_bad_inode(inode); |
551 | inode->i_flags |= S_NOQUOTA; | 551 | inode->i_flags |= S_NOQUOTA; |
552 | iput(inode); | 552 | iput(inode); |
@@ -554,7 +554,7 @@ static int drop_new_inode(struct inode *inode) | |||
554 | } | 554 | } |
555 | 555 | ||
556 | /* utility function that does setup for reiserfs_new_inode. | 556 | /* utility function that does setup for reiserfs_new_inode. |
557 | ** vfs_dq_init needs lots of credits so it's better to have it | 557 | ** dquot_initialize needs lots of credits so it's better to have it |
558 | ** outside of a transaction, so we had to pull some bits of | 558 | ** outside of a transaction, so we had to pull some bits of |
559 | ** reiserfs_new_inode out into this func. | 559 | ** reiserfs_new_inode out into this func. |
560 | */ | 560 | */ |
@@ -577,7 +577,7 @@ static int new_inode_init(struct inode *inode, struct inode *dir, int mode) | |||
577 | } else { | 577 | } else { |
578 | inode->i_gid = current_fsgid(); | 578 | inode->i_gid = current_fsgid(); |
579 | } | 579 | } |
580 | vfs_dq_init(inode); | 580 | dquot_initialize(inode); |
581 | return 0; | 581 | return 0; |
582 | } | 582 | } |
583 | 583 | ||
@@ -594,6 +594,8 @@ static int reiserfs_create(struct inode *dir, struct dentry *dentry, int mode, | |||
594 | struct reiserfs_transaction_handle th; | 594 | struct reiserfs_transaction_handle th; |
595 | struct reiserfs_security_handle security; | 595 | struct reiserfs_security_handle security; |
596 | 596 | ||
597 | dquot_initialize(dir); | ||
598 | |||
597 | if (!(inode = new_inode(dir->i_sb))) { | 599 | if (!(inode = new_inode(dir->i_sb))) { |
598 | return -ENOMEM; | 600 | return -ENOMEM; |
599 | } | 601 | } |
@@ -666,6 +668,8 @@ static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, int mode, | |||
666 | if (!new_valid_dev(rdev)) | 668 | if (!new_valid_dev(rdev)) |
667 | return -EINVAL; | 669 | return -EINVAL; |
668 | 670 | ||
671 | dquot_initialize(dir); | ||
672 | |||
669 | if (!(inode = new_inode(dir->i_sb))) { | 673 | if (!(inode = new_inode(dir->i_sb))) { |
670 | return -ENOMEM; | 674 | return -ENOMEM; |
671 | } | 675 | } |
@@ -739,6 +743,8 @@ static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
739 | 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + | 743 | 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + |
740 | REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); | 744 | REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); |
741 | 745 | ||
746 | dquot_initialize(dir); | ||
747 | |||
742 | #ifdef DISPLACE_NEW_PACKING_LOCALITIES | 748 | #ifdef DISPLACE_NEW_PACKING_LOCALITIES |
743 | /* set flag that new packing locality created and new blocks for the content * of that directory are not displaced yet */ | 749 | /* set flag that new packing locality created and new blocks for the content * of that directory are not displaced yet */ |
744 | REISERFS_I(dir)->new_packing_locality = 1; | 750 | REISERFS_I(dir)->new_packing_locality = 1; |
@@ -842,6 +848,8 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
842 | JOURNAL_PER_BALANCE_CNT * 2 + 2 + | 848 | JOURNAL_PER_BALANCE_CNT * 2 + 2 + |
843 | 4 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); | 849 | 4 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); |
844 | 850 | ||
851 | dquot_initialize(dir); | ||
852 | |||
845 | reiserfs_write_lock(dir->i_sb); | 853 | reiserfs_write_lock(dir->i_sb); |
846 | retval = journal_begin(&th, dir->i_sb, jbegin_count); | 854 | retval = journal_begin(&th, dir->i_sb, jbegin_count); |
847 | if (retval) | 855 | if (retval) |
@@ -923,6 +931,8 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry) | |||
923 | unsigned long savelink; | 931 | unsigned long savelink; |
924 | int depth; | 932 | int depth; |
925 | 933 | ||
934 | dquot_initialize(dir); | ||
935 | |||
926 | inode = dentry->d_inode; | 936 | inode = dentry->d_inode; |
927 | 937 | ||
928 | /* in this transaction we can be doing at max two balancings and update | 938 | /* in this transaction we can be doing at max two balancings and update |
@@ -1024,6 +1034,8 @@ static int reiserfs_symlink(struct inode *parent_dir, | |||
1024 | 2 * (REISERFS_QUOTA_INIT_BLOCKS(parent_dir->i_sb) + | 1034 | 2 * (REISERFS_QUOTA_INIT_BLOCKS(parent_dir->i_sb) + |
1025 | REISERFS_QUOTA_TRANS_BLOCKS(parent_dir->i_sb)); | 1035 | REISERFS_QUOTA_TRANS_BLOCKS(parent_dir->i_sb)); |
1026 | 1036 | ||
1037 | dquot_initialize(parent_dir); | ||
1038 | |||
1027 | if (!(inode = new_inode(parent_dir->i_sb))) { | 1039 | if (!(inode = new_inode(parent_dir->i_sb))) { |
1028 | return -ENOMEM; | 1040 | return -ENOMEM; |
1029 | } | 1041 | } |
@@ -1111,6 +1123,8 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir, | |||
1111 | JOURNAL_PER_BALANCE_CNT * 3 + | 1123 | JOURNAL_PER_BALANCE_CNT * 3 + |
1112 | 2 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); | 1124 | 2 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); |
1113 | 1125 | ||
1126 | dquot_initialize(dir); | ||
1127 | |||
1114 | reiserfs_write_lock(dir->i_sb); | 1128 | reiserfs_write_lock(dir->i_sb); |
1115 | if (inode->i_nlink >= REISERFS_LINK_MAX) { | 1129 | if (inode->i_nlink >= REISERFS_LINK_MAX) { |
1116 | //FIXME: sd_nlink is 32 bit for new files | 1130 | //FIXME: sd_nlink is 32 bit for new files |
@@ -1235,6 +1249,9 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1235 | JOURNAL_PER_BALANCE_CNT * 3 + 5 + | 1249 | JOURNAL_PER_BALANCE_CNT * 3 + 5 + |
1236 | 4 * REISERFS_QUOTA_TRANS_BLOCKS(old_dir->i_sb); | 1250 | 4 * REISERFS_QUOTA_TRANS_BLOCKS(old_dir->i_sb); |
1237 | 1251 | ||
1252 | dquot_initialize(old_dir); | ||
1253 | dquot_initialize(new_dir); | ||
1254 | |||
1238 | old_inode = old_dentry->d_inode; | 1255 | old_inode = old_dentry->d_inode; |
1239 | new_dentry_inode = new_dentry->d_inode; | 1256 | new_dentry_inode = new_dentry->d_inode; |
1240 | 1257 | ||
diff --git a/fs/reiserfs/stree.c b/fs/reiserfs/stree.c index 5fa7118f04e1..313d39d639eb 100644 --- a/fs/reiserfs/stree.c +++ b/fs/reiserfs/stree.c | |||
@@ -1299,7 +1299,7 @@ int reiserfs_delete_item(struct reiserfs_transaction_handle *th, | |||
1299 | "reiserquota delete_item(): freeing %u, id=%u type=%c", | 1299 | "reiserquota delete_item(): freeing %u, id=%u type=%c", |
1300 | quota_cut_bytes, inode->i_uid, head2type(&s_ih)); | 1300 | quota_cut_bytes, inode->i_uid, head2type(&s_ih)); |
1301 | #endif | 1301 | #endif |
1302 | vfs_dq_free_space_nodirty(inode, quota_cut_bytes); | 1302 | dquot_free_space_nodirty(inode, quota_cut_bytes); |
1303 | 1303 | ||
1304 | /* Return deleted body length */ | 1304 | /* Return deleted body length */ |
1305 | return ret_value; | 1305 | return ret_value; |
@@ -1383,7 +1383,7 @@ void reiserfs_delete_solid_item(struct reiserfs_transaction_handle *th, | |||
1383 | quota_cut_bytes, inode->i_uid, | 1383 | quota_cut_bytes, inode->i_uid, |
1384 | key2type(key)); | 1384 | key2type(key)); |
1385 | #endif | 1385 | #endif |
1386 | vfs_dq_free_space_nodirty(inode, | 1386 | dquot_free_space_nodirty(inode, |
1387 | quota_cut_bytes); | 1387 | quota_cut_bytes); |
1388 | } | 1388 | } |
1389 | break; | 1389 | break; |
@@ -1733,7 +1733,7 @@ int reiserfs_cut_from_item(struct reiserfs_transaction_handle *th, | |||
1733 | "reiserquota cut_from_item(): freeing %u id=%u type=%c", | 1733 | "reiserquota cut_from_item(): freeing %u id=%u type=%c", |
1734 | quota_cut_bytes, inode->i_uid, '?'); | 1734 | quota_cut_bytes, inode->i_uid, '?'); |
1735 | #endif | 1735 | #endif |
1736 | vfs_dq_free_space_nodirty(inode, quota_cut_bytes); | 1736 | dquot_free_space_nodirty(inode, quota_cut_bytes); |
1737 | return ret_value; | 1737 | return ret_value; |
1738 | } | 1738 | } |
1739 | 1739 | ||
@@ -1968,9 +1968,10 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree | |||
1968 | key2type(&(key->on_disk_key))); | 1968 | key2type(&(key->on_disk_key))); |
1969 | #endif | 1969 | #endif |
1970 | 1970 | ||
1971 | if (vfs_dq_alloc_space_nodirty(inode, pasted_size)) { | 1971 | retval = dquot_alloc_space_nodirty(inode, pasted_size); |
1972 | if (retval) { | ||
1972 | pathrelse(search_path); | 1973 | pathrelse(search_path); |
1973 | return -EDQUOT; | 1974 | return retval; |
1974 | } | 1975 | } |
1975 | init_tb_struct(th, &s_paste_balance, th->t_super, search_path, | 1976 | init_tb_struct(th, &s_paste_balance, th->t_super, search_path, |
1976 | pasted_size); | 1977 | pasted_size); |
@@ -2024,7 +2025,7 @@ int reiserfs_paste_into_item(struct reiserfs_transaction_handle *th, struct tree | |||
2024 | pasted_size, inode->i_uid, | 2025 | pasted_size, inode->i_uid, |
2025 | key2type(&(key->on_disk_key))); | 2026 | key2type(&(key->on_disk_key))); |
2026 | #endif | 2027 | #endif |
2027 | vfs_dq_free_space_nodirty(inode, pasted_size); | 2028 | dquot_free_space_nodirty(inode, pasted_size); |
2028 | return retval; | 2029 | return retval; |
2029 | } | 2030 | } |
2030 | 2031 | ||
@@ -2062,9 +2063,10 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, | |||
2062 | #endif | 2063 | #endif |
2063 | /* We can't dirty inode here. It would be immediately written but | 2064 | /* We can't dirty inode here. It would be immediately written but |
2064 | * appropriate stat item isn't inserted yet... */ | 2065 | * appropriate stat item isn't inserted yet... */ |
2065 | if (vfs_dq_alloc_space_nodirty(inode, quota_bytes)) { | 2066 | retval = dquot_alloc_space_nodirty(inode, quota_bytes); |
2067 | if (retval) { | ||
2066 | pathrelse(path); | 2068 | pathrelse(path); |
2067 | return -EDQUOT; | 2069 | return retval; |
2068 | } | 2070 | } |
2069 | } | 2071 | } |
2070 | init_tb_struct(th, &s_ins_balance, th->t_super, path, | 2072 | init_tb_struct(th, &s_ins_balance, th->t_super, path, |
@@ -2113,6 +2115,6 @@ int reiserfs_insert_item(struct reiserfs_transaction_handle *th, | |||
2113 | quota_bytes, inode->i_uid, head2type(ih)); | 2115 | quota_bytes, inode->i_uid, head2type(ih)); |
2114 | #endif | 2116 | #endif |
2115 | if (inode) | 2117 | if (inode) |
2116 | vfs_dq_free_space_nodirty(inode, quota_bytes); | 2118 | dquot_free_space_nodirty(inode, quota_bytes); |
2117 | return retval; | 2119 | return retval; |
2118 | } | 2120 | } |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index b4a7dd03bdb9..04bf5d791bda 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -246,7 +246,7 @@ static int finish_unfinished(struct super_block *s) | |||
246 | retval = remove_save_link_only(s, &save_link_key, 0); | 246 | retval = remove_save_link_only(s, &save_link_key, 0); |
247 | continue; | 247 | continue; |
248 | } | 248 | } |
249 | vfs_dq_init(inode); | 249 | dquot_initialize(inode); |
250 | 250 | ||
251 | if (truncate && S_ISDIR(inode->i_mode)) { | 251 | if (truncate && S_ISDIR(inode->i_mode)) { |
252 | /* We got a truncate request for a dir which is impossible. | 252 | /* We got a truncate request for a dir which is impossible. |
@@ -578,6 +578,11 @@ out: | |||
578 | reiserfs_write_unlock_once(inode->i_sb, lock_depth); | 578 | reiserfs_write_unlock_once(inode->i_sb, lock_depth); |
579 | } | 579 | } |
580 | 580 | ||
581 | static void reiserfs_clear_inode(struct inode *inode) | ||
582 | { | ||
583 | dquot_drop(inode); | ||
584 | } | ||
585 | |||
581 | #ifdef CONFIG_QUOTA | 586 | #ifdef CONFIG_QUOTA |
582 | static ssize_t reiserfs_quota_write(struct super_block *, int, const char *, | 587 | static ssize_t reiserfs_quota_write(struct super_block *, int, const char *, |
583 | size_t, loff_t); | 588 | size_t, loff_t); |
@@ -590,6 +595,7 @@ static const struct super_operations reiserfs_sops = { | |||
590 | .destroy_inode = reiserfs_destroy_inode, | 595 | .destroy_inode = reiserfs_destroy_inode, |
591 | .write_inode = reiserfs_write_inode, | 596 | .write_inode = reiserfs_write_inode, |
592 | .dirty_inode = reiserfs_dirty_inode, | 597 | .dirty_inode = reiserfs_dirty_inode, |
598 | .clear_inode = reiserfs_clear_inode, | ||
593 | .delete_inode = reiserfs_delete_inode, | 599 | .delete_inode = reiserfs_delete_inode, |
594 | .put_super = reiserfs_put_super, | 600 | .put_super = reiserfs_put_super, |
595 | .write_super = reiserfs_write_super, | 601 | .write_super = reiserfs_write_super, |
@@ -616,13 +622,6 @@ static int reiserfs_write_info(struct super_block *, int); | |||
616 | static int reiserfs_quota_on(struct super_block *, int, int, char *, int); | 622 | static int reiserfs_quota_on(struct super_block *, int, int, char *, int); |
617 | 623 | ||
618 | static const struct dquot_operations reiserfs_quota_operations = { | 624 | static const struct dquot_operations reiserfs_quota_operations = { |
619 | .initialize = dquot_initialize, | ||
620 | .drop = dquot_drop, | ||
621 | .alloc_space = dquot_alloc_space, | ||
622 | .alloc_inode = dquot_alloc_inode, | ||
623 | .free_space = dquot_free_space, | ||
624 | .free_inode = dquot_free_inode, | ||
625 | .transfer = dquot_transfer, | ||
626 | .write_dquot = reiserfs_write_dquot, | 625 | .write_dquot = reiserfs_write_dquot, |
627 | .acquire_dquot = reiserfs_acquire_dquot, | 626 | .acquire_dquot = reiserfs_acquire_dquot, |
628 | .release_dquot = reiserfs_release_dquot, | 627 | .release_dquot = reiserfs_release_dquot, |
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index 81f09fab8ae4..37d034ca7d99 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -61,7 +61,6 @@ | |||
61 | static int xattr_create(struct inode *dir, struct dentry *dentry, int mode) | 61 | static int xattr_create(struct inode *dir, struct dentry *dentry, int mode) |
62 | { | 62 | { |
63 | BUG_ON(!mutex_is_locked(&dir->i_mutex)); | 63 | BUG_ON(!mutex_is_locked(&dir->i_mutex)); |
64 | vfs_dq_init(dir); | ||
65 | return dir->i_op->create(dir, dentry, mode, NULL); | 64 | return dir->i_op->create(dir, dentry, mode, NULL); |
66 | } | 65 | } |
67 | #endif | 66 | #endif |
@@ -69,7 +68,6 @@ static int xattr_create(struct inode *dir, struct dentry *dentry, int mode) | |||
69 | static int xattr_mkdir(struct inode *dir, struct dentry *dentry, int mode) | 68 | static int xattr_mkdir(struct inode *dir, struct dentry *dentry, int mode) |
70 | { | 69 | { |
71 | BUG_ON(!mutex_is_locked(&dir->i_mutex)); | 70 | BUG_ON(!mutex_is_locked(&dir->i_mutex)); |
72 | vfs_dq_init(dir); | ||
73 | return dir->i_op->mkdir(dir, dentry, mode); | 71 | return dir->i_op->mkdir(dir, dentry, mode); |
74 | } | 72 | } |
75 | 73 | ||
@@ -81,7 +79,6 @@ static int xattr_unlink(struct inode *dir, struct dentry *dentry) | |||
81 | { | 79 | { |
82 | int error; | 80 | int error; |
83 | BUG_ON(!mutex_is_locked(&dir->i_mutex)); | 81 | BUG_ON(!mutex_is_locked(&dir->i_mutex)); |
84 | vfs_dq_init(dir); | ||
85 | 82 | ||
86 | reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex, | 83 | reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex, |
87 | I_MUTEX_CHILD, dir->i_sb); | 84 | I_MUTEX_CHILD, dir->i_sb); |
@@ -97,7 +94,6 @@ static int xattr_rmdir(struct inode *dir, struct dentry *dentry) | |||
97 | { | 94 | { |
98 | int error; | 95 | int error; |
99 | BUG_ON(!mutex_is_locked(&dir->i_mutex)); | 96 | BUG_ON(!mutex_is_locked(&dir->i_mutex)); |
100 | vfs_dq_init(dir); | ||
101 | 97 | ||
102 | reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex, | 98 | reiserfs_mutex_lock_nested_safe(&dentry->d_inode->i_mutex, |
103 | I_MUTEX_CHILD, dir->i_sb); | 99 | I_MUTEX_CHILD, dir->i_sb); |