aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-03-03 09:05:07 -0500
committerJan Kara <jack@suse.cz>2010-03-04 18:20:30 -0500
commit871a293155a24554e153538d36e3a80fa169aefb (patch)
tree7e38f5a2f9e87f63cbc4bc1077a4bb49dde441b0 /fs/reiserfs
parent907f4554e2521cb28b0009d17167760650a9561c (diff)
dquot: cleanup dquot initialize routine
Get rid of the initialize dquot operation - it is now always called from the filesystem and if a filesystem really needs it's own (which none currently does) it can just call into it's own routine directly. Rename the now static low-level dquot_initialize helper to __dquot_initialize and vfs_dq_init to dquot_initialize to have a consistent namespace. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/inode.c6
-rw-r--r--fs/reiserfs/namei.c22
-rw-r--r--fs/reiserfs/super.c3
3 files changed, 15 insertions, 16 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index 06995cb48e39..b8671a54e8ed 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -35,7 +35,7 @@ void reiserfs_delete_inode(struct inode *inode)
35 int err; 35 int err;
36 36
37 if (!is_bad_inode(inode)) 37 if (!is_bad_inode(inode))
38 vfs_dq_init(inode); 38 dquot_initialize(inode);
39 39
40 truncate_inode_pages(&inode->i_data, 0); 40 truncate_inode_pages(&inode->i_data, 0);
41 41
@@ -1768,7 +1768,7 @@ int reiserfs_new_inode(struct reiserfs_transaction_handle *th,
1768 1768
1769 BUG_ON(!th->t_trans_id); 1769 BUG_ON(!th->t_trans_id);
1770 1770
1771 vfs_dq_init(inode); 1771 dquot_initialize(inode);
1772 err = dquot_alloc_inode(inode); 1772 err = dquot_alloc_inode(inode);
1773 if (err) 1773 if (err)
1774 goto out_end_trans; 1774 goto out_end_trans;
@@ -3076,7 +3076,7 @@ int reiserfs_setattr(struct dentry *dentry, struct iattr *attr)
3076 3076
3077 depth = reiserfs_write_lock_once(inode->i_sb); 3077 depth = reiserfs_write_lock_once(inode->i_sb);
3078 if (attr->ia_valid & ATTR_SIZE) { 3078 if (attr->ia_valid & ATTR_SIZE) {
3079 vfs_dq_init(inode); 3079 dquot_initialize(inode);
3080 3080
3081 /* version 2 items will be caught by the s_maxbytes check 3081 /* version 2 items will be caught by the s_maxbytes check
3082 ** done for us in vmtruncate 3082 ** done for us in vmtruncate
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c
index c55e1b9fee5f..96e4cbbfaa18 100644
--- a/fs/reiserfs/namei.c
+++ b/fs/reiserfs/namei.c
@@ -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,7 +594,7 @@ 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 vfs_dq_init(dir); 597 dquot_initialize(dir);
598 598
599 if (!(inode = new_inode(dir->i_sb))) { 599 if (!(inode = new_inode(dir->i_sb))) {
600 return -ENOMEM; 600 return -ENOMEM;
@@ -668,7 +668,7 @@ static int reiserfs_mknod(struct inode *dir, struct dentry *dentry, int mode,
668 if (!new_valid_dev(rdev)) 668 if (!new_valid_dev(rdev))
669 return -EINVAL; 669 return -EINVAL;
670 670
671 vfs_dq_init(dir); 671 dquot_initialize(dir);
672 672
673 if (!(inode = new_inode(dir->i_sb))) { 673 if (!(inode = new_inode(dir->i_sb))) {
674 return -ENOMEM; 674 return -ENOMEM;
@@ -743,7 +743,7 @@ static int reiserfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
743 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) + 743 2 * (REISERFS_QUOTA_INIT_BLOCKS(dir->i_sb) +
744 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb)); 744 REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb));
745 745
746 vfs_dq_init(dir); 746 dquot_initialize(dir);
747 747
748#ifdef DISPLACE_NEW_PACKING_LOCALITIES 748#ifdef DISPLACE_NEW_PACKING_LOCALITIES
749 /* 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 */
@@ -848,7 +848,7 @@ static int reiserfs_rmdir(struct inode *dir, struct dentry *dentry)
848 JOURNAL_PER_BALANCE_CNT * 2 + 2 + 848 JOURNAL_PER_BALANCE_CNT * 2 + 2 +
849 4 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); 849 4 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb);
850 850
851 vfs_dq_init(dir); 851 dquot_initialize(dir);
852 852
853 reiserfs_write_lock(dir->i_sb); 853 reiserfs_write_lock(dir->i_sb);
854 retval = journal_begin(&th, dir->i_sb, jbegin_count); 854 retval = journal_begin(&th, dir->i_sb, jbegin_count);
@@ -931,7 +931,7 @@ static int reiserfs_unlink(struct inode *dir, struct dentry *dentry)
931 unsigned long savelink; 931 unsigned long savelink;
932 int depth; 932 int depth;
933 933
934 vfs_dq_init(dir); 934 dquot_initialize(dir);
935 935
936 inode = dentry->d_inode; 936 inode = dentry->d_inode;
937 937
@@ -1034,7 +1034,7 @@ static int reiserfs_symlink(struct inode *parent_dir,
1034 2 * (REISERFS_QUOTA_INIT_BLOCKS(parent_dir->i_sb) + 1034 2 * (REISERFS_QUOTA_INIT_BLOCKS(parent_dir->i_sb) +
1035 REISERFS_QUOTA_TRANS_BLOCKS(parent_dir->i_sb)); 1035 REISERFS_QUOTA_TRANS_BLOCKS(parent_dir->i_sb));
1036 1036
1037 vfs_dq_init(parent_dir); 1037 dquot_initialize(parent_dir);
1038 1038
1039 if (!(inode = new_inode(parent_dir->i_sb))) { 1039 if (!(inode = new_inode(parent_dir->i_sb))) {
1040 return -ENOMEM; 1040 return -ENOMEM;
@@ -1123,7 +1123,7 @@ static int reiserfs_link(struct dentry *old_dentry, struct inode *dir,
1123 JOURNAL_PER_BALANCE_CNT * 3 + 1123 JOURNAL_PER_BALANCE_CNT * 3 +
1124 2 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb); 1124 2 * REISERFS_QUOTA_TRANS_BLOCKS(dir->i_sb);
1125 1125
1126 vfs_dq_init(dir); 1126 dquot_initialize(dir);
1127 1127
1128 reiserfs_write_lock(dir->i_sb); 1128 reiserfs_write_lock(dir->i_sb);
1129 if (inode->i_nlink >= REISERFS_LINK_MAX) { 1129 if (inode->i_nlink >= REISERFS_LINK_MAX) {
@@ -1249,8 +1249,8 @@ static int reiserfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1249 JOURNAL_PER_BALANCE_CNT * 3 + 5 + 1249 JOURNAL_PER_BALANCE_CNT * 3 + 5 +
1250 4 * REISERFS_QUOTA_TRANS_BLOCKS(old_dir->i_sb); 1250 4 * REISERFS_QUOTA_TRANS_BLOCKS(old_dir->i_sb);
1251 1251
1252 vfs_dq_init(old_dir); 1252 dquot_initialize(old_dir);
1253 vfs_dq_init(new_dir); 1253 dquot_initialize(new_dir);
1254 1254
1255 old_inode = old_dentry->d_inode; 1255 old_inode = old_dentry->d_inode;
1256 new_dentry_inode = new_dentry->d_inode; 1256 new_dentry_inode = new_dentry->d_inode;
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 34f7cd0cb02d..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.
@@ -622,7 +622,6 @@ static int reiserfs_write_info(struct super_block *, int);
622static int reiserfs_quota_on(struct super_block *, int, int, char *, int); 622static int reiserfs_quota_on(struct super_block *, int, int, char *, int);
623 623
624static const struct dquot_operations reiserfs_quota_operations = { 624static const struct dquot_operations reiserfs_quota_operations = {
625 .initialize = dquot_initialize,
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,