aboutsummaryrefslogtreecommitdiffstats
path: root/fs/quota
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-03-03 09:05:03 -0500
committerJan Kara <jack@suse.cz>2010-03-04 18:20:29 -0500
commitb43fa8284d7790d9cca32c9c55e24f29be2fa33b (patch)
treeacb7f205fe2a1ae324e0e11c50f43baaa6b8dfab /fs/quota
parent759bfee658beab14af7b357156461d0eb852be2c (diff)
dquot: cleanup dquot transfer routine
Get rid of the transfer 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_transfer helper to __dquot_transfer and vfs_dq_transfer to dquot_transfer to have a consistent namespace, and make the new dquot_transfer return a normal negative errno value which all callers expect. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/quota')
-rw-r--r--fs/quota/dquot.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index ed131318b849..78ce4c48ad77 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1669,7 +1669,7 @@ EXPORT_SYMBOL(dquot_free_inode);
1669 * This operation can block, but only after everything is updated 1669 * This operation can block, but only after everything is updated
1670 * A transaction must be started when entering this function. 1670 * A transaction must be started when entering this function.
1671 */ 1671 */
1672int dquot_transfer(struct inode *inode, qid_t *chid, unsigned long mask) 1672static int __dquot_transfer(struct inode *inode, qid_t *chid, unsigned long mask)
1673{ 1673{
1674 qsize_t space, cur_space; 1674 qsize_t space, cur_space;
1675 qsize_t rsv_space = 0; 1675 qsize_t rsv_space = 0;
@@ -1766,12 +1766,11 @@ over_quota:
1766 ret = NO_QUOTA; 1766 ret = NO_QUOTA;
1767 goto warn_put_all; 1767 goto warn_put_all;
1768} 1768}
1769EXPORT_SYMBOL(dquot_transfer);
1770 1769
1771/* Wrapper for transferring ownership of an inode for uid/gid only 1770/* Wrapper for transferring ownership of an inode for uid/gid only
1772 * Called from FSXXX_setattr() 1771 * Called from FSXXX_setattr()
1773 */ 1772 */
1774int vfs_dq_transfer(struct inode *inode, struct iattr *iattr) 1773int dquot_transfer(struct inode *inode, struct iattr *iattr)
1775{ 1774{
1776 qid_t chid[MAXQUOTAS]; 1775 qid_t chid[MAXQUOTAS];
1777 unsigned long mask = 0; 1776 unsigned long mask = 0;
@@ -1786,12 +1785,12 @@ int vfs_dq_transfer(struct inode *inode, struct iattr *iattr)
1786 } 1785 }
1787 if (sb_any_quota_active(inode->i_sb) && !IS_NOQUOTA(inode)) { 1786 if (sb_any_quota_active(inode->i_sb) && !IS_NOQUOTA(inode)) {
1788 vfs_dq_init(inode); 1787 vfs_dq_init(inode);
1789 if (inode->i_sb->dq_op->transfer(inode, chid, mask) == NO_QUOTA) 1788 if (__dquot_transfer(inode, chid, mask) == NO_QUOTA)
1790 return 1; 1789 return -EDQUOT;
1791 } 1790 }
1792 return 0; 1791 return 0;
1793} 1792}
1794EXPORT_SYMBOL(vfs_dq_transfer); 1793EXPORT_SYMBOL(dquot_transfer);
1795 1794
1796/* 1795/*
1797 * Write info of quota file to disk 1796 * Write info of quota file to disk
@@ -1814,7 +1813,6 @@ EXPORT_SYMBOL(dquot_commit_info);
1814const struct dquot_operations dquot_operations = { 1813const struct dquot_operations dquot_operations = {
1815 .initialize = dquot_initialize, 1814 .initialize = dquot_initialize,
1816 .drop = dquot_drop, 1815 .drop = dquot_drop,
1817 .transfer = dquot_transfer,
1818 .write_dquot = dquot_commit, 1816 .write_dquot = dquot_commit,
1819 .acquire_dquot = dquot_acquire, 1817 .acquire_dquot = dquot_acquire,
1820 .release_dquot = dquot_release, 1818 .release_dquot = dquot_release,