aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-03-03 09:05:01 -0500
committerJan Kara <jack@suse.cz>2010-03-04 18:20:28 -0500
commit63936ddaa16b9486e2d426ed7b09f559a5c60f87 (patch)
tree4cb1c4581799e10c26dd71d1a7d420de3c2cfd05 /fs/ocfs2
parent5dd4056db84387975140ff2568eaa0406f07985e (diff)
dquot: cleanup inode allocation / freeing routines
Get rid of the alloc_inode and free_inode dquot operations - they are always called from the filesystem and if a filesystem really needs their own (which none currently does) it can just call into it's own routine directly. Also get rid of the vfs_dq_alloc/vfs_dq_free wrappers and always call the lowlevel dquot_alloc_inode / dqout_free_inode routines directly, which now lose the number argument which is always 1. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/inode.c2
-rw-r--r--fs/ocfs2/namei.c30
-rw-r--r--fs/ocfs2/quota_global.c2
3 files changed, 10 insertions, 24 deletions
diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c
index 88459bdd1ff3..cb7f67d8441a 100644
--- a/fs/ocfs2/inode.c
+++ b/fs/ocfs2/inode.c
@@ -665,7 +665,7 @@ static int ocfs2_remove_inode(struct inode *inode,
665 } 665 }
666 666
667 ocfs2_remove_from_cache(INODE_CACHE(inode), di_bh); 667 ocfs2_remove_from_cache(INODE_CACHE(inode), di_bh);
668 vfs_dq_free_inode(inode); 668 dquot_free_inode(inode);
669 669
670 status = ocfs2_free_dinode(handle, inode_alloc_inode, 670 status = ocfs2_free_dinode(handle, inode_alloc_inode,
671 inode_alloc_bh, di); 671 inode_alloc_bh, di);
diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c
index 13adaa1f40cd..99766b6418eb 100644
--- a/fs/ocfs2/namei.c
+++ b/fs/ocfs2/namei.c
@@ -348,13 +348,9 @@ static int ocfs2_mknod(struct inode *dir,
348 goto leave; 348 goto leave;
349 } 349 }
350 350
351 /* We don't use standard VFS wrapper because we don't want vfs_dq_init 351 status = dquot_alloc_inode(inode);
352 * to be called. */ 352 if (status)
353 if (sb_any_quota_active(osb->sb) &&
354 osb->sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) {
355 status = -EDQUOT;
356 goto leave; 353 goto leave;
357 }
358 did_quota_inode = 1; 354 did_quota_inode = 1;
359 355
360 mlog_entry("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry, 356 mlog_entry("(0x%p, 0x%p, %d, %lu, '%.*s')\n", dir, dentry,
@@ -431,7 +427,7 @@ static int ocfs2_mknod(struct inode *dir,
431 status = 0; 427 status = 0;
432leave: 428leave:
433 if (status < 0 && did_quota_inode) 429 if (status < 0 && did_quota_inode)
434 vfs_dq_free_inode(inode); 430 dquot_free_inode(inode);
435 if (handle) 431 if (handle)
436 ocfs2_commit_trans(osb, handle); 432 ocfs2_commit_trans(osb, handle);
437 433
@@ -1688,13 +1684,9 @@ static int ocfs2_symlink(struct inode *dir,
1688 goto bail; 1684 goto bail;
1689 } 1685 }
1690 1686
1691 /* We don't use standard VFS wrapper because we don't want vfs_dq_init 1687 status = dquot_alloc_inode(inode);
1692 * to be called. */ 1688 if (status)
1693 if (sb_any_quota_active(osb->sb) &&
1694 osb->sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) {
1695 status = -EDQUOT;
1696 goto bail; 1689 goto bail;
1697 }
1698 did_quota_inode = 1; 1690 did_quota_inode = 1;
1699 1691
1700 mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry, 1692 mlog_entry("(0x%p, 0x%p, %d, '%.*s')\n", dir, dentry,
@@ -1790,7 +1782,7 @@ bail:
1790 dquot_free_space_nodirty(inode, 1782 dquot_free_space_nodirty(inode,
1791 ocfs2_clusters_to_bytes(osb->sb, 1)); 1783 ocfs2_clusters_to_bytes(osb->sb, 1));
1792 if (status < 0 && did_quota_inode) 1784 if (status < 0 && did_quota_inode)
1793 vfs_dq_free_inode(inode); 1785 dquot_free_inode(inode);
1794 if (handle) 1786 if (handle)
1795 ocfs2_commit_trans(osb, handle); 1787 ocfs2_commit_trans(osb, handle);
1796 1788
@@ -2098,13 +2090,9 @@ int ocfs2_create_inode_in_orphan(struct inode *dir,
2098 goto leave; 2090 goto leave;
2099 } 2091 }
2100 2092
2101 /* We don't use standard VFS wrapper because we don't want vfs_dq_init 2093 status = dquot_alloc_inode(inode);
2102 * to be called. */ 2094 if (status)
2103 if (sb_any_quota_active(osb->sb) &&
2104 osb->sb->dq_op->alloc_inode(inode, 1) == NO_QUOTA) {
2105 status = -EDQUOT;
2106 goto leave; 2095 goto leave;
2107 }
2108 did_quota_inode = 1; 2096 did_quota_inode = 1;
2109 2097
2110 inode->i_nlink = 0; 2098 inode->i_nlink = 0;
@@ -2139,7 +2127,7 @@ int ocfs2_create_inode_in_orphan(struct inode *dir,
2139 insert_inode_hash(inode); 2127 insert_inode_hash(inode);
2140leave: 2128leave:
2141 if (status < 0 && did_quota_inode) 2129 if (status < 0 && did_quota_inode)
2142 vfs_dq_free_inode(inode); 2130 dquot_free_inode(inode);
2143 if (handle) 2131 if (handle)
2144 ocfs2_commit_trans(osb, handle); 2132 ocfs2_commit_trans(osb, handle);
2145 2133
diff --git a/fs/ocfs2/quota_global.c b/fs/ocfs2/quota_global.c
index aa66fb277225..ed96b3eeb13c 100644
--- a/fs/ocfs2/quota_global.c
+++ b/fs/ocfs2/quota_global.c
@@ -853,8 +853,6 @@ static void ocfs2_destroy_dquot(struct dquot *dquot)
853const struct dquot_operations ocfs2_quota_operations = { 853const struct dquot_operations ocfs2_quota_operations = {
854 .initialize = dquot_initialize, 854 .initialize = dquot_initialize,
855 .drop = dquot_drop, 855 .drop = dquot_drop,
856 .alloc_inode = dquot_alloc_inode,
857 .free_inode = dquot_free_inode,
858 .transfer = dquot_transfer, 856 .transfer = dquot_transfer,
859 .write_dquot = ocfs2_write_dquot, 857 .write_dquot = ocfs2_write_dquot,
860 .acquire_dquot = ocfs2_acquire_dquot, 858 .acquire_dquot = ocfs2_acquire_dquot,