diff options
author | Christoph Hellwig <hch@infradead.org> | 2010-03-03 09:05:01 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-03-04 18:20:28 -0500 |
commit | 63936ddaa16b9486e2d426ed7b09f559a5c60f87 (patch) | |
tree | 4cb1c4581799e10c26dd71d1a7d420de3c2cfd05 /fs/ocfs2/namei.c | |
parent | 5dd4056db84387975140ff2568eaa0406f07985e (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/namei.c')
-rw-r--r-- | fs/ocfs2/namei.c | 30 |
1 files changed, 9 insertions, 21 deletions
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; |
432 | leave: | 428 | leave: |
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); |
2140 | leave: | 2128 | leave: |
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 | ||