diff options
Diffstat (limited to 'fs/reiserfs/namei.c')
-rw-r--r-- | fs/reiserfs/namei.c | 23 |
1 files changed, 20 insertions, 3 deletions
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 | ||